Skip to content

Commit 5482a2f

Browse files
authored
Merge branch 'main' into fix/code_spell_1139
2 parents ed8d0ef + 87bc907 commit 5482a2f

8 files changed

Lines changed: 32 additions & 16 deletions

File tree

.github/workflows/test-all.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jobs:
4343
]
4444
baseImage:
4545
[
46-
"ubuntu:focal",
4746
"ubuntu:jammy",
4847
"debian:11",
4948
"debian:12",

.github/workflows/test-manual.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
baseImage:
1010
description: "Base image"
1111
required: true
12-
default: "ubuntu:focal"
12+
default: "ubuntu:noble"
1313
logLevel:
1414
description: "Log Level (info/debug/trace)"
1515
required: true

.github/workflows/test-pr.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jobs:
5050
features: ${{ fromJSON(needs.detect-changes.outputs.features) }}
5151
baseImage:
5252
[
53-
"ubuntu:focal",
5453
"ubuntu:jammy",
5554
"debian:11",
5655
"debian:12",

src/conda/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "conda",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"name": "Conda",
55
"description": "A cross-platform, language-agnostic binary package manager",
66
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/conda",

src/conda/install.sh

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,23 @@ accept_anaconda_tos_if_needed() {
8686

8787
for channel in "https://repo.anaconda.com/pkgs/main" "https://repo.anaconda.com/pkgs/r"; do
8888
echo "Accepting Conda Terms of Service for ${channel}..."
89+
# Accept as root (for install-time commands)
8990
"${CONDA_DIR}/bin/conda" tos accept --override-channels --channel "${channel}"
91+
# Accept as the target user (for runtime usage)
92+
sudo_if "${CONDA_DIR}/bin/conda" tos accept --override-channels --channel "${channel}"
9093
done
9194
}
9295

96+
clean_conda_cache() {
97+
"${CONDA_DIR}/bin/conda" clean --all --yes
98+
find "${CONDA_DIR}" -type f -name '*.pyc' -delete
99+
find "${CONDA_DIR}" -type d -name '__pycache__' -exec rm -rf {} +
100+
rm -rf "${CONDA_DIR}/pkgs/cache" /root/.cache/pip
101+
if [ "${USERNAME}" != "root" ]; then
102+
rm -rf "/home/${USERNAME}/.cache/pip"
103+
fi
104+
}
105+
93106
# Install Conda if it's missing
94107
if ! conda --version &> /dev/null ; then
95108
if ! cat /etc/group | grep -e "^conda:" > /dev/null 2>&1; then
@@ -145,16 +158,7 @@ if ! conda --version &> /dev/null ; then
145158

146159
find "${CONDA_DIR}" -type d -print0 | xargs -n 1 -0 chmod g+s
147160

148-
# Temporary fixes
149-
# Due to https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23491
150-
install_user_package certifi
151-
# Due to https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-0286 and https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-23931
152-
install_user_package cryptography
153-
# Due to https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40897
154-
install_user_package setuptools
155-
156-
install_user_package pluggy
157-
161+
clean_conda_cache
158162
fi
159163

160164
# Display a notice on conda when not running in GitHub Codespaces
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
conda_channel_creation.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
install_conda_package_after_upgrade.sh

test/conda/scenarios.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"install_conda": {
3-
"image": "ubuntu:noble",
3+
"image": "mcr.microsoft.com/devcontainers/base:noble",
44
"features": {
55
"conda": {
66
"version": "latest",
@@ -9,12 +9,24 @@
99
}
1010
},
1111
"install_conda_package_after_upgrade": {
12-
"image": "ubuntu:noble",
12+
"image": "mcr.microsoft.com/devcontainers/base:noble",
1313
"features": {
1414
"conda": {}
1515
}
1616
},
1717
"conda_channel_creation": {
18+
"image": "mcr.microsoft.com/devcontainers/base:noble",
19+
"features": {
20+
"conda": {}
21+
}
22+
},
23+
"install_conda_package_after_upgrade_with_root": {
24+
"image": "ubuntu:noble",
25+
"features": {
26+
"conda": {}
27+
}
28+
},
29+
"conda_channel_creation_with_root": {
1830
"image": "ubuntu:noble",
1931
"features": {
2032
"conda": {}

0 commit comments

Comments
 (0)