From 89dfb6e6740b903bd3b21ee494a412b1bcd681b6 Mon Sep 17 00:00:00 2001 From: Hannes Probst Date: Thu, 21 Nov 2024 15:59:04 +0100 Subject: [PATCH 1/4] Include libffi-dev in conda image --- python/conda/Dockerfile.conda | 1 + 1 file changed, 1 insertion(+) diff --git a/python/conda/Dockerfile.conda b/python/conda/Dockerfile.conda index bc9109a..a35e7b0 100644 --- a/python/conda/Dockerfile.conda +++ b/python/conda/Dockerfile.conda @@ -5,6 +5,7 @@ FROM deepnote/python:${PYTHON_VERSION}${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_R RUN apt-get update && \ apt-get install -y --no-install-recommends \ tini \ + libffi-dev \ libglib2.0-0 libxext6 libsm6 libxrender1 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* From b48acb8a7d445c842cc9954d60c3801cea30d05c Mon Sep 17 00:00:00 2001 From: Hannes Probst Date: Thu, 21 Nov 2024 16:27:23 +0100 Subject: [PATCH 2/4] Don't instal python again for conda --- python/conda/Dockerfile.conda | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/python/conda/Dockerfile.conda b/python/conda/Dockerfile.conda index a35e7b0..2e758d9 100644 --- a/python/conda/Dockerfile.conda +++ b/python/conda/Dockerfile.conda @@ -21,15 +21,10 @@ ARG PYTHON_VERSION RUN MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"; \ wget --quiet $MINICONDA_URL -O /tmp/miniconda.sh && \ /bin/bash /tmp/miniconda.sh -b -p /opt/conda && \ - rm /tmp/miniconda.sh && \ - # Install the correct version of python (as the time of - # writing, anaconda installed python 3.9 by default) - /opt/conda/bin/conda install python=${PYTHON_VERSION} && \ - /opt/conda/bin/conda clean --all + rm /tmp/miniconda.sh ENV PATH=/opt/conda/bin:$PATH -ENV PIP_TARGET=/opt/conda/lib/python${PYTHON_VERSION}/site-packages # Remove the system wide .profile file, because it overwrites the $PATH variable # and therefore the /opt/conda/bin directory is not in the $PATH. From b0697fdab2a5991d3912f05204ff3e311d07738f Mon Sep 17 00:00:00 2001 From: Hannes Probst Date: Thu, 21 Nov 2024 16:50:11 +0100 Subject: [PATCH 3/4] Base conda image on base --- .circleci/config.yml | 2 +- python/conda/Dockerfile.conda | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 771c12b..911bdde 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -241,7 +241,7 @@ workflows: parameters: python-version: *python-versions requires: - - Python << matrix.python-version >> + - Building the base image - build-and-push-gpu: name: Tensorflow 2.9 diff --git a/python/conda/Dockerfile.conda b/python/conda/Dockerfile.conda index 2e758d9..5295281 100644 --- a/python/conda/Dockerfile.conda +++ b/python/conda/Dockerfile.conda @@ -1,11 +1,10 @@ ARG PYTHON_VERSION=3.8 ARG CIRCLE_PULL_REQUEST -FROM deepnote/python:${PYTHON_VERSION}${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}} +FROM deepnote/base RUN apt-get update && \ apt-get install -y --no-install-recommends \ tini \ - libffi-dev \ libglib2.0-0 libxext6 libsm6 libxrender1 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* @@ -21,10 +20,15 @@ ARG PYTHON_VERSION RUN MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"; \ wget --quiet $MINICONDA_URL -O /tmp/miniconda.sh && \ /bin/bash /tmp/miniconda.sh -b -p /opt/conda && \ - rm /tmp/miniconda.sh + rm /tmp/miniconda.sh && \ + # Install the correct version of python (as the time of + # writing, anaconda installed python 3.9 by default) + /opt/conda/bin/conda install python=${PYTHON_VERSION} && \ + /opt/conda/bin/conda clean --all ENV PATH=/opt/conda/bin:$PATH +ENV PIP_TARGET=/opt/conda/lib/python${PYTHON_VERSION}/site-packages # Remove the system wide .profile file, because it overwrites the $PATH variable # and therefore the /opt/conda/bin directory is not in the $PATH. From f555db1ed70cc03cccee769265796c3e6b78eb70 Mon Sep 17 00:00:00 2001 From: Hannes Probst Date: Thu, 21 Nov 2024 16:54:53 +0100 Subject: [PATCH 4/4] Fix base image URI --- python/conda/Dockerfile.conda | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/conda/Dockerfile.conda b/python/conda/Dockerfile.conda index 5295281..1f0a341 100644 --- a/python/conda/Dockerfile.conda +++ b/python/conda/Dockerfile.conda @@ -1,6 +1,6 @@ ARG PYTHON_VERSION=3.8 ARG CIRCLE_PULL_REQUEST -FROM deepnote/base +FROM deepnote/python:base RUN apt-get update && \ apt-get install -y --no-install-recommends \