Skip to content

Commit fede38c

Browse files
committed
Set PYTHON_JULIAPKG_PROJECT for Docker
Being in a Conda environment is effectively equivalent to setting: export PYTHON_JULIAPKG_PROJECT="$CONDA_PREFIX/julia_env" The JuliaPy PythonJulia stack (and juliapkg in particular) tries to automatically detect whether it's running inside a Conda or Python virtual environment. But when building a Docker image we're not _exactly_ in a conda environment we're kind of faking it, and so it doesn't detect it and put stuff in the right place. So in the docker context we have to set it explicitly. Let's make it explicit everywhere.
1 parent c724663 commit fede38c

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ RUN make
8888
# setting this env variable fixes an issue with Julia precompilation on Windows
8989
ENV JULIA_CPU_TARGET="x86-64,haswell,skylake,broadwell,znver1,znver2,znver3,cascadelake,icelake-client,cooperlake,generic"
9090
ENV RMS_BRANCH=${RMS_Branch}
91+
# Usually this is set automatically, but we're not actually running
92+
# in an active conda environment when building the Docker so we need to set it manually
93+
ENV PYTHON_JULIAPKG_PROJECT="/miniconda/envs/rmg_env/julia_env"
9194
RUN source install_rms.sh
9295

9396
# RMG-Py should now be installed and ready - trigger precompilation and test run

install_rms.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ echo "Current conda environment: $current_env"
4646
conda env config vars set JULIA_CONDAPKG_BACKEND=Null
4747
conda env config vars set JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python
4848
conda env config vars set PYTHON_JULIAPKG_EXE=$(which julia)
49+
conda env config vars set PYTHON_JULIAPKG_PROJECT=$CONDA_PREFIX/julia_env
4950
# Also export for current shell/session (needed for Docker/non-interactive use)
5051
export JULIA_CONDAPKG_BACKEND=Null
5152
export JULIA_PYTHONCALL_EXE="$CONDA_PREFIX/bin/python"
5253
export PYTHON_JULIAPKG_EXE="$(which julia)"
54+
export PYTHON_JULIAPKG_PROJECT="$CONDA_PREFIX/julia_env"
5355

5456
conda install -y conda-forge::pyjuliacall
5557

0 commit comments

Comments
 (0)