diff --git a/.circleci/config.yml b/.circleci/config.yml index d485437..771c12b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,13 +46,16 @@ jobs: - run: name: Build and push base image command: | + REPOSITORY="deepnote/python" + TAG="base" + TAG_SUFFIX="${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}}" docker buildx build \ --file=./python/base/Dockerfile.base \ - --tag=978928340082.dkr.ecr.us-east-1.amazonaws.com/deepnote/python:base${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}} \ - --tag=docker.io/deepnote/python:base${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}} \ - --cache-from type=registry,ref=docker.io/deepnote/python:base \ - --cache-from type=registry,ref=docker.io/deepnote/python:base${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}}-buildcache,mode=max \ - --cache-to type=registry,ref=docker.io/deepnote/python:base${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ + --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 \ --provenance=false \ @@ -77,16 +80,18 @@ jobs: name: Build and push python image command: | REPOSITORY="deepnote/python" - TAG="${PYTHON_VERSION}${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}}" + TAG="${PYTHON_VERSION}" + TAG_SUFFIX="${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}}" docker buildx build \ --file=./python/python/Dockerfile.python \ - --tag=978928340082.dkr.ecr.us-east-1.amazonaws.com/${REPOSITORY}:${TAG} \ - --tag=docker.io/${REPOSITORY}:${TAG} \ + --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} \ --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ --build-arg PYTHON_VERSION_PATCH=${PYTHON_VERSION_PATCH} \ - --cache-from type=registry,ref=docker.io/${REPOSITORY}:${TAG}-buildcache,mode=max \ - --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ + --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 \ --provenance=false \ @@ -111,15 +116,17 @@ jobs: name: Build and push python-datascience image command: | REPOSITORY="deepnote/python" - TAG="${PYTHON_VERSION}-datascience${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}}" + TAG="${PYTHON_VERSION}-datascience" + TAG_SUFFIX="${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}}" docker buildx build \ --file=./python/datascience/Dockerfile.datascience \ - --tag=978928340082.dkr.ecr.us-east-1.amazonaws.com/${REPOSITORY}:${TAG} \ - --tag=docker.io/${REPOSITORY}:${TAG} \ + --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} \ --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ - --cache-from type=registry,ref=docker.io/${REPOSITORY}:${TAG}-buildcache,mode=max \ - --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ + --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 \ --provenance=false \ @@ -144,15 +151,17 @@ jobs: name: Build and push python-conda image command: | REPOSITORY="deepnote/python" - TAG="${PYTHON_VERSION}-conda${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}}" + TAG="${PYTHON_VERSION}-conda" + TAG_SUFFIX="${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}}" docker buildx build \ --file=./python/conda/Dockerfile.conda \ - --tag=978928340082.dkr.ecr.us-east-1.amazonaws.com/${REPOSITORY}:${TAG} \ - --tag=docker.io/${REPOSITORY}:${TAG} \ + --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} \ --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ - --cache-from type=registry,ref=docker.io/${REPOSITORY}:${TAG}-buildcache,mode=max \ - --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ + --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 \ --provenance=false \ @@ -177,22 +186,23 @@ jobs: steps: - checkout - docker_login - - split_python_version # This provides PYTHON_VERSION - setup_buildkit_builder - run: name: Build and push python image command: | REPOSITORY="deepnote/tensorflow" - TAG="${TF_VERSION}${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}}-gpu" + TAG="${TF_VERSION}-gpu" + TAG_SUFFIX="${CIRCLE_PULL_REQUEST:+-ra-${CIRCLE_PULL_REQUEST##*/}}" docker buildx build \ --file=./gpu/Dockerfile \ - --tag=978928340082.dkr.ecr.us-east-1.amazonaws.com/${REPOSITORY}:${TAG} \ - --tag=docker.io/${REPOSITORY}:${TAG} \ + --tag=978928340082.dkr.ecr.us-east-1.amazonaws.com/${REPOSITORY}:${TAG}${TAG_SUFFIX} \ + --tag=docker.io/${REPOSITORY}:${TAG}${TAG_SUFFIX} \ --build-arg CUDA_IMAGE_TAG=${CUDA_TAG} \ --build-arg TF_VERSION=${TF_VERSION} \ --build-arg PYTHON_VER=${PY_VERSION} \ - --cache-from type=registry,ref=docker.io/${REPOSITORY}:${TAG}-buildcache,mode=max \ - --cache-to type=registry,ref=docker.io/${REPOSITORY}:${TAG}-buildcache,mode=max,image-manifest=true,oci-mediatypes=true \ + --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 \ --provenance=false \