From 9ed12a629edd756f4195fceea1c4fe97bec086ec Mon Sep 17 00:00:00 2001 From: ptaylor Date: Fri, 9 Aug 2024 10:41:07 -0700 Subject: [PATCH] use -I to upgrade pip in ubuntu:noble+ --- .../devcontainer-feature.json | 2 +- features/src/rapids-build-utils/install.sh | 19 ++++++++++++++----- features/src/utils/devcontainer-feature.json | 2 +- features/src/utils/install.sh | 14 ++++++++++---- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/features/src/rapids-build-utils/devcontainer-feature.json b/features/src/rapids-build-utils/devcontainer-feature.json index 1624b405..93bb5f5f 100644 --- a/features/src/rapids-build-utils/devcontainer-feature.json +++ b/features/src/rapids-build-utils/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "NVIDIA RAPIDS devcontainer build utilities", "id": "rapids-build-utils", - "version": "24.10.3", + "version": "24.10.4", "description": "A feature to install the RAPIDS devcontainer build utilities", "containerEnv": { "BASH_ENV": "/etc/bash.bash_env" diff --git a/features/src/rapids-build-utils/install.sh b/features/src/rapids-build-utils/install.sh index 85bdbedb..893d1d7a 100644 --- a/features/src/rapids-build-utils/install.sh +++ b/features/src/rapids-build-utils/install.sh @@ -33,13 +33,22 @@ fi source /etc/lsb-release; -if [[ ! "23.04" > "${DISTRIB_RELEASE}" ]]; then - BREAK_PACKAGES="--break-system-packages"; +declare -a _PIP_INSTALL_ARGS=() +declare -a _PIP_UPGRADE_ARGS=(--upgrade) + +if [[ "${DISTRIB_RELEASE}" > "22.04" ]]; then + _PIP_INSTALL_ARGS+=(--break-system-packages); + if [[ "${DISTRIB_RELEASE}" > "23.04" ]]; then + _PIP_UPGRADE_ARGS+=(--ignore-installed); + fi fi -# Install the rapids dependency file generator and conda-merge -/usr/bin/python3 -m pip install $BREAK_PACKAGES -U pip; -/usr/bin/python3 -m pip install $BREAK_PACKAGES 'rapids-dependency-file-generator<1.14' conda-merge toml; +/usr/bin/python3 -m pip install "${_PIP_INSTALL_ARGS[@]}" "${_PIP_UPGRADE_ARGS[@]}" pip; +# Install RAPIDS dependency file generator, conda-merge, and toml +/usr/bin/python3 -m pip install "${_PIP_INSTALL_ARGS[@]}" \ + 'rapids-dependency-file-generator<1.14' \ + conda-merge \ + toml; # Install RAPIDS build utility scripts to /opt/ diff --git a/features/src/utils/devcontainer-feature.json b/features/src/utils/devcontainer-feature.json index 384bfae9..97d0f155 100644 --- a/features/src/utils/devcontainer-feature.json +++ b/features/src/utils/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "devcontainer-utils", "id": "utils", - "version": "24.10.0", + "version": "24.10.1", "description": "A feature to install RAPIDS devcontainer utility scripts", "containerEnv": { "BASH_ENV": "/etc/bash.bash_env" diff --git a/features/src/utils/install.sh b/features/src/utils/install.sh index 9b1e869d..56894de9 100644 --- a/features/src/utils/install.sh +++ b/features/src/utils/install.sh @@ -31,12 +31,18 @@ check_packages "${PKGS[@]}"; source /etc/lsb-release; -if [[ ! "23.04" > "${DISTRIB_RELEASE}" ]]; then - BREAK_PACKAGES="--break-system-packages"; +# Upgrade system pip +declare -a _PIP_INSTALL_ARGS=() +declare -a _PIP_UPGRADE_ARGS=(--upgrade) + +if [[ "${DISTRIB_RELEASE}" > "22.04" ]]; then + _PIP_INSTALL_ARGS+=(--break-system-packages); + if [[ "${DISTRIB_RELEASE}" > "23.04" ]]; then + _PIP_UPGRADE_ARGS+=(--ignore-installed); + fi fi -# upgrade pip -/usr/bin/python3 -m pip install $BREAK_PACKAGES -U pip; +/usr/bin/python3 -m pip install "${_PIP_INSTALL_ARGS[@]}" "${_PIP_UPGRADE_ARGS[@]}" pip; # Install yq if not installed if ! type yq >/dev/null 2>&1; then