digitalfabrik / opendrift-leeway-webgui

OpenDrift Leeway simulations for Search and Rescue operations (experimental!)
https://leeway.tuerantuer.org/
Apache License 2.0
12 stars 3 forks source link

Move simulation dir inside python package #61

Closed timobrembeck closed 1 year ago

timobrembeck commented 1 year ago

The simulation script is currently not part of the PyPI package, so I suggest to move it into the opendrift_leeway_webgui directory. Not sure whether this has any side-effects on the celery execution...

svenseeberg commented 1 year ago

The simulation script is currently not part of the PyPI package, so I suggest to move it into the opendrift_leeway_webgui directory. Not sure whether this has any side-effects on the celery execution...

It should be okay. The path is mounted in the Docker container (https://github.com/digitalfabrik/opendrift-leeway-webgui/blob/main/opendrift_leeway_webgui/leeway/tasks.py#L27). If that the path is good, everything within the container should work as usual.

timobrembeck commented 1 year ago

It should be okay. The path is mounted in the Docker container (https://github.com/digitalfabrik/opendrift-leeway-webgui/blob/main/opendrift_leeway_webgui/leeway/tasks.py#L27). If that the path is good, everything within the container should work as usual.

Ah ok, so this means at the moment it's not advisable to change LEEWAY_SIMULATION_ROOT on the prod system, because then the simulation.py would not be found anymore? From a "separation of code and data"-perspective, it probably makes sense to create a different root-directory for simulation.py and the input/output dirs, right?

svenseeberg commented 1 year ago

Ah ok, so this means at the moment it's not advisable to change LEEWAY_SIMULATION_ROOT on the prod system, because then the simulation.py would not be found anymore?

You changed the path in the settings.py in accordance to the actual path change. Should work IMHO.

From a "separation of code and data"-perspective, it probably makes sense to create a different root-directory for simulation.py and the input/output dirs, right?

True, we probably could use paths totally outside of the application. However, we would either have to mount them separately into the container or symlink them them into the simulation directory.

timobrembeck commented 1 year ago

Ok, what do you think about this solution? I think now we can just create an empty directory /var/www/opendrift-leeway-webgui/simulation/, can define this as SIMULATION_ROOT in the config file and don't have to worry about the location of simulation.py...