Skip to content

Commit 86bbf76

Browse files
Anaconda & Minconda: Fix conda update bug due to pyOpenssl (devcontainers#489)
* Anaconda & Minconda: Fix conda update bug due to pyOpenssl * update test * fix test * add tests * add --yes * fix user permission * add check * update test - works locally
1 parent d957a52 commit 86bbf76

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

src/anaconda/.devcontainer/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ RUN python3 -m pip install \
7373
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40898
7474
wheel \
7575
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32862
76-
nbconvert
76+
nbconvert \
77+
# https://github.com/devcontainers/images/issues/486
78+
pyOpenssl
7779

7880
# Copy environment.yml (if found) to a temp location so we can update the environment. Also
7981
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.

src/anaconda/manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"future",
3535
"wheel",
3636
"nbconvert",
37-
"py"
37+
"py",
38+
"pyOpenssl"
3839
],
3940
"other": {
4041
"git": {},

src/anaconda/test-project/test.sh

100644100755
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,9 @@ check-version-ge "wheel-requirement" "${wheel_version}" "0.38.1"
5656
nbconvert_version=$(python -c "import nbconvert; print(nbconvert.__version__)")
5757
check-version-ge "nbconvert-requirement" "${nbconvert_version}" "6.5.1"
5858

59+
check "conda-update-conda" bash -c "conda update -y conda"
60+
check "conda-install" bash -c "conda install -c conda-forge --yes tensorflow"
61+
check "conda-install" bash -c "conda install -c conda-forge --yes pytorch"
62+
5963
# Report result
6064
reportResults

src/miniconda/.devcontainer/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,18 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
4141
&& usermod -aG conda ${USERNAME} \
4242
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/add-notice.sh
4343

44-
# Temporary: Upgrade 'cryptography' due to https://github.com/advisories/GHSA-39hc-v87j-747x
45-
# 'cryptography' is installed by the base image (continuumio/miniconda3) which does not have the patch.
46-
RUN python3 -m pip install --upgrade cryptography
47-
4844
# Copy environment.yml (if found) to a temp locaition so we update the environment. Also
4945
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
5046
COPY environment.yml* noop.txt /tmp/conda-tmp/
5147
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
5248
&& rm -rf /tmp/conda-tmp
5349

50+
USER vscode
51+
52+
# Temporary: Upgrade 'cryptography' due to https://github.com/advisories/GHSA-39hc-v87j-747x
53+
# 'cryptography' is installed by the base image (continuumio/miniconda3) which does not have the patch.
54+
RUN python3 -m conda update -y cryptography
55+
5456
# [Optional] Uncomment this section to install additional OS packages.
5557
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5658
# && apt-get -y install --no-install-recommends <your-package-list-here>

src/miniconda/manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
],
3939
"pip": [
4040
"certifi",
41-
"cryptography"
41+
"cryptography",
42+
"pyOpenssl"
4243
],
4344
"other": {
4445
"git": {},

src/miniconda/test-project/test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ check "usr-local-etc-config-does-not-exist" test ! -f "/usr/local/etc/gitconfig"
2121
cryptography_version=$(python -c "import cryptography; print(cryptography.__version__)")
2222
check-version-ge "cryptography-requirement" "${cryptography_version}" "38.0.3"
2323

24+
check "conda-update-conda" bash -c "conda update -y conda"
25+
2426
# Report result
2527
reportResults

0 commit comments

Comments
 (0)