Add conda package directories support

Added CONDA_PKGS_DIRS environment variable setting to ensure conda
looks in the correct package cache directories inside the container.
This matches the pattern used for CONDA_ENVS_DIRS.
This commit is contained in:
Vishal Jain 2025-06-18 01:05:33 +01:00
parent 1d1d6bcbaf
commit 67f2692aad

View File

@ -82,6 +82,7 @@ fi
if [ -n "$CONDA_EXTRA_DIRS" ]; then
echo "✓ Mounting additional conda directories..."
CONDA_ENVS_PATHS=""
CONDA_PKGS_PATHS=""
for dir in $CONDA_EXTRA_DIRS; do
if [ -d "$dir" ]; then
echo " - Mounting $dir"
@ -94,6 +95,14 @@ if [ -n "$CONDA_EXTRA_DIRS" ]; then
CONDA_ENVS_PATHS="$CONDA_ENVS_PATHS:$dir"
fi
fi
# Build comma-separated list for CONDA_PKGS_DIRS
if [[ "$dir" == *"pkg"* ]]; then
if [ -z "$CONDA_PKGS_PATHS" ]; then
CONDA_PKGS_PATHS="$dir"
else
CONDA_PKGS_PATHS="$CONDA_PKGS_PATHS:$dir"
fi
fi
else
echo " - Skipping $dir (not found)"
fi
@ -103,6 +112,11 @@ if [ -n "$CONDA_EXTRA_DIRS" ]; then
ENV_ARGS="$ENV_ARGS -e CONDA_ENVS_DIRS=$CONDA_ENVS_PATHS"
echo " - Setting CONDA_ENVS_DIRS=$CONDA_ENVS_PATHS"
fi
# Set CONDA_PKGS_DIRS environment variable if we found pkg paths
if [ -n "$CONDA_PKGS_PATHS" ]; then
ENV_ARGS="$ENV_ARGS -e CONDA_PKGS_DIRS=$CONDA_PKGS_PATHS"
echo " - Setting CONDA_PKGS_DIRS=$CONDA_PKGS_PATHS"
fi
else
echo "No additional conda directories configured"
fi