Skip to content

Commit 6af283d

Browse files
committed
Fix permissions problem
1 parent 7a4a765 commit 6af283d

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

opendrift_leeway_webgui/leeway/tasks.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import os
23
import subprocess
34
from datetime import timedelta
45
from pathlib import Path
@@ -27,6 +28,12 @@ def run_leeway_simulation(request_id):
2728
params = [
2829
"docker",
2930
"run",
31+
"--user",
32+
f"{os.getuid()}:{os.getgid()}",
33+
"-e",
34+
"HOME=/tmp/code/leeway",
35+
"-e",
36+
"MPLCONFIGDIR=/tmp/code/leeway/.matplotlib",
3037
"-e",
3138
f"COPERNICUSMARINE_SERVICE_USERNAME={settings.COPERNICUSMARINE_SERVICE_USERNAME}",
3239
"-e",

tests/leeway/test_simulation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def _teardown_test_simulation(uuid, settings):
6262
"""
6363
print(f"UUID of the generated simulation: {uuid}")
6464
simulation = LeewaySimulation.objects.get(uuid=uuid)
65-
assert simulation.traceback
6665
# Assert that the simulation was successful and an images has been generated
6766
assert simulation.img
6867
# Test that one message has been sent.

0 commit comments

Comments
 (0)