diff --git a/features/src/gitlab-cli/devcontainer-feature.json b/features/src/gitlab-cli/devcontainer-feature.json index 4286d820..4b4a2b35 100644 --- a/features/src/gitlab-cli/devcontainer-feature.json +++ b/features/src/gitlab-cli/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "gitlab-cli", - "version": "24.12.0", + "version": "24.12.1", "name": "GitLab CLI", "documentationURL": "https://github.com/rapidsai/devcontainers/features/tree/main/src/gitlab-cli", "description": "Installs the GitLab CLI. Auto-detects latest version and installs needed dependencies.", @@ -8,8 +8,7 @@ "version": { "type": "string", "proposals": [ - "latest", - "none" + "latest" ], "default": "latest", "description": "Select version of the GitLab CLI, if not latest." diff --git a/features/src/gitlab-cli/install.sh b/features/src/gitlab-cli/install.sh index d5550483..e13122e4 100755 --- a/features/src/gitlab-cli/install.sh +++ b/features/src/gitlab-cli/install.sh @@ -13,48 +13,62 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; # install global/common scripts . ./common/install.sh; +gitlab_cli_file_name() { + local -; + set -euo pipefail; + + local os="$(uname -s)"; + local arch="${TARGETARCH:-}"; + + if [[ "${CLI_VERSION}" < "1.47.0" ]]; then + arch="${arch:-$(uname -m)}"; + else + arch="${arch:-$(dpkg --print-architecture | awk -F'-' '{print $NF}')}"; + os="${os,,}"; + fi + + echo "glab_${CLI_VERSION}_${os}_${arch}.deb"; +} + +download_gitlab_cli_deb() { + local -; + set -euo pipefail; + wget --no-hsts -q -O /tmp/gitlab-cli.deb \ + "https://gitlab.com/gitlab-org/cli/-/releases/v${CLI_VERSION}/downloads/$(gitlab_cli_file_name)"; +} + # Fall back on direct download if no apt package exists # Fetches .deb file to be installed with dpkg install_deb_using_gitlab() { + local -; + set -euo pipefail; + check_packages wget; - arch="${TARGETARCH:-$(dpkg --print-architecture | awk -F'-' '{print $NF}')}"; - if [[ "$arch" == amd64 ]]; then - arch=x86_64; - fi - find_version_from_git_tags CLI_VERSION https://gitlab.com/gitlab-org/cli; - cli_filename="glab_${CLI_VERSION}_Linux_${arch}.deb"; - - mkdir -p /tmp/glabcli; - pushd /tmp/glabcli; - wget https://gitlab.com/gitlab-org/cli/-/releases/v${CLI_VERSION}/downloads/${cli_filename}; - exit_code=$?; - set -e; - if [ "$exit_code" != "0" ]; then - # Handle situation where git tags are ahead of what was is available to actually download - echo "(!) gitlab-cli version ${CLI_VERSION} failed to download. Attempting to fall back one version to retry..."; - find_prev_version_from_git_tags CLI_VERSION https://gitlab.com/gitlab-org/cli; - wget https://gitlab.com/gitlab-org/cli/-/releases/v${CLI_VERSION}/downloads/${cli_filename}; + # Soft version matching + if test "${CLI_VERSION}" = latest || test "${CLI_VERSION}" = stable || test "${CLI_VERSION}" = lts; then + find_version_from_git_tags CLI_VERSION https://gitlab.com/gitlab-org/cli; + while ! download_gitlab_cli_deb; do + # Handle situation where git tags are ahead of what was is available to actually download + echo "(!) gitlab-cli version ${CLI_VERSION} failed to download. Attempting to fall back one version to retry..."; + find_prev_version_from_git_tags CLI_VERSION https://gitlab.com/gitlab-org/cli; + done + else + download_gitlab_cli_deb; fi - dpkg -i /tmp/glabcli/${cli_filename}; - popd; - rm -rf /tmp/glabcli; + dpkg -i /tmp/gitlab-cli.deb; + rm /tmp/gitlab-cli.deb; } export DEBIAN_FRONTEND=noninteractive; -# Install curl, apt-transport-https, curl, or git if missing +# Install curl, ca-certificates, apt-transport-https, and git (if missing) check_packages curl ca-certificates apt-transport-https; if ! type git >/dev/null 2>&1; then check_packages git; fi -# Soft version matching -if [ "${CLI_VERSION}" != "latest" ] && [ "${CLI_VERSION}" != "lts" ] && [ "${CLI_VERSION}" != "stable" ]; then - find_version_from_git_tags CLI_VERSION "https://gitlab.com/gitlab-org/cli"; -fi - # Install the GitHub CLI echo "Downloading gitlab CLI..."; diff --git a/features/src/nvhpc/devcontainer-feature.json b/features/src/nvhpc/devcontainer-feature.json index 2a1b5278..232ec619 100644 --- a/features/src/nvhpc/devcontainer-feature.json +++ b/features/src/nvhpc/devcontainer-feature.json @@ -1,12 +1,14 @@ { "name": "NVHPC SDK", "id": "nvhpc", - "version": "24.12.0", + "version": "24.12.1", "description": "A feature to install the NVHPC SDK", "options": { "version": { "type": "string", "proposals": [ + "24.9", + "24.7", "24.5", "24.3", "24.1", @@ -20,7 +22,7 @@ "22.9", "22.7" ], - "default": "24.5", + "default": "24.9", "description": "Version of NVHPC SDK to install." } }, diff --git a/features/src/nvhpc/install.sh b/features/src/nvhpc/install.sh index b270e0e9..47a173fb 100644 --- a/features/src/nvhpc/install.sh +++ b/features/src/nvhpc/install.sh @@ -58,7 +58,7 @@ check_packages ${pkgs[@]}; export NVHPC="/opt/nvidia/hpc_sdk"; export NVHPC_VERSION="${NVHPC_VERSION}"; export NVHPC_ROOT="${NVHPC}/Linux_$(uname -p)/${NVHPC_VERSION}"; -export NVHPC_CUDA_HOME="${NVHPC_ROOT}/cuda"; +export NVHPC_CUDA_HOME="$(dirname "$(find "$NVHPC_ROOT/cuda" -type f -name 'version.json' | head -n1)")"; export NVHPC_MODULEFILE_DIRS="($(find "${NVHPC}/" -type d -name modulefiles -exec echo -n \"{}\"\ \;))"; if ! test -L /usr/local/cuda; then diff --git a/features/test/nvhpc/test.sh b/features/test/nvhpc/test.sh index feeebca0..42b0ec12 100644 --- a/features/test/nvhpc/test.sh +++ b/features/test/nvhpc/test.sh @@ -24,7 +24,7 @@ module list 1>&2 # Feature-specific tests # The 'check' command comes from the dev-container-features-test-lib. -check "version" bash -c "echo '$NVHPC_VERSION' | grep '24.5'" +check "version" bash -c "echo '$NVHPC_VERSION' | grep '24.9'" check "installed" stat /opt/nvidia/hpc_sdk check "nvc++ exists and is on path" which nvc++ check "mpic++ exists and is on path" which mpic++ diff --git a/matrix.yml b/matrix.yml index 87899546..2e513d5a 100644 --- a/matrix.yml +++ b/matrix.yml @@ -30,8 +30,8 @@ x-llvm-prev: &llvm_18 { name: "llvm", version: "18" } x-llvm-curr: &llvm_19 { name: "llvm", version: "19" } x-llvm-env: &llvm_env { CC: "clang", CXX: "clang++", CUDAHOSTCXX: "clang++" } -x-nvhpc-prev: &nvhpc_prev { name: "nvhpc", version: "24.5" } -x-nvhpc-curr: &nvhpc_curr { name: "nvhpc", version: "24.7" } +x-nvhpc-prev: &nvhpc_prev { name: "nvhpc", version: "24.7" } +x-nvhpc-curr: &nvhpc_curr { name: "nvhpc", version: "24.9" } x-nvhpc-env: &nvhpc_env { CC: "nvc", CXX: "nvc++", CUDAHOSTCXX: "nvc++" }