Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/conda/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "conda",
"version": "2.0.0",
Comment thread
abdurriq marked this conversation as resolved.
"version": "2.0.1",
"name": "Conda",
"description": "A cross-platform, language-agnostic binary package manager",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/conda",
Expand Down
23 changes: 18 additions & 5 deletions src/conda/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,23 @@ accept_anaconda_tos_if_needed() {

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

clean_conda_cache() {
"${CONDA_DIR}/bin/conda" clean --all --yes
find "${CONDA_DIR}" -type f -name '*.pyc' -delete
find "${CONDA_DIR}" -type d -name '__pycache__' -exec rm -rf {} +
rm -rf "${CONDA_DIR}/pkgs/cache" /root/.cache/pip
if [ "${USERNAME}" != "root" ]; then
rm -rf "/home/${USERNAME}/.cache/pip"
fi
}

# Install Conda if it's missing
if ! conda --version &> /dev/null ; then
if ! cat /etc/group | grep -e "^conda:" > /dev/null 2>&1; then
Expand Down Expand Up @@ -147,14 +160,14 @@ if ! conda --version &> /dev/null ; then

# Temporary fixes
# Due to https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23491
install_user_package certifi
#install_user_package certifi
Comment thread
abdurriq marked this conversation as resolved.
Outdated
# 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
install_user_package cryptography
#install_user_package cryptography
# Due to https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40897
install_user_package setuptools

install_user_package pluggy
#install_user_package setuptools

#install_user_package pluggy
clean_conda_cache
fi

# Display a notice on conda when not running in GitHub Codespaces
Expand Down
1 change: 1 addition & 0 deletions test/conda/conda_channel_creation_with_root.sh
16 changes: 14 additions & 2 deletions test/conda/scenarios.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"install_conda": {
"image": "ubuntu:noble",
"image": "mcr.microsoft.com/devcontainers/base:noble",
"features": {
"conda": {
"version": "latest",
Expand All @@ -9,12 +9,24 @@
}
},
"install_conda_package_after_upgrade": {
"image": "ubuntu:noble",
"image": "mcr.microsoft.com/devcontainers/base:noble",
"features": {
"conda": {}
}
},
"conda_channel_creation": {
"image": "mcr.microsoft.com/devcontainers/base:noble",
"features": {
"conda": {}
}
},
"install_conda_package_after_upgrade_with_root": {
"image": "ubuntu:noble",
"features": {
"conda": {}
}
},
"conda_channel_creation_with_root": {
"image": "ubuntu:noble",
"features": {
"conda": {}
Expand Down
Loading