Errors found trying to deploy Gisola on a Docker container #64
-
|
Greetings @nikosT I'm trying to deploy Gisola on a Docker container but I found some problems. So before describe problem found, first I was wondering if you consider this option availaible? I build a container for Gisola program and I enter to that container and ran benchmark test and even I test the conection to a Seiscomp database and It works perfectly, the problem that I found is when I try to run Gisola commands from outside of the container. For instance, the program give this error when I run the suggested test in wiki using docker compose exec # run benchmark
docker compose exec --workdir /app/Gisola/src/ gisola conda run -n gisola python3 ./gisola.py -c ../test/config.yaml --event-xml ../test/benchmark/event.xmlThe program return this error: 2026-03-28 10:07:21,186 INFO Function 'calculateInversions' executed 5.8 seconds
2026-03-28 10:07:21,187 ERROR Fatal Error occurred
Traceback (most recent call last):
File "/app/Gisola/src/./gisola.py", line 235, in <module>
isola.gatherResults()
File "/app/Gisola/src/config.py", line 181, in inner
func(*args, **kwargs)
File "/app/Gisola/src/isola.py", line 428, in gatherResults
with open(os.path.join(workdir,'inversions', inversion,'inv1.dat')) as _:
FileNotFoundError: [Errno 2] No such file or directory: '../test/results/2020/noa2020vipzs/2026-03-28T10:05:08.276913Z/inversions/0.0.0.0.0.0/inv1.dat'
2026-03-28 10:07:21,190 INFO Moving to next event, if anyNote SYSTEM AND PROGRAM VERSIONS USED I hope you can give some suggestions to solve that problem. It will be very valuable Thanks in advance for your attention Sincerely William Eduardo |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Thanks for bringing this up! It's great that you're taking the initiative to containerize Gisola. Since you mentioned that the benchmark works perfectly when you are inside the container, but fails with FileNotFoundError when executing from the outside via docker compose exec, the issue is almost certainly related to how the environment variables or paths or docker volumes are loaded during non-interactive execution. When the Python script fails to find inv1.dat, most probably means the underlying Fortran inversion binaries silently failed to execute or write their output. I'm not sure if I suggest to wrap the execution in a standard bash command that explicitly sources Conda, activates the environment, and runs the script in one go. Try running this instead: docker compose exec gisola /bin/bash -c "source /opt/conda/etc/profile.d/conda.sh && conda activate gisola && cd /app/Gisola/src && python3 ./gisola.py -c ../test/config.yaml --event-xml ../test/benchmark/event.xml"(Note: You may need to adjust the /opt/conda/etc/... path depending on where Miniconda/Anaconda is installed inside your base image). In case you are using docker Volumes, then if your docker-compose.yml mounts the Gisola directory as a volume to your host machine, docker compose exec might be running as a different user (e.g., root) than the one who owns the mounted directory. This can prevent the underlying binaries from creating the ../test/results/... directories or writing inv1.dat. Therefore, you can explicitly pass your host user's UID/GID to the execution command: docker compose exec --user $(id -u):$(id -g) --workdir /app/Gisola/src/ gisola <rest of your command>Could you try the /bin/bash -c method above and let me know if it successfully generates the outputs? If it still fails, it would be helpful to check if the inversions/0.0.0.0.0.0/ directory is actually being created empty, or if the directory creation itself is failing. Also, please provide me with a reproducible example. Let me know what you find! |
Beta Was this translation helpful? Give feedback.
-
|
Hello @nikosT, First of all, I appreciate your quick answer. Following your recomendations, First of all, I tried /bin/bash -c method to execute Benchmark test. It failed. I checked inversions folder and found that the directories sucessfully created but inside of them there's any .dat files (See following image)
Then I tried to run the same command but explictly passed my host user's UID/GID using the following execution command: docker compose exec --user $(id -u):$(id -g) --workdir /app/Gisola/src/ gisola /bin/bash -c "source /opt/conda/etc/profile.d/conda.sh && conda activate gisola && cd /app/Gisola/src && python3 ./gisola.py -c ../test/config.yaml --event-xml ../test/benchmark/event.xml"It returned the following error: Matplotlib created a temporary config/cache directory at /tmp/matplotlib-hbgdqt10 because the default path (/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
Traceback (most recent call last):
File "/app/Gisola/src/./gisola.py", line 99, in <module>
logger = config.setup_logger('gisola_log', args.log)
File "/app/Gisola/src/config.py", line 33, in setup_logger
handler = logging.FileHandler(log_file)
File "/opt/conda/envs/gisola/lib/python3.9/logging/__init__.py", line 1142, in __init__
StreamHandler.__init__(self, self._open())
File "/opt/conda/envs/gisola/lib/python3.9/logging/__init__.py", line 1171, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding,
PermissionError: [Errno 13] Permission denied: '/app/Gisola/src/log'Finally, I attach you Dockerfile and docker-compose.yml files used to create gisola container here and below I explain in detail steps that I did for deploy the container. docker-compose.YML Tip Please remove .txt extension from Dockerfile and change extension of docker-compose file to yml, because I had to assign them like this to be able to attach files here. Note Steps done to deploy gisola container:
docker compose up -dVersions used: docker = 29.2.1; docker compose = 5.0.2 Thanks in advance for your interest and don't hesitate to ask me for any further information. |
Beta Was this translation helpful? Give feedback.

Hi @WilliamEpenarandaA, apologies for the delay.
environment.ymlyou can just move the ObsPy frompipto theDependencies:I strongly suggest NOT to change the specified ObsPy version, otherwis…