Skip to content

Commit 2717d6f

Browse files
authored
Merge branch 'main' into tflint_attestation
2 parents c9903aa + b35b810 commit 2717d6f

27 files changed

Lines changed: 737 additions & 237 deletions
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "PR - Test Updated Features (arm64)"
2+
on:
3+
pull_request:
4+
# NOTE: To extend this workflow to other features, add path entries below
5+
# following the same pattern, e.g.:
6+
# - "src/<feature-name>/**"
7+
# - "test/<feature-name>/**"
8+
paths:
9+
- "src/powershell/**"
10+
- "test/powershell/**"
11+
12+
jobs:
13+
detect-changes:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
features: ${{ steps.filter.outputs.changes }}
17+
steps:
18+
- uses: dorny/paths-filter@v3
19+
id: filter
20+
with:
21+
# NOTE: To extend this workflow to other features, add filter entries below
22+
# following the same pattern, e.g.:
23+
# <feature-name>: ./**/<feature-name>/**
24+
filters: |
25+
powershell: ./**/powershell/**
26+
27+
test:
28+
needs: [detect-changes]
29+
runs-on: ubuntu-24.04-arm
30+
continue-on-error: true
31+
strategy:
32+
matrix:
33+
features: ${{ fromJSON(needs.detect-changes.outputs.features) }}
34+
baseImage:
35+
[
36+
"ubuntu:focal",
37+
"ubuntu:jammy",
38+
"debian:11",
39+
"debian:12",
40+
"mcr.microsoft.com/devcontainers/base:ubuntu",
41+
"mcr.microsoft.com/devcontainers/base:debian",
42+
"mcr.microsoft.com/devcontainers/base:noble"
43+
]
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: "Install latest devcontainer CLI"
48+
run: npm install -g @devcontainers/cli
49+
50+
- name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
51+
run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .
52+
53+
test-scenarios:
54+
needs: [detect-changes]
55+
runs-on: ubuntu-24.04-arm
56+
continue-on-error: true
57+
strategy:
58+
matrix:
59+
features: ${{ fromJSON(needs.detect-changes.outputs.features) }}
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: "Install latest devcontainer CLI"
64+
run: npm install -g @devcontainers/cli
65+
66+
- name: "Testing '${{ matrix.features }}' scenarios"
67+
run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated .
Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
{
2-
"id": "conda",
3-
"version": "1.0.10",
4-
"name": "Conda",
5-
"description": "A cross-platform, language-agnostic binary package manager",
6-
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/conda",
7-
"options": {
8-
"version": {
9-
"type": "string",
10-
"proposals": [
11-
"latest",
12-
"4.11.0",
13-
"4.12.0"
14-
],
15-
"default": "latest",
16-
"description": "Select or enter a conda version."
17-
},
18-
"addCondaForge": {
19-
"type": "boolean",
20-
"default": false,
21-
"description": "Add conda-forge channel to the config?"
22-
}
2+
"id": "conda",
3+
"version": "1.2.5",
4+
"name": "Conda",
5+
"description": "A cross-platform, language-agnostic binary package manager",
6+
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/conda",
7+
"options": {
8+
"version": {
9+
"type": "string",
10+
"proposals": [
11+
"latest",
12+
"4.11.0",
13+
"4.12.0"
14+
],
15+
"default": "latest",
16+
"description": "Select or enter a conda version."
2317
},
24-
"containerEnv": {
25-
"CONDA_DIR": "/opt/conda",
26-
"CONDA_SCRIPT":"/opt/conda/etc/profile.d/conda.sh",
27-
"PATH": "/opt/conda/bin:${PATH}"
28-
},
29-
"customizations": {
30-
"vscode": {
31-
"settings": {
32-
"github.copilot.chat.codeGeneration.instructions": [
33-
{
34-
"text": "This dev container includes the conda package manager pre-installed and available on the `PATH` for data science and Python development. Additional packages installed using Conda will be downloaded from Anaconda or another repository configured by the user. A user can install different versions of Python than the one in this dev container by running a command like: conda install python=3.7"
35-
}
36-
]
37-
}
38-
}
39-
},
40-
"installsAfter": [
41-
"ghcr.io/devcontainers/features/common-utils"
42-
]
18+
"addCondaForge": {
19+
"type": "boolean",
20+
"default": false,
21+
"description": "Add conda-forge channel to the config?"
22+
}
23+
},
24+
"containerEnv": {
25+
"CONDA_DIR": "/opt/conda",
26+
"CONDA_SCRIPT": "/opt/conda/etc/profile.d/conda.sh",
27+
"PATH": "/opt/conda/bin:${PATH}"
28+
},
29+
"customizations": {
30+
"vscode": {
31+
"settings": {
32+
"github.copilot.chat.codeGeneration.instructions": [
33+
{
34+
"text": "This dev container includes the conda package manager pre-installed and available on the `PATH` for data science and Python development. Additional packages installed using Conda will be downloaded from Anaconda or another repository configured by the user. A user can install different versions of Python than the one in this dev container by running a command like: conda install python=3.7"
35+
}
36+
]
37+
}
38+
}
39+
},
40+
"installsAfter": [
41+
"ghcr.io/devcontainers/features/common-utils"
42+
]
4343
}

src/conda/install.sh

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,78 @@ if ! conda --version &> /dev/null ; then
8383
usermod -a -G conda "${USERNAME}"
8484

8585
# Install dependencies
86-
check_packages curl ca-certificates gnupg2
86+
check_packages curl ca-certificates
8787

8888
echo "Installing Conda..."
8989

90-
curl -sS https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > /usr/share/keyrings/conda-archive-keyring.gpg
91-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list
92-
apt-get update -y
93-
94-
CONDA_PKG="conda=${VERSION}-0"
90+
# Download .deb package directly from repository (bypassing SHA1 signature issue)
91+
TEMP_DEB="$(mktemp -t conda_XXXXXX.deb)"
92+
CONDA_REPO_BASE="https://repo.anaconda.com/pkgs/misc/debrepo/conda"
93+
94+
# Determine package filename based on requested version
95+
ARCH="$(dpkg --print-architecture 2>/dev/null || echo "amd64")"
96+
PACKAGES_URL="https://repo.anaconda.com/pkgs/misc/debrepo/conda/dists/stable/main/binary-${ARCH}/Packages"
97+
9598
if [ "${VERSION}" = "latest" ]; then
96-
CONDA_PKG="conda"
99+
# For latest, we need to query the repository to find the current version
100+
echo "Fetching package list to determine latest version..."
101+
CONDA_PKG_INFO=$(curl -fsSL "${PACKAGES_URL}" | grep -A 30 "^Package: conda$" | head -n 31)
102+
CONDA_VERSION=$(echo "${CONDA_PKG_INFO}" | grep "^Version:" | head -n 1 | awk '{print $2}')
103+
CONDA_FILENAME=$(echo "${CONDA_PKG_INFO}" | grep "^Filename:" | head -n 1 | awk '{print $2}')
104+
105+
if [ -z "${CONDA_VERSION}" ] || [ -z "${CONDA_FILENAME}" ]; then
106+
echo "ERROR: Could not determine latest conda version or filename from ${PACKAGES_URL}"
107+
echo "This may indicate an unsupported architecture or repository unavailability."
108+
rm -f "${TEMP_DEB}"
109+
exit 1
110+
fi
111+
112+
CONDA_PKG_NAME="${CONDA_FILENAME}"
113+
else
114+
# For specific versions, query the Packages file to find the exact filename
115+
echo "Fetching package list to find version ${VERSION}..."
116+
# Search for version pattern - user may specify 4.12.0 but package has 4.12.0-0
117+
CONDA_PKG_INFO=$(curl -fsSL "${PACKAGES_URL}" | grep -A 30 "^Package: conda$" | grep -B 5 -A 25 "^Version: ${VERSION}")
118+
CONDA_FILENAME=$(echo "${CONDA_PKG_INFO}" | grep "^Filename:" | head -n 1 | awk '{print $2}')
119+
120+
if [ -z "${CONDA_FILENAME}" ]; then
121+
echo "ERROR: Could not find conda version ${VERSION} in ${PACKAGES_URL}"
122+
echo "Please verify the version specified is valid."
123+
rm -f "${TEMP_DEB}"
124+
exit 1
125+
fi
126+
127+
CONDA_PKG_NAME="${CONDA_FILENAME}"
97128
fi
98-
99-
check_packages $CONDA_PKG
129+
130+
# Download the .deb package
131+
CONDA_DEB_URL="${CONDA_REPO_BASE}/${CONDA_PKG_NAME}"
132+
echo "Downloading conda package from ${CONDA_DEB_URL}..."
133+
134+
if ! curl -fsSL "${CONDA_DEB_URL}" -o "${TEMP_DEB}"; then
135+
echo "ERROR: Failed to download conda .deb package from ${CONDA_DEB_URL}"
136+
echo "Please verify the version specified is valid."
137+
rm -f "${TEMP_DEB}"
138+
exit 1
139+
fi
140+
141+
# Verify the package was downloaded successfully
142+
if [ ! -f "${TEMP_DEB}" ] || [ ! -s "${TEMP_DEB}" ]; then
143+
echo "ERROR: Conda .deb package file is missing or empty"
144+
rm -f "${TEMP_DEB}"
145+
exit 1
146+
fi
147+
148+
# Install the package using apt (which handles dependencies automatically)
149+
echo "Installing conda package..."
150+
if ! apt-get install -y "${TEMP_DEB}"; then
151+
echo "ERROR: Failed to install conda package"
152+
rm -f "${TEMP_DEB}"
153+
exit 1
154+
fi
155+
156+
# Clean up downloaded package
157+
rm -f "${TEMP_DEB}"
100158

101159
CONDA_SCRIPT="/opt/conda/etc/profile.d/conda.sh"
102160
. $CONDA_SCRIPT

0 commit comments

Comments
 (0)