Skip to content

Commit 9c40ed1

Browse files
authored
[Backport branch/3.0x] Add gitlab devcontainers (#5325) (#5352)
* Add gitlab devcontainers (#5325) * Adds internal containers * Exclude cuda99 images from verification * Rebuild containers for 3.0.x
1 parent a1c4764 commit 9c40ed1

File tree

6 files changed

+241
-6
lines changed

6 files changed

+241
-6
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"shutdownAction": "stopContainer",
3+
"image": "gitlab-master.nvidia.com:5005/cccl/cccl-devcontainers:cpp-gcc13-cuda99.8",
4+
"hostRequirements": {
5+
"gpu": "optional"
6+
},
7+
"initializeCommand": [
8+
"/bin/bash",
9+
"-c",
10+
"mkdir -m 0755 -p ${localWorkspaceFolder}/.{aws,cache,config}; mkdir -m 0755 -p ${localWorkspaceFolder}/build; if test -z ${localEnv:WSLENV}; then docker volume create --driver local --opt type=none --opt device=${localWorkspaceFolder}/build --opt o=bind cccl-build; else docker volume create cccl-build; fi;"
11+
],
12+
"containerEnv": {
13+
"SCCACHE_REGION": "us-east-2",
14+
"SCCACHE_BUCKET": "rapids-sccache-devs",
15+
"AWS_ROLE_ARN": "arn:aws:iam::279114543810:role/nv-gha-token-sccache-devs",
16+
"HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history",
17+
"DEVCONTAINER_NAME": "cuda99.8-gcc13",
18+
"CCCL_CUDA_VERSION": "99.8",
19+
"CCCL_HOST_COMPILER": "gcc",
20+
"CCCL_HOST_COMPILER_VERSION": "13",
21+
"CCCL_BUILD_INFIX": "cuda99.8-gcc13",
22+
"CCCL_CUDA_EXTENDED": "false"
23+
},
24+
"workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}",
25+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent",
26+
"mounts": [
27+
"source=${localWorkspaceFolder}/.aws,target=/home/coder/.aws,type=bind,consistency=consistent",
28+
"source=${localWorkspaceFolder}/.cache,target=/home/coder/.cache,type=bind,consistency=consistent",
29+
"source=${localWorkspaceFolder}/.config,target=/home/coder/.config,type=bind,consistency=consistent",
30+
"source=cccl-build,target=/home/coder/cccl/build"
31+
],
32+
"customizations": {
33+
"vscode": {
34+
"extensions": [
35+
"llvm-vs-code-extensions.vscode-clangd",
36+
"seaube.clangformat",
37+
"nvidia.nsight-vscode-edition",
38+
"ms-vscode.cmake-tools"
39+
],
40+
"settings": {
41+
"editor.defaultFormatter": "seaube.clangformat",
42+
"editor.formatOnSave": true,
43+
"clang-format.executable": "/usr/bin/clang-format",
44+
"clangd.arguments": [
45+
"--header-insertion=never",
46+
"--compile-commands-dir=${workspaceFolder}"
47+
],
48+
"files.eol": "\n",
49+
"files.trimTrailingWhitespace": true
50+
}
51+
}
52+
},
53+
"name": "cuda99.8-gcc13"
54+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"shutdownAction": "stopContainer",
3+
"image": "gitlab-master.nvidia.com:5005/cccl/cccl-devcontainers:cpp-llvm18-cuda99.8",
4+
"hostRequirements": {
5+
"gpu": "optional"
6+
},
7+
"initializeCommand": [
8+
"/bin/bash",
9+
"-c",
10+
"mkdir -m 0755 -p ${localWorkspaceFolder}/.{aws,cache,config}; mkdir -m 0755 -p ${localWorkspaceFolder}/build; if test -z ${localEnv:WSLENV}; then docker volume create --driver local --opt type=none --opt device=${localWorkspaceFolder}/build --opt o=bind cccl-build; else docker volume create cccl-build; fi;"
11+
],
12+
"containerEnv": {
13+
"SCCACHE_REGION": "us-east-2",
14+
"SCCACHE_BUCKET": "rapids-sccache-devs",
15+
"AWS_ROLE_ARN": "arn:aws:iam::279114543810:role/nv-gha-token-sccache-devs",
16+
"HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history",
17+
"DEVCONTAINER_NAME": "cuda99.8-llvm18",
18+
"CCCL_CUDA_VERSION": "99.8",
19+
"CCCL_HOST_COMPILER": "llvm",
20+
"CCCL_HOST_COMPILER_VERSION": "18",
21+
"CCCL_BUILD_INFIX": "cuda99.8-llvm18",
22+
"CCCL_CUDA_EXTENDED": "false"
23+
},
24+
"workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}",
25+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent",
26+
"mounts": [
27+
"source=${localWorkspaceFolder}/.aws,target=/home/coder/.aws,type=bind,consistency=consistent",
28+
"source=${localWorkspaceFolder}/.cache,target=/home/coder/.cache,type=bind,consistency=consistent",
29+
"source=${localWorkspaceFolder}/.config,target=/home/coder/.config,type=bind,consistency=consistent",
30+
"source=cccl-build,target=/home/coder/cccl/build"
31+
],
32+
"customizations": {
33+
"vscode": {
34+
"extensions": [
35+
"llvm-vs-code-extensions.vscode-clangd",
36+
"seaube.clangformat",
37+
"nvidia.nsight-vscode-edition",
38+
"ms-vscode.cmake-tools"
39+
],
40+
"settings": {
41+
"editor.defaultFormatter": "seaube.clangformat",
42+
"editor.formatOnSave": true,
43+
"clang-format.executable": "/usr/bin/clang-format",
44+
"clangd.arguments": [
45+
"--header-insertion=never",
46+
"--compile-commands-dir=${workspaceFolder}"
47+
],
48+
"files.eol": "\n",
49+
"files.trimTrailingWhitespace": true
50+
}
51+
}
52+
},
53+
"name": "cuda99.8-llvm18"
54+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"shutdownAction": "stopContainer",
3+
"image": "gitlab-master.nvidia.com:5005/cccl/cccl-devcontainers:cpp-gcc13-cuda99.9",
4+
"hostRequirements": {
5+
"gpu": "optional"
6+
},
7+
"initializeCommand": [
8+
"/bin/bash",
9+
"-c",
10+
"mkdir -m 0755 -p ${localWorkspaceFolder}/.{aws,cache,config}; mkdir -m 0755 -p ${localWorkspaceFolder}/build; if test -z ${localEnv:WSLENV}; then docker volume create --driver local --opt type=none --opt device=${localWorkspaceFolder}/build --opt o=bind cccl-build; else docker volume create cccl-build; fi;"
11+
],
12+
"containerEnv": {
13+
"SCCACHE_REGION": "us-east-2",
14+
"SCCACHE_BUCKET": "rapids-sccache-devs",
15+
"AWS_ROLE_ARN": "arn:aws:iam::279114543810:role/nv-gha-token-sccache-devs",
16+
"HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history",
17+
"DEVCONTAINER_NAME": "cuda99.9-gcc13",
18+
"CCCL_CUDA_VERSION": "99.9",
19+
"CCCL_HOST_COMPILER": "gcc",
20+
"CCCL_HOST_COMPILER_VERSION": "13",
21+
"CCCL_BUILD_INFIX": "cuda99.9-gcc13",
22+
"CCCL_CUDA_EXTENDED": "false"
23+
},
24+
"workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}",
25+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent",
26+
"mounts": [
27+
"source=${localWorkspaceFolder}/.aws,target=/home/coder/.aws,type=bind,consistency=consistent",
28+
"source=${localWorkspaceFolder}/.cache,target=/home/coder/.cache,type=bind,consistency=consistent",
29+
"source=${localWorkspaceFolder}/.config,target=/home/coder/.config,type=bind,consistency=consistent",
30+
"source=cccl-build,target=/home/coder/cccl/build"
31+
],
32+
"customizations": {
33+
"vscode": {
34+
"extensions": [
35+
"llvm-vs-code-extensions.vscode-clangd",
36+
"seaube.clangformat",
37+
"nvidia.nsight-vscode-edition",
38+
"ms-vscode.cmake-tools"
39+
],
40+
"settings": {
41+
"editor.defaultFormatter": "seaube.clangformat",
42+
"editor.formatOnSave": true,
43+
"clang-format.executable": "/usr/bin/clang-format",
44+
"clangd.arguments": [
45+
"--header-insertion=never",
46+
"--compile-commands-dir=${workspaceFolder}"
47+
],
48+
"files.eol": "\n",
49+
"files.trimTrailingWhitespace": true
50+
}
51+
}
52+
},
53+
"name": "cuda99.9-gcc13"
54+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"shutdownAction": "stopContainer",
3+
"image": "gitlab-master.nvidia.com:5005/cccl/cccl-devcontainers:cpp-llvm18-cuda99.9",
4+
"hostRequirements": {
5+
"gpu": "optional"
6+
},
7+
"initializeCommand": [
8+
"/bin/bash",
9+
"-c",
10+
"mkdir -m 0755 -p ${localWorkspaceFolder}/.{aws,cache,config}; mkdir -m 0755 -p ${localWorkspaceFolder}/build; if test -z ${localEnv:WSLENV}; then docker volume create --driver local --opt type=none --opt device=${localWorkspaceFolder}/build --opt o=bind cccl-build; else docker volume create cccl-build; fi;"
11+
],
12+
"containerEnv": {
13+
"SCCACHE_REGION": "us-east-2",
14+
"SCCACHE_BUCKET": "rapids-sccache-devs",
15+
"AWS_ROLE_ARN": "arn:aws:iam::279114543810:role/nv-gha-token-sccache-devs",
16+
"HISTFILE": "${containerWorkspaceFolder}/.cache/._bash_history",
17+
"DEVCONTAINER_NAME": "cuda99.9-llvm18",
18+
"CCCL_CUDA_VERSION": "99.9",
19+
"CCCL_HOST_COMPILER": "llvm",
20+
"CCCL_HOST_COMPILER_VERSION": "18",
21+
"CCCL_BUILD_INFIX": "cuda99.9-llvm18",
22+
"CCCL_CUDA_EXTENDED": "false"
23+
},
24+
"workspaceFolder": "/home/coder/${localWorkspaceFolderBasename}",
25+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent",
26+
"mounts": [
27+
"source=${localWorkspaceFolder}/.aws,target=/home/coder/.aws,type=bind,consistency=consistent",
28+
"source=${localWorkspaceFolder}/.cache,target=/home/coder/.cache,type=bind,consistency=consistent",
29+
"source=${localWorkspaceFolder}/.config,target=/home/coder/.config,type=bind,consistency=consistent",
30+
"source=cccl-build,target=/home/coder/cccl/build"
31+
],
32+
"customizations": {
33+
"vscode": {
34+
"extensions": [
35+
"llvm-vs-code-extensions.vscode-clangd",
36+
"seaube.clangformat",
37+
"nvidia.nsight-vscode-edition",
38+
"ms-vscode.cmake-tools"
39+
],
40+
"settings": {
41+
"editor.defaultFormatter": "seaube.clangformat",
42+
"editor.formatOnSave": true,
43+
"clang-format.executable": "/usr/bin/clang-format",
44+
"clangd.arguments": [
45+
"--header-insertion=never",
46+
"--compile-commands-dir=${workspaceFolder}"
47+
],
48+
"files.eol": "\n",
49+
"files.trimTrailingWhitespace": true
50+
}
51+
}
52+
},
53+
"name": "cuda99.9-llvm18"
54+
}

.devcontainer/make_devcontainers.sh

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ update_devcontainer() {
3030
local compiler_exe="$7"
3131
local compiler_version="$8"
3232
local devcontainer_version="$9"
33+
local internal="${10}"
3334

3435
local cuda_suffix=""
3536
if $cuda_ext; then
@@ -41,8 +42,16 @@ update_devcontainer() {
4142
if [ $compiler_name == "nvhpc" ]; then
4243
toolkit_name=""
4344
fi
45+
4446
local IMAGE_ROOT="rapidsai/devcontainers:${devcontainer_version}-cpp-"
45-
local image="${IMAGE_ROOT}${compiler_name}${compiler_version}${toolkit_name}"
47+
local INTERNAL_ROOT="gitlab-master.nvidia.com:5005/cccl/cccl-devcontainers:cpp-"
48+
49+
img=$IMAGE_ROOT
50+
if [ "$internal" == "true" ]; then
51+
img=$INTERNAL_ROOT
52+
fi;
53+
54+
local image="${img}${compiler_name}${compiler_version}${toolkit_name}"
4655

4756
jq --arg image "$image" \
4857
--arg name "$name" \
@@ -123,22 +132,24 @@ readonly combinations=$(echo "$matrix_json" | jq -c '.combinations[]')
123132
# other devcontainer.json files by replacing the `image:` field with the appropriate image name
124133
readonly base_devcontainer_file="./devcontainer.json"
125134
readonly NEWEST_GCC_CUDA_ENTRY=$(echo "$combinations" | jq -rs '[.[] | select(.compiler_name == "gcc")] | sort_by((.cuda | tonumber), (.compiler_version | tonumber)) | .[-1]')
135+
readonly NEWEST_LLVM_CUDA_ENTRY=$(echo "$combinations" | jq -rs '[.[] | select(.compiler_name == "llvm")] | sort_by((.cuda | tonumber), (.compiler_version | tonumber)) | .[-1]')
126136
readonly DEFAULT_CUDA=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.cuda')
127137
readonly DEFAULT_CUDA_EXT=false
128138
readonly DEFAULT_COMPILER_NAME=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.compiler_name')
129139
readonly DEFAULT_COMPILER_EXE=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.compiler_exe')
130140
readonly DEFAULT_COMPILER_VERSION=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -r '.compiler_version')
131141
readonly DEFAULT_NAME=$(make_name "$DEFAULT_CUDA" "$DEFAULT_CUDA_EXT" "$DEFAULT_COMPILER_NAME" "$DEFAULT_COMPILER_VERSION")
132142

133-
update_devcontainer ${base_devcontainer_file} "./temp_devcontainer.json" "$DEFAULT_NAME" "$DEFAULT_CUDA" "$DEFAULT_CUDA_EXT" "$DEFAULT_COMPILER_NAME" "$DEFAULT_COMPILER_EXE" "$DEFAULT_COMPILER_VERSION" "$DEVCONTAINER_VERSION"
143+
update_devcontainer ${base_devcontainer_file} "./temp_devcontainer.json" "$DEFAULT_NAME" "$DEFAULT_CUDA" "$DEFAULT_CUDA_EXT" "$DEFAULT_COMPILER_NAME" "$DEFAULT_COMPILER_EXE" "$DEFAULT_COMPILER_VERSION" "$DEVCONTAINER_VERSION" "false"
134144
mv "./temp_devcontainer.json" ${base_devcontainer_file}
135145

136146
# Always create an extended version of the default devcontainer:
137147
readonly EXT_NAME=$(make_name "$DEFAULT_CUDA" true "$DEFAULT_COMPILER_NAME" "$DEFAULT_COMPILER_VERSION")
138-
update_devcontainer ${base_devcontainer_file} "./temp_devcontainer.json" "$EXT_NAME" "$DEFAULT_CUDA" true "$DEFAULT_COMPILER_NAME" "$DEFAULT_COMPILER_EXE" "$DEFAULT_COMPILER_VERSION" "$DEVCONTAINER_VERSION"
148+
update_devcontainer ${base_devcontainer_file} "./temp_devcontainer.json" "$EXT_NAME" "$DEFAULT_CUDA" true "$DEFAULT_COMPILER_NAME" "$DEFAULT_COMPILER_EXE" "$DEFAULT_COMPILER_VERSION" "$DEVCONTAINER_VERSION" "false"
139149
mkdir -p "$EXT_NAME"
140150
mv "./temp_devcontainer.json" "$EXT_NAME/devcontainer.json"
141151

152+
142153
# Create an array to keep track of valid subdirectory names
143154
valid_subdirs=("$EXT_NAME")
144155

@@ -150,19 +161,27 @@ for rapids_container in *rapids*; do
150161
valid_subdirs+=("${rapids_container}")
151162
done
152163

164+
# Inject ctk version 99.9
165+
readonly cuda99_9_gcc=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -rsc '.[].cuda |= "99.9" | .[].internal |= true | .[-1]')
166+
readonly cuda99_8_gcc=$(echo "$NEWEST_GCC_CUDA_ENTRY" | jq -rsc '.[].cuda |= "99.8" | .[].internal |= true | .[-1]')
167+
readonly cuda99_9_llvm=$(echo "$NEWEST_LLVM_CUDA_ENTRY" | jq -rsc '.[].cuda |= "99.9" | .[].internal |= true | .[-1]')
168+
readonly cuda99_8_llvm=$(echo "$NEWEST_LLVM_CUDA_ENTRY" | jq -rsc '.[].cuda |= "99.8" | .[].internal |= true | .[-1]')
169+
170+
readonly all_comb="$combinations $cuda99_9_gcc $cuda99_8_gcc $cuda99_9_llvm $cuda99_8_llvm"
153171
# For each unique combination
154-
for combination in $combinations; do
172+
for combination in $all_comb; do
155173
cuda_version=$(echo "$combination" | jq -r '.cuda')
156174
cuda_ext=$(echo "$combination" | jq -r '.cuda_ext')
157175
compiler_name=$(echo "$combination" | jq -r '.compiler_name')
158176
compiler_exe=$(echo "$combination" | jq -r '.compiler_exe')
159177
compiler_version=$(echo "$combination" | jq -r '.compiler_version')
178+
internal=$(echo "$combination" | jq -r '.internal')
160179

161180
name=$(make_name "$cuda_version" "$cuda_ext" "$compiler_name" "$compiler_version")
162181
mkdir -p "$name"
163182
new_devcontainer_file="$name/devcontainer.json"
164183

165-
update_devcontainer "$base_devcontainer_file" "$new_devcontainer_file" "$name" "$cuda_version" "$cuda_ext" "$compiler_name" "$compiler_exe" "$compiler_version" "$DEVCONTAINER_VERSION"
184+
update_devcontainer "$base_devcontainer_file" "$new_devcontainer_file" "$name" "$cuda_version" "$cuda_ext" "$compiler_name" "$compiler_exe" "$compiler_version" "$DEVCONTAINER_VERSION" "$internal"
166185
echo "Created $new_devcontainer_file"
167186

168187
# Add the subdirectory name to the valid_subdirs array

.github/workflows/verify-devcontainers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
if: ${{ steps.inspect-changes.outputs.skip != 'true' }}
8989
id: get-list
9090
run: |
91-
devcontainers=$(find .devcontainer/ -name 'devcontainer.json' | while read -r devcontainer; do
91+
devcontainers=$(find .devcontainer/ -name 'devcontainer.json' | grep -wP '(?!.*cuda99)' | while read -r devcontainer; do
9292
jq --arg path "$devcontainer" '{path: $path, name: .name}' "$devcontainer"
9393
done | jq -s -c .)
9494
echo "devcontainers=${devcontainers}" | tee --append "${GITHUB_OUTPUT}"

0 commit comments

Comments
 (0)