Skip to content

Commit 4b90875

Browse files
committed
Merge release/26.10 into main
2 parents 19dbb25 + 30857e4 commit 4b90875

6 files changed

Lines changed: 103 additions & 4 deletions

File tree

.github/actions/devcontainer-json/action.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#! /usr/bin/env bash
22

33
# cd to the repo root
4-
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../../../";
4+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5+
cd "${script_dir}/../../../" || exit 1
56

67
os="${1:-"ubuntu:22.04"}";
78
features="${2:-"[]"}";
89
container_env="${3:-"null"}";
910

10-
VERSION="$(git describe --abbrev=0 --tags --first-parent | sed 's/[a-zA-Z]//g' | cut -d '.' -f -2)";
11+
# VERSION is updated before the alpha tag is created during release rollover.
12+
# Use it as the source of truth so a release workflow triggered by that update
13+
# publishes the new image namespace instead of the previous tagged version.
14+
VERSION="$(cut -d '.' -f 1-2 VERSION)";
1115
tag="$(node -p "$(cat <<EOF
1216
['cpp', ...${features}.filter((x) => !x.hide).map(({ name = '', version = '', suffix = '' }) => {
1317
if (name.includes(':')) {

.github/workflows/build-test-and-push-windows-image.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ jobs:
5454
repo="$INPUT_REPO";
5555
cl="$(echo "$INPUT_FEATURES" | jq -r '.[1].version')";
5656
cuda="$(echo "$INPUT_FEATURES" | jq -r '.[0].version')";
57-
version="$(git describe --abbrev=0 --tags --first-parent | sed 's/[a-zA-Z]//g' | cut -d '.' -f -2)";
57+
# VERSION changes before the alpha tag exists during release rollover.
58+
# Reading it directly keeps producer tags aligned with their consumers.
59+
version="$(cut -d '.' -f 1-2 VERSION)";
5860
base_tag="cl${cl}-cuda${cuda}";
5961
tag_without_os="${version}-${base_tag}";
6062
cat <<EOF | tee "$GITHUB_OUTPUT"

.github/workflows/release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,25 @@ jobs:
8484
scenarios: "${{ needs.features-matrix.outputs.scenarios }}"
8585
full_matrix: "${{ github.event_name == 'workflow_dispatch' && 'true' || 'false' }}"
8686

87+
validate-devcontainer-bases:
88+
name: Validate devcontainer base images
89+
needs: check-event
90+
permissions:
91+
contents: read
92+
runs-on: ubuntu-latest
93+
steps:
94+
- name: Checkout ${{ github.repository }}
95+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
96+
with:
97+
persist-credentials: false
98+
99+
- name: Validate unified devcontainer bases
100+
run: ci/validate-devcontainer-bases.sh
101+
87102
release-linux:
88103
if: needs.image-matrix.outputs.linux != '{"include":[]}'
89104
name: ${{ matrix.name || 'Linux' }}
90-
needs: image-matrix
105+
needs: [image-matrix, validate-devcontainer-bases]
91106
permissions:
92107
contents: read
93108
secrets: inherit # zizmor: ignore[secrets-inherit]

.github/workflows/test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ jobs:
4343
- name: Run pre-commit
4444
run: pip install pre-commit && pre-commit run --all-files
4545

46+
shellcheck:
47+
name: ShellCheck
48+
permissions:
49+
contents: read
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout ${{ github.repository }}
53+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
54+
with:
55+
persist-credentials: false
56+
57+
- name: Run ShellCheck
58+
run: shellcheck .github/actions/devcontainer-json/action.sh ci/validate-devcontainer-bases.sh
59+
4660
build-all-rapids-repos:
4761
if: needs.check-event.outputs.ok == 'true' && github.repository_owner == 'rapidsai'
4862
name: Build

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ repos:
44
rev: v1.25.2
55
hooks:
66
- id: zizmor
7+
- repo: local
8+
hooks:
9+
- id: validate-devcontainer-bases
10+
name: validate devcontainer base images
11+
entry: ci/validate-devcontainer-bases.sh
12+
language: system
13+
pass_filenames: false

ci/validate-devcontainer-bases.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
cd "$(dirname "${BASH_SOURCE[0]}")/.."
6+
7+
full_version="$(tr -d '[:space:]' < VERSION)"
8+
if [[ ! "${full_version}" =~ ^[0-9]{2}\.[0-9]{2}\.[0-9]{2}$ ]]; then
9+
echo "VERSION must use YY.MM.PP format; found '${full_version}'" >&2
10+
exit 1
11+
fi
12+
short_version="${full_version%.*}"
13+
14+
expected_tags="$(mktemp)"
15+
trap 'rm -f "${expected_tags}"' EXIT
16+
17+
# Recreate the visible part of every Linux image name from matrix.yml. Hidden
18+
# features affect image contents but, by design, do not appear in image tags.
19+
yq --yaml-fix-merge-anchor-to-spec -eMo json matrix.yml \
20+
| jq -r --arg version "${short_version}" '
21+
.include[]
22+
| select(.os != "windows")
23+
| (.os | gsub(":"; "")) as $os
24+
| .images[]
25+
| (.features
26+
| map(
27+
select(.hide != true)
28+
| (.name | split("/")[-1] | split(":")[0])
29+
+ (.version // "" | tostring)
30+
+ (.suffix // "" | tostring)
31+
)
32+
| (. + [$os])
33+
| join("-")
34+
) as $name
35+
# The release publishes both the OS-qualified tag and an OS-free alias.
36+
| [
37+
$version + "-cpp-" + $name,
38+
$version + "-cpp-" + ($name | sub("-" + $os + "$"; ""))
39+
]
40+
| .[]
41+
' \
42+
| sort -u > "${expected_tags}"
43+
44+
status=0
45+
while IFS=$'\t' read -r file base; do
46+
[[ "${base}" == rapidsai/devcontainers:* ]] || continue
47+
tag="${base#rapidsai/devcontainers:}"
48+
if ! grep -Fqx -- "${tag}" "${expected_tags}"; then
49+
echo "${file}: BASE '${base}' is not produced by matrix.yml" >&2
50+
status=1
51+
fi
52+
done < <(
53+
find .devcontainer -name devcontainer.json -exec \
54+
jq -r '[input_filename, (.build.args.BASE // "")] | @tsv' {} +
55+
)
56+
57+
exit "${status}"

0 commit comments

Comments
 (0)