From 12bee013119d5a67e90fe8471c3562f8ed7305c7 Mon Sep 17 00:00:00 2001 From: Michal Baumgartner Date: Mon, 7 Jul 2025 21:28:59 +0200 Subject: [PATCH 1/6] Build multi-arch images --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index c0b8401..52d5ae3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,6 +50,7 @@ jobs: --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ --progress plain \ --platform linux/amd64 \ + --platform linux/arm64 \ --provenance=false \ --sbom=false \ --output type=registry,push=true \ @@ -84,6 +85,7 @@ jobs: --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ --progress plain \ --platform linux/amd64 \ + --platform linux/arm64 \ --provenance=false \ --sbom=false \ --output type=registry,push=true \ @@ -118,6 +120,7 @@ jobs: --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ --progress plain \ --platform linux/amd64 \ + --platform linux/arm64 \ --provenance=false \ --sbom=false \ --output type=registry,push=true \ @@ -152,6 +155,7 @@ jobs: --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ --progress plain \ --platform linux/amd64 \ + --platform linux/arm64 \ --provenance=false \ --sbom=false \ --output type=registry,push=true \ From 0401d49c00c0ee9c9ef2ceab1dea4f0f07bb2ca7 Mon Sep 17 00:00:00 2001 From: Michal Baumgartner Date: Mon, 7 Jul 2025 21:39:50 +0200 Subject: [PATCH 2/6] Skip conda images --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 52d5ae3..5b89b29 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -155,7 +155,6 @@ jobs: --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ --progress plain \ --platform linux/amd64 \ - --platform linux/arm64 \ --provenance=false \ --sbom=false \ --output type=registry,push=true \ From 1fcbd677ec685d6129410a16e1336abaea673fe7 Mon Sep 17 00:00:00 2001 From: Michal Baumgartner Date: Tue, 8 Jul 2025 08:59:40 +0200 Subject: [PATCH 3/6] Remove caching from multi-arch images --- .circleci/config.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b89b29..9ede898 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,9 +45,6 @@ jobs: --file=./python/base/Dockerfile.base \ --tag=978928340082.dkr.ecr.us-east-1.amazonaws.com/${REPOSITORY}:${TAG}${TAG_SUFFIX} \ --tag=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX} \ - --cache-from type=registry,ref=docker.io/${REPOSITORY}:${TAG}-buildcache \ - --cache-from type=registry,ref=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX}-buildcache \ - --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ --progress plain \ --platform linux/amd64 \ --platform linux/arm64 \ @@ -80,9 +77,6 @@ jobs: --tag=978928340082.dkr.ecr.us-east-1.amazonaws.com/${REPOSITORY}:${TAG}${TAG_SUFFIX} \ --tag=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX} \ --build-arg CIRCLE_PULL_REQUEST=${CIRCLE_PULL_REQUEST} \ - --cache-from type=registry,ref=docker.io/${REPOSITORY}:${TAG}-buildcache \ - --cache-from type=registry,ref=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX}-buildcache \ - --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ --progress plain \ --platform linux/amd64 \ --platform linux/arm64 \ @@ -115,9 +109,6 @@ jobs: --tag=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX} \ --build-arg CIRCLE_PULL_REQUEST=${CIRCLE_PULL_REQUEST} \ --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ - --cache-from type=registry,ref=docker.io/${REPOSITORY}:${TAG}-buildcache \ - --cache-from type=registry,ref=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX}-buildcache \ - --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ --progress plain \ --platform linux/amd64 \ --platform linux/arm64 \ From f8ddae002f9d77d0a10d72adb646dc2e13b04fb1 Mon Sep 17 00:00:00 2001 From: Michal Baumgartner Date: Tue, 8 Jul 2025 14:07:57 +0200 Subject: [PATCH 4/6] Increase no output timeout to 60m --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9ede898..fa324c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,6 +67,7 @@ jobs: - setup_buildkit_builder - run: name: Build and push python image + no_output_timeout: 60m # building Python can take a while, default timeout is 10m command: | REPOSITORY="deepnote/python" TAG="${PYTHON_VERSION}" From b7f5def2febf1eefdd5c2749f2a72b42730f68eb Mon Sep 17 00:00:00 2001 From: Michal Baumgartner Date: Mon, 11 Aug 2025 11:06:06 +0200 Subject: [PATCH 5/6] fix: Switch to conda-forge channel --- python/conda/Dockerfile.conda | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/conda/Dockerfile.conda b/python/conda/Dockerfile.conda index 7d7724d..be9dc6e 100644 --- a/python/conda/Dockerfile.conda +++ b/python/conda/Dockerfile.conda @@ -21,6 +21,10 @@ ARG PYTHON_VERSION RUN wget --quiet "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" -O /tmp/miniconda.sh && \ /bin/bash /tmp/miniconda.sh -b -p /opt/conda && \ rm /tmp/miniconda.sh && \ + # Use community packages from conda-forge instead of Anaconda Inc. default channels + # which require accepting terms of service & using commercial license for orgs with more than 200 employees + /opt/conda/bin/conda config --add channels conda-forge && \ + /opt/conda/bin/conda config --remove channels defaults && \ # Install the correct version of python (as the time of writing, anaconda # installed python 3.11 by default) for parity with our base image /opt/conda/bin/conda install python=${PYTHON_VERSION} && \ From b014fff355bcb38e0b085b5fa6023ae2fcd2b090 Mon Sep 17 00:00:00 2001 From: Michal Baumgartner Date: Mon, 11 Aug 2025 19:52:11 +0200 Subject: [PATCH 6/6] Incorporate PR review suggestions --- .circleci/config.yml | 9 +++------ python/conda/Dockerfile.conda | 11 +++++++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fa324c6..27172d3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,8 +46,7 @@ jobs: --tag=978928340082.dkr.ecr.us-east-1.amazonaws.com/${REPOSITORY}:${TAG}${TAG_SUFFIX} \ --tag=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX} \ --progress plain \ - --platform linux/amd64 \ - --platform linux/arm64 \ + --platform linux/amd64,linux/arm64 \ --provenance=false \ --sbom=false \ --output type=registry,push=true \ @@ -79,8 +78,7 @@ jobs: --tag=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX} \ --build-arg CIRCLE_PULL_REQUEST=${CIRCLE_PULL_REQUEST} \ --progress plain \ - --platform linux/amd64 \ - --platform linux/arm64 \ + --platform linux/amd64,linux/arm64 \ --provenance=false \ --sbom=false \ --output type=registry,push=true \ @@ -111,8 +109,7 @@ jobs: --build-arg CIRCLE_PULL_REQUEST=${CIRCLE_PULL_REQUEST} \ --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ --progress plain \ - --platform linux/amd64 \ - --platform linux/arm64 \ + --platform linux/amd64,linux/arm64 \ --provenance=false \ --sbom=false \ --output type=registry,push=true \ diff --git a/python/conda/Dockerfile.conda b/python/conda/Dockerfile.conda index be9dc6e..db9705d 100644 --- a/python/conda/Dockerfile.conda +++ b/python/conda/Dockerfile.conda @@ -18,13 +18,20 @@ ENV CONDA_ALWAYS_YES=true # but that would require baking in the URLs for # different Miniconda installer versions into the Dockerfile. ARG PYTHON_VERSION -RUN wget --quiet "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" -O /tmp/miniconda.sh && \ +ARG TARGETARCH +RUN case "$TARGETARCH" in \ + amd64) MINICONDA_ARCH="x86_64" ;; \ + arm64) MINICONDA_ARCH="aarch64" ;; \ + *) echo "Unsupported TARGETARCH: $TARGETARCH" >&2; exit 1 ;; \ + esac && \ + wget --quiet "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-${MINICONDA_ARCH}.sh" -O /tmp/miniconda.sh && \ /bin/bash /tmp/miniconda.sh -b -p /opt/conda && \ rm /tmp/miniconda.sh && \ # Use community packages from conda-forge instead of Anaconda Inc. default channels # which require accepting terms of service & using commercial license for orgs with more than 200 employees /opt/conda/bin/conda config --add channels conda-forge && \ - /opt/conda/bin/conda config --remove channels defaults && \ + /opt/conda/bin/conda config --remove channels defaults || true && \ + /opt/conda/bin/conda config --set channel_priority strict && \ # Install the correct version of python (as the time of writing, anaconda # installed python 3.11 by default) for parity with our base image /opt/conda/bin/conda install python=${PYTHON_VERSION} && \