Skip to content

Commit d7f4981

Browse files
authored
Merge branch 'main' into tflint_attestation
2 parents cc2ff1b + d79c223 commit d7f4981

File tree

10 files changed

+145
-81
lines changed

10 files changed

+145
-81
lines changed

.github/dependabot.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "devcontainers"
4+
directory: "/.devcontainer"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
Lines changed: 62 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,66 @@
11
{
2-
"id": "kubectl-helm-minikube",
3-
"version": "1.2.2",
4-
"name": "Kubectl, Helm, and Minikube",
5-
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/kubectl-helm-minikube",
6-
"description": "Installs latest version of kubectl, Helm, and optionally minikube. Auto-detects latest versions and installs needed dependencies.",
7-
"options": {
8-
"version": {
9-
"type": "string",
10-
"proposals": [
11-
"latest",
12-
"none",
13-
"1.23",
14-
"1.22",
15-
"1.21",
16-
"none"
17-
],
18-
"default": "latest",
19-
"description": "Select or enter a Kubernetes version to install"
20-
},
21-
"helm": {
22-
"type": "string",
23-
"proposals": [
24-
"latest",
25-
"none"
26-
],
27-
"default": "latest",
28-
"description": "Select or enter a Helm version to install"
29-
},
30-
"minikube": {
31-
"type": "string",
32-
"proposals": [
33-
"latest",
34-
"none"
35-
],
36-
"default": "latest",
37-
"description": "Select or enter a Minikube version to install"
38-
}
2+
"id": "kubectl-helm-minikube",
3+
"version": "1.3.1",
4+
"name": "Kubectl, Helm, and Minikube",
5+
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/kubectl-helm-minikube",
6+
"description": "Installs latest version of kubectl, Helm, and optionally minikube. Auto-detects latest versions and installs needed dependencies.",
7+
"options": {
8+
"version": {
9+
"type": "string",
10+
"proposals": [
11+
"latest",
12+
"none",
13+
"1.23",
14+
"1.22",
15+
"1.21",
16+
"none"
17+
],
18+
"default": "latest",
19+
"description": "Select or enter a Kubernetes version to install"
3920
},
40-
"mounts": [
41-
{
42-
"source": "minikube-config",
43-
"target": "/home/vscode/.minikube",
44-
"type": "volume"
45-
}
46-
],
47-
"customizations": {
48-
"vscode": {
49-
"settings": {
50-
"github.copilot.chat.codeGeneration.instructions": [
51-
{
52-
"text": "This dev container includes kubectl, Helm, optionally minikube, and needed dependencies pre-installed and available on the `PATH`. When configuring Ingress for your Kubernetes cluster, note that by default Kubernetes will bind to a specific interface's IP rather than localhost or all interfaces. This is why you need to use the Kubernetes Node's IP when connecting - even if there's only one Node as in the case of Minikube."
53-
}
54-
]
55-
}
56-
}
21+
"helm": {
22+
"type": "string",
23+
"proposals": [
24+
"latest",
25+
"none"
26+
],
27+
"default": "latest",
28+
"description": "Select or enter a Helm version to install"
5729
},
58-
"installsAfter": [
59-
"ghcr.io/devcontainers/features/common-utils"
60-
]
30+
"minikube": {
31+
"type": "string",
32+
"proposals": [
33+
"latest",
34+
"none"
35+
],
36+
"default": "latest",
37+
"description": "Select or enter a Minikube version to install"
38+
},
39+
"kubectlFallbackVersion": {
40+
"type": "string",
41+
"default": "v1.35.1",
42+
"description": "Fallback kubectl version to use when the latest stable version cannot be fetched"
43+
}
44+
},
45+
"mounts": [
46+
{
47+
"source": "minikube-config",
48+
"target": "/home/vscode/.minikube",
49+
"type": "volume"
50+
}
51+
],
52+
"customizations": {
53+
"vscode": {
54+
"settings": {
55+
"github.copilot.chat.codeGeneration.instructions": [
56+
{
57+
"text": "This dev container includes kubectl, Helm, optionally minikube, and needed dependencies pre-installed and available on the `PATH`. When configuring Ingress for your Kubernetes cluster, note that by default Kubernetes will bind to a specific interface's IP rather than localhost or all interfaces. This is why you need to use the Kubernetes Node's IP when connecting - even if there's only one Node as in the case of Minikube."
58+
}
59+
]
60+
}
61+
}
62+
},
63+
"installsAfter": [
64+
"ghcr.io/devcontainers/features/common-utils"
65+
]
6166
}

src/kubectl-helm-minikube/install.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ set -e
1212
# Clean up
1313
rm -rf /var/lib/apt/lists/*
1414

15+
# Fallback version when stable.txt cannot be fetched
16+
KUBECTL_FALLBACK_VERSION="${KUBECTLFALLBACKVERSION:-"v1.35.1"}"
17+
1518
KUBECTL_VERSION="${VERSION:-"latest"}"
1619
HELM_VERSION="${HELM:-"latest"}"
1720
MINIKUBE_VERSION="${MINIKUBE:-"latest"}" # latest is also valid
@@ -164,7 +167,15 @@ if [ ${KUBECTL_VERSION} != "none" ]; then
164167
# Install the kubectl, verify checksum
165168
echo "Downloading kubectl..."
166169
if [ "${KUBECTL_VERSION}" = "latest" ] || [ "${KUBECTL_VERSION}" = "lts" ] || [ "${KUBECTL_VERSION}" = "current" ] || [ "${KUBECTL_VERSION}" = "stable" ]; then
167-
KUBECTL_VERSION="$(curl -sSL https://dl.k8s.io/release/stable.txt)"
170+
KUBECTL_VERSION="$(curl -fsSL --connect-timeout 10 --max-time 30 https://dl.k8s.io/release/stable.txt 2>/dev/null | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' || echo "")"
171+
if [ -z "${KUBECTL_VERSION}" ]; then
172+
echo "(!) Failed to fetch kubectl stable version from dl.k8s.io, trying alternative URL..."
173+
KUBECTL_VERSION="$(curl -fsSL --connect-timeout 10 --max-time 30 https://storage.googleapis.com/kubernetes-release/release/stable.txt 2>/dev/null | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' || echo "")"
174+
fi
175+
if [ -z "${KUBECTL_VERSION}" ]; then
176+
echo "(!) Failed to fetch kubectl stable version from both URLs. Using fallback version ${KUBECTL_FALLBACK_VERSION}"
177+
KUBECTL_VERSION="${KUBECTL_FALLBACK_VERSION}"
178+
fi
168179
else
169180
find_version_from_git_tags KUBECTL_VERSION https://github.com/kubernetes/kubernetes
170181
fi

src/nvidia-cuda/devcontainer-feature.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "nvidia-cuda",
3-
"version": "2.0.0",
3+
"version": "3.0.0",
44
"name": "NVIDIA CUDA",
55
"description": "Installs shared libraries for NVIDIA CUDA.",
66
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/nvidia-cuda",
@@ -42,7 +42,7 @@
4242
"11.3",
4343
"11.2"
4444
],
45-
"default": "11.8",
45+
"default": "12.5",
4646
"description": "Version of CUDA to install"
4747
},
4848
"cudnnVersion": {

src/nvidia-cuda/install.sh

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,26 @@ esac
6262
# Add NVIDIA's package repository to apt so that we can download packages
6363
# Updating the repo to ubuntu2204 as ubuntu 20.04 is going out of support.
6464
NVIDIA_REPO_URL="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/$NVIDIA_ARCH"
65-
KEYRING_PACKAGE="cuda-keyring_1.0-1_all.deb"
66-
KEYRING_PACKAGE_URL="$NVIDIA_REPO_URL/$KEYRING_PACKAGE"
67-
KEYRING_PACKAGE_PATH="$(mktemp -d)"
68-
KEYRING_PACKAGE_FILE="$KEYRING_PACKAGE_PATH/$KEYRING_PACKAGE"
69-
wget -O "$KEYRING_PACKAGE_FILE" "$KEYRING_PACKAGE_URL"
70-
apt-get install -yq "$KEYRING_PACKAGE_FILE"
71-
apt-get update -yq
65+
66+
67+
if [ "${ID}" = "debian" ] && [ "${VERSION_CODENAME}" = "trixie" ]; then
68+
echo "(!) Temporary workaround on debian:trixie: bypassing NVIDIA repo signature checks"
69+
cat > /etc/apt/sources.list.d/cuda.list <<EOF
70+
deb [trusted=yes] ${NVIDIA_REPO_URL}/ /
71+
EOF
72+
73+
apt-get -o Acquire::AllowInsecureRepositories=true \
74+
-o Acquire::AllowDowngradeToInsecureRepositories=true \
75+
update -yq
76+
else
77+
KEYRING_PACKAGE="cuda-keyring_1.0-1_all.deb"
78+
KEYRING_PACKAGE_URL="$NVIDIA_REPO_URL/$KEYRING_PACKAGE"
79+
KEYRING_PACKAGE_PATH="$(mktemp -d)"
80+
KEYRING_PACKAGE_FILE="$KEYRING_PACKAGE_PATH/$KEYRING_PACKAGE"
81+
wget -O "$KEYRING_PACKAGE_FILE" "$KEYRING_PACKAGE_URL"
82+
apt-get install -yq "$KEYRING_PACKAGE_FILE"
83+
apt-get update -yq
84+
fi
7285

7386
# Ensure that the requested version of CUDA is available
7487
cuda_pkg="cuda-libraries-${CUDA_VERSION/./-}"

test/nvidia-cuda/install_all_options.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ set -e
55
# Optional: Import test library
66
source dev-container-features-test-lib
77

8-
# Check installation of libcudnn8
9-
check "libcudnn.so.8" test 1 -eq "$(find /usr -name 'libcudnn.so.8' | wc -l)"
8+
# Check installation of libcudnn9
9+
check "libcudnn.so.9" test 1 -eq "$(find /usr -name 'libcudnn.so.9' | wc -l)"
1010

11-
# Check installation of libcudnn8-dev
11+
# Check installation of libcudnn9-dev
1212
check "cudnn.h" test 1 -eq "$(find /usr -name 'cudnn.h' | wc -l)"
1313

14-
# Check installation of cuda-nvtx-11-<version>
15-
check "cuda-11+nvtx" test -e '/usr/local/cuda-11/targets/x86_64-linux/include/nvtx3'
14+
# Check installation of cuda-nvtx-12-<version>
15+
check "cuda-12+nvtx" test -e '/usr/local/cuda-12.5/targets/x86_64-linux/include/nvtx3'
1616

17-
# Check installation of cuda-nvcc-11-<version>
18-
check "cuda-11+nvcc" test -e '/usr/local/cuda-11/bin/nvcc'
17+
# Check installation of cuda-nvcc-12-<version>
18+
check "cuda-12+nvcc" test -e '/usr/local/cuda-12.5/bin/nvcc'
1919

2020
# Report result
2121
reportResults
22+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
install_all_options.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
install_all_options.sh

test/nvidia-cuda/scenarios.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,28 @@
1010
}
1111
}
1212
},
13+
"install_all_options_debian_12": {
14+
"image": "debian:12",
15+
"features": {
16+
"nvidia-cuda": {
17+
"installCudnn": true,
18+
"installCudnnDev": true,
19+
"installNvtx": true,
20+
"installToolkit": true
21+
}
22+
}
23+
},
24+
"install_all_options_ubuntu_noble": {
25+
"image": "ubuntu:noble",
26+
"features": {
27+
"nvidia-cuda": {
28+
"installCudnn": true,
29+
"installCudnnDev": true,
30+
"installNvtx": true,
31+
"installToolkit": true
32+
}
33+
}
34+
},
1335
"install_cudnn_nvxt_version": {
1436
"image": "debian",
1537
"features": {

test/nvidia-cuda/test.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ set -e
55
# Optional: Import test library
66
source dev-container-features-test-lib
77

8-
check "cuda version" test -d /usr/local/cuda-11.8
8+
check "cuda version" test -d /usr/local/cuda-12.5
99

10-
# Check installation of cuda-libraries-11-<version>
11-
check "libcudart.so.11.0" test 1 -eq "$(find /usr -name 'libcudart.so.11.0' | wc -l)"
12-
check "libcublas.so.11" test 1 -eq "$(find /usr -name 'libcublas.so.11' | wc -l)"
13-
check "libcublasLt.so.11" test 1 -eq "$(find /usr -name 'libcublasLt.so.11' | wc -l)"
14-
check "libcufft.so.10" test 1 -eq "$(find /usr -name 'libcufft.so.10' | wc -l)"
10+
# Check installation of cuda-libraries-12-<version>
11+
check "libcudart.so.12" test 1 -eq "$(find /usr -name 'libcudart.so.12' | wc -l)"
12+
check "libcublas.so.12" test 1 -eq "$(find /usr -name 'libcublas.so.12' | wc -l)"
13+
check "libcublasLt.so.12" test 1 -eq "$(find /usr -name 'libcublasLt.so.12' | wc -l)"
14+
check "libcufft.so.11" test 1 -eq "$(find /usr -name 'libcufft.so.11' | wc -l)"
1515
check "libcurand.so.10" test 1 -eq "$(find /usr -name 'libcurand.so.10' | wc -l)"
1616
check "libcusolver.so.11" test 1 -eq "$(find /usr -name 'libcusolver.so.11' | wc -l)"
17-
check "libcusparse.so.11" test 1 -eq "$(find /usr -name 'libcusparse.so.11' | wc -l)"
17+
check "libcusparse.so.12" test 1 -eq "$(find /usr -name 'libcusparse.so.12' | wc -l)"
1818

1919
# Report result
2020
reportResults

0 commit comments

Comments
 (0)