docker-image does not take the python tools from the moose envs #32794
Replies: 5 comments 4 replies
-
|
Our docker image is a bit odd. We build everything with apptainer and then convert to docker, which is a bit of a manual process. Part of this includes the environment setup. I do plan on transitioning everything to a docker build at some point, but we're not there yet. In the meantime, at the beginning of each step you should be able to run: source /environmentwhich should set everything you need. Let me know if this doesn't work. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @loganharbour for your quick reply. We are running the pipeline in GitLab, and I have attached the pipeline configuration to this discussion. Best, |
Beta Was this translation helpful? Give feedback.
-
|
I've done some digging here. The issue is that we're not in bash at start up which is screwing up conda's activation scripts. I should be able to fix this in the released container soon. The following worked for me (using the container myself): $ docker run --rm -it idaholab/moose-dev:latest /bin/bash
(moose) bash-4.4# conda deactivate
bash-4.4# source /opt/miniforge3/etc/profile.d/conda.sh
bash-4.4# conda activate moose
(moose) bash-4.4# echo $PATH
/opt/miniforge3/envs/moose/bin:/opt/wasp/bin:/opt/code-server/bin:/opt/miniforge3/bin:/opt/openmpi/bin:/opt/rh/gcc-toolset-13/root/usr/bin:/opt/wasp/bin:/opt/code-server/bin:/opt/miniforge3/condabin:/opt/miniforge3/bin:/opt/openmpi/bin:/opt/rh/gcc-toolset-13/root/usr/bin:/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin
(moose) bash-4.4# which python
/opt/miniforge3/envs/moose/bin/pythonWith that, can you please try adding those commands at the beginning of your step: conda deactivate
source /opt/miniforge3/etc/profile.d/conda.sh
conda activate mooseand report back? With this: python should be correct, pip should be correct, and conda (for conda install) should also be correct. |
Beta Was this translation helpful? Give feedback.
-
|
Many thanks for your support. I ran the suggested commands, and the Python tools are now correctly coming from the I have included the error message below for your reference: :491: RuntimeWarning: compile time Python version 3.13 of module 'hit' does not match runtime version 3.14 |
Beta Was this translation helpful? Give feedback.
-
|
Yes, that happened because of the issue you mentioned. Now, it works for our moose-based app. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Check these boxes if you have followed the posting rules.
Issue or question about MOOSE
dear all,
while trying to set up a CI/CD pipeline in git for a moose-based application, we rely on the docker image installation (moose-dev). However we noticed that all python tools and libraries are not those from the moose env, but those from the conda base env (which lacks all additional libraries like numpy, pandas etc).
In order to compile and test both moose and our moose-based app we have to create a dockerfile and built an image based on moose-dev, and install all additional python tools/libraries in the base env, otherwise when we run the container those are not available.
Are we doing anything wrong or rather is something not properly working with the current docker image?
Thanks for any feedback,
mauro
(Optional) code in question / simulation log / errors
No response
Encountering Errors? Please include diagnostic output
No response
Beta Was this translation helpful? Give feedback.
All reactions