diff --git a/.devcontainer/cuda12.9-pip/devcontainer.json b/.devcontainer/cuda12.9-pip/devcontainer.json index 62019e1ec..a00382cf5 100644 --- a/.devcontainer/cuda12.9-pip/devcontainer.json +++ b/.devcontainer/cuda12.9-pip/devcontainer.json @@ -5,7 +5,7 @@ "args": { "CUDA": "12.9", "PYTHON_PACKAGE_MANAGER": "pip", - "BASE": "rapidsai/devcontainers:26.10-cpp-cuda12.9-ucx1.19.0-openmpi5.0.10" + "BASE": "rapidsai/devcontainers:26.10-cpp-cuda12.9-ucx1.21.0-openmpi5.0.10" }, "cacheFrom": [ "ghcr.io/rapidsai/devcontainers/devcontainer:26.10-cuda12.9-pip" diff --git a/.devcontainer/cuda13.3-pip/devcontainer.json b/.devcontainer/cuda13.3-pip/devcontainer.json index 08794677e..4008d343d 100644 --- a/.devcontainer/cuda13.3-pip/devcontainer.json +++ b/.devcontainer/cuda13.3-pip/devcontainer.json @@ -5,7 +5,7 @@ "args": { "CUDA": "13.3", "PYTHON_PACKAGE_MANAGER": "pip", - "BASE": "rapidsai/devcontainers:26.10-cpp-cuda13.3-ucx1.19.0-openmpi5.0.10" + "BASE": "rapidsai/devcontainers:26.10-cpp-cuda13.3-ucx1.21.0-openmpi5.0.10" }, "cacheFrom": [ "ghcr.io/rapidsai/devcontainers/devcontainer:26.10-cuda13.3-pip" diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh index c0b6a7160..d1b900874 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/make-pip-env.sh @@ -43,11 +43,24 @@ make_pip_env() { local -r new_env_path="$(realpath -m "/tmp/${env_file_name}")"; local -r old_env_path="$(realpath -m "${HOME}/.local/share/venvs/${env_file_name}")"; + local -a excluded_packages=(ninja); + + # The PyPI OpenMPI wheel bundles its own UCX libraries. Do not install it when the + # devcontainer is configured to use system UCX, because loading those bundled + # libraries alongside system UCX can produce an ABI-incompatible mix. The base + # image already provides an OpenMPI build linked against its system UCX. + if [ "${RAPIDS_LIBUCX_PREFER_SYSTEM_LIBRARY:-false}" = true ]; then + excluded_packages+=(openmpi); + fi + # Create the python env without ninja. # ninja -$(ulimit -n) fails with `ninja: FATAL: pipe: Too many open files`. # This appears to have been fixed 13 years ago (https://github.com/ninja-build/ninja/issues/233), # so that fix needs to be integrated into the kitware pip ninja builds. - rapids-make-pip-dependencies --exclude <(echo ninja) "${OPTS[@]}" > "${new_env_path}"; + rapids-make-pip-dependencies \ + --exclude <(printf '%s\n' "${excluded_packages[@]}") \ + "${OPTS[@]}" \ + > "${new_env_path}"; if test -f "${new_env_path}"; then @@ -63,7 +76,6 @@ make_pip_env() { . "${HOME}/.local/share/venvs/${env_name}/bin/activate"; python -m pip install -U pip; python -m pip install "${pre[@]}" -U -r "${new_env_path}"; - python -m pip uninstall -y ninja >/dev/null 2>&1; # If the venv does exist but it's different from the generated one, # print the diff between the envs and update it elif ! diff -BNqw "${old_env_path}" "${new_env_path}" >/dev/null 2>&1; then @@ -82,9 +94,13 @@ make_pip_env() { . "${HOME}/.local/share/venvs/${env_name}/bin/activate"; python -m pip install -U pip; python -m pip install "${pre[@]}" -U -r "${new_env_path}"; - python -m pip uninstall -y ninja >/dev/null 2>&1; fi + # Keep excluded packages out of reused venvs as well as newly-created ones. + # shellcheck disable=SC1090 + . "${HOME}/.local/share/venvs/${env_name}/bin/activate"; + python -m pip uninstall -y "${excluded_packages[@]}" >/dev/null 2>&1; + cp -a "${new_env_path}" "${old_env_path}"; fi }