Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/actions/devcontainer-json/action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ tag="$(node -p "$(cat <<EOF
})].join('-')
EOF
)")";
tag="${VERSION:-latest}-${tag}-$(echo "${os}" | tr -d :)";
base_tag="${tag}-$(echo "${os}" | tr -d :)";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason the tag doesn't have latest in it? That's the usual convention for docker images.

i.e. latest-cpp-nvhpc25.11 is an alias of 26.02-cpp-nvhpc25.11

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with that. We didn't do that for ci-imgs because latest means something different (the configuration with latest supported CUDA / latest supported Python).


echo "tag=${tag}" >&3;
echo "base_tag=${base_tag}" >&3;
echo "version=${VERSION:-latest}" >&3;

node -e "$(cat <<EOF

Expand Down
6 changes: 4 additions & 2 deletions .github/actions/devcontainer-json/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ inputs:
required: false

outputs:
tag:
value: ${{ steps.json.outputs.tag }}
base_tag:
value: ${{ steps.json.outputs.base_tag }}
version:
value: ${{ steps.json.outputs.version }}

runs:
using: composite
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/build-test-and-push-linux-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ jobs:
outputs:
hash_amd64: ${{ steps.build.outputs.hash_amd64 }}
hash_arm64: ${{ steps.build.outputs.hash_arm64 }}
tag: ${{ steps.json.outputs.tag }}
base_tag: ${{ steps.json.outputs.base_tag }}
version: ${{ steps.json.outputs.version }}
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
Expand All @@ -63,13 +64,13 @@ jobs:
password: ${{ secrets.GPUCIBOT_DOCKERHUB_TOKEN || secrets.DOCKERHUB_TOKEN }}

- id: build
name: Build ${{ steps.json.outputs.tag }}-${{ matrix.arch }}
name: Build ${{ steps.json.outputs.version }}-${{ steps.json.outputs.base_tag }}-${{ matrix.arch }}
uses: ./.github/actions/build-linux-image
with:
arch: "${{ matrix.arch }}"
repo: "${{ inputs.repo }}"
push: "${{ inputs.push }}"
tag: "${{ steps.json.outputs.tag }}"
tag: "${{ steps.json.outputs.version }}-${{ steps.json.outputs.base_tag }}"

push-to-dockerhub:
if: inputs.push == 'true'
Expand All @@ -89,15 +90,26 @@ jobs:
env:
hash_amd64: "${{ needs.build-test-and-upload.outputs.hash_amd64 }}"
hash_arm64: "${{ needs.build-test-and-upload.outputs.hash_arm64 }}"
name: "${{ inputs.repo }}:${{ needs.build-test-and-upload.outputs.tag }}"
repo: "${{ inputs.repo }}"
base_tag: "${{ needs.build-test-and-upload.outputs.base_tag }}"
version: "${{ needs.build-test-and-upload.outputs.version }}"
os: "${{ inputs.os }}"
ref_name: "${{ github.ref_name }}"
run: |
# Ensure name is lowercase
name="${name,,}";
# Ensure repo is lowercase
repo="${repo,,}";
name="${repo}:${version}-${base_tag}";
docker manifest rm "${name}" || true;
sleep 5;
# Create and push the multiarch manifest
docker buildx imagetools create --tag "${name}" "$hash_amd64" "$hash_arm64";
sleep 5;
# Create and push the multiarch manifest without the OS in the tag
docker buildx imagetools create --tag "${name/%-${os//:/}}" "$hash_amd64" "$hash_arm64";
# Create and push the multiarch manifest without RAPIDS version (main branch only)
if [[ "${ref_name}" == "main" ]]; then
sleep 5;
docker buildx imagetools create --tag "${repo}:latest-${base_tag}" "$hash_amd64" "$hash_arm64";
sleep 5;
docker buildx imagetools create --tag "${repo}:latest-${base_tag/%-${os//:/}}" "$hash_amd64" "$hash_arm64";
fi
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
26.02.00
85 changes: 71 additions & 14 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,97 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
#################################
# devcontainers Version Updater #
#################################

## Usage
# bash update-version.sh <new_version>
# Primary interface: bash update-version.sh <new_version> [--run-context=main|release]
# Fallback interface: [RAPIDS_RUN_CONTEXT=main|release] bash update-version.sh <new_version>
# CLI arguments take precedence over environment variables
# Defaults to main when no run-context is specified

set -euo pipefail

# Parse command line arguments
CLI_RUN_CONTEXT=""
VERSION_ARG=""

for arg in "$@"; do
case $arg in
--run-context=*)
CLI_RUN_CONTEXT="${arg#*=}"
shift
;;
*)
if [[ -z "$VERSION_ARG" ]]; then
VERSION_ARG="$arg"
fi
;;
esac
done

# Format is YY.MM.PP - no leading 'v' or trailing 'a'
NEXT_FULL_TAG=$1
NEXT_FULL_TAG="$VERSION_ARG"

# Determine RUN_CONTEXT with CLI precedence over environment variable, defaulting to main
if [[ -n "$CLI_RUN_CONTEXT" ]]; then
RUN_CONTEXT="$CLI_RUN_CONTEXT"
echo "Using run-context from CLI: $RUN_CONTEXT"
elif [[ -n "${RAPIDS_RUN_CONTEXT:-}" ]]; then
RUN_CONTEXT="$RAPIDS_RUN_CONTEXT"
echo "Using run-context from environment: $RUN_CONTEXT"
else
RUN_CONTEXT="main"
echo "No run-context provided, defaulting to: $RUN_CONTEXT"
fi

# Validate RUN_CONTEXT value
if [[ "${RUN_CONTEXT}" != "main" && "${RUN_CONTEXT}" != "release" ]]; then
echo "Error: Invalid run-context value '${RUN_CONTEXT}'"
echo "Valid values: main, release"
exit 1
fi

# Validate version argument
if [[ -z "$NEXT_FULL_TAG" ]]; then
echo "Error: Version argument is required"
echo "Usage: $0 <new_version> [--run-context=<context>]"
echo " or: [RAPIDS_RUN_CONTEXT=<context>] $0 <new_version>"
echo "Note: Defaults to main when run-context is not specified"
exit 1
fi

# Get current version
CURRENT_TAG=$(git tag --merged HEAD | grep -xE '^v.*' | sort --version-sort | tail -n 1 | tr -d 'v')
CURRENT_MAJOR=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[1]}')
CURRENT_MINOR=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[2]}')
CURRENT_PATCH=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[3]}')
CURRENT_MAJOR=$(echo "$CURRENT_TAG" | awk '{split($0, a, "."); print a[1]}')
CURRENT_MINOR=$(echo "$CURRENT_TAG" | awk '{split($0, a, "."); print a[2]}')
CURRENT_SHORT_TAG=${CURRENT_MAJOR}.${CURRENT_MINOR}

# Get <major>.<minor> for next version
NEXT_MAJOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[1]}')
NEXT_MINOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[2]}')
NEXT_PATCH=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[3]}')
NEXT_MAJOR=$(echo "$NEXT_FULL_TAG" | awk '{split($0, a, "."); print a[1]}')
NEXT_MINOR=$(echo "$NEXT_FULL_TAG" | awk '{split($0, a, "."); print a[2]}')
NEXT_PATCH=$(echo "$NEXT_FULL_TAG" | awk '{split($0, a, "."); print a[3]}')
NEXT_SHORT_TAG=${NEXT_MAJOR}.${NEXT_MINOR}
NEXT_FULL_TAG=${NEXT_MAJOR}.${NEXT_MINOR}.${NEXT_PATCH}
NEXT_UCXX_SHORT_TAG="$(curl -sL https://version.gpuci.io/rapids/${NEXT_SHORT_TAG})"

# Need to distutils-normalize the versions for some use cases
CURRENT_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; print(Version('${CURRENT_SHORT_TAG}'))")
NEXT_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; print(Version('${NEXT_SHORT_TAG}'))")
NEXT_FULL_TAG_PEP440=$(python -c "from packaging.version import Version; print(Version('${NEXT_FULL_TAG}'))")
echo "current is ${CURRENT_SHORT_TAG_PEP440}, next is ${NEXT_SHORT_TAG_PEP440}"

echo "Preparing release $CURRENT_TAG => $NEXT_FULL_TAG"
# Log update context
if [[ "${RUN_CONTEXT}" == "main" ]]; then
echo "Preparing development branch update $CURRENT_TAG => $NEXT_FULL_TAG (targeting main branch)"
elif [[ "${RUN_CONTEXT}" == "release" ]]; then
echo "Preparing release branch update $CURRENT_TAG => $NEXT_FULL_TAG (targeting release/${NEXT_SHORT_TAG} branch)"
fi

# Centralized version file update
echo "${NEXT_FULL_TAG}" > VERSION

# Inplace sed replace; workaround for Linux and Mac
function sed_runner() {
sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak
sed -i.bak ''"$1"'' "$2" && rm -f "${2}".bak
}

sed_runner "s/devcontainers:.*-cpp/devcontainers:${NEXT_SHORT_TAG}-cpp/g" USAGE.md
Expand Down
Loading