diff --git a/release-cloudbuild.yaml b/release-cloudbuild.yaml index c8b9f785914..c33fa7dca90 100644 --- a/release-cloudbuild.yaml +++ b/release-cloudbuild.yaml @@ -1,4 +1,4 @@ -steps: +steps: # build client base image - python 3.8 - name: gcr.io/cloud-builders/docker args: @@ -9,8 +9,7 @@ steps: --build-arg PYTHON_VERSION=3.8 \ --target client \ -f docker/base.Dockerfile . \ - -t $$USERNAME/zenml:$TAG_NAME-py3.8 \ - -t $$USERNAME/zenml:$TAG_NAME + -t $$USERNAME/zenml:$TAG_NAME-py3.8 # use latest tags only for official releases if [[ $TAG_NAME =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then @@ -76,7 +75,8 @@ steps: --build-arg PYTHON_VERSION=3.11 \ --target client \ -f docker/base.Dockerfile . \ - -t $$USERNAME/zenml:$TAG_NAME-py3.11 + -t $$USERNAME/zenml:$TAG_NAME-py3.11 \ + -t $$USERNAME/zenml:$TAG_NAME # use latest tags only for official releases if [[ $TAG_NAME =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then @@ -89,6 +89,68 @@ steps: secretEnv: - USERNAME + # build server image - python 3.11 only + - name: gcr.io/cloud-builders/docker + args: + - '-c' + - | + docker build \ + --build-arg ZENML_VERSION=$TAG_NAME \ + --build-arg PYTHON_VERSION=3.11 \ + --target server \ + -f docker/base.Dockerfile . \ + -t $$USERNAME/zenml-server:$TAG_NAME + + # use latest tags only for official releases + if [[ $TAG_NAME =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then + docker tag $$USERNAME/zenml-server:$TAG_NAME $$USERNAME/zenml-server:latest + fi + id: build-server + waitFor: ['-'] + entrypoint: bash + secretEnv: + - USERNAME + + # login to Dockerhub + - name: gcr.io/cloud-builders/docker + args: + - '-c' + - docker login --username=$$USERNAME --password=$$PASSWORD + id: docker-login + entrypoint: bash + secretEnv: + - USERNAME + - PASSWORD + + # push base images + - name: gcr.io/cloud-builders/docker + args: + - '-c' + - docker push --all-tags $$USERNAME/zenml + id: push-base + waitFor: + - docker-login + - build-base-3.8 + - build-base-3.9 + - build-base-3.10 + - build-base-3.11 + entrypoint: bash + secretEnv: + - USERNAME + + # push server images + - name: gcr.io/cloud-builders/docker + args: + - '-c' + - docker push --all-tags $$USERNAME/zenml-server + id: push-server + waitFor: + - build-server + - docker-login + entrypoint: bash + secretEnv: + - USERNAME + # build client quickstart gcp image - python 3.11 - name: gcr.io/cloud-builders/docker args: @@ -98,12 +160,10 @@ steps: --build-arg ZENML_VERSION=$TAG_NAME \ --build-arg PYTHON_VERSION=3.11 \ --build-arg CLOUD_PROVIDER=gcp \ - --target client \ -f docker/zenml-quickstart.Dockerfile . \ -t $$USERNAME/zenml-public-pipelines:quickstart-$TAG_NAME-py3.11-gcp - id: build-quickstart-3.11-gcp - waitFor: [ '-' ] + waitFor: [ 'push-base' ] entrypoint: bash secretEnv: - USERNAME @@ -117,12 +177,10 @@ steps: --build-arg ZENML_VERSION=$TAG_NAME \ --build-arg PYTHON_VERSION=3.11 \ --build-arg CLOUD_PROVIDER=aws \ - --target client \ -f docker/zenml-quickstart.Dockerfile . \ -t $$USERNAME/zenml-public-pipelines:quickstart-$TAG_NAME-py3.11-aws - id: build-quickstart-3.11-aws - waitFor: [ '-' ] + waitFor: [ 'push-base' ] entrypoint: bash secretEnv: - USERNAME @@ -136,68 +194,24 @@ steps: --build-arg ZENML_VERSION=$TAG_NAME \ --build-arg PYTHON_VERSION=3.11 \ --build-arg CLOUD_PROVIDER=azure \ - --target client \ -f docker/zenml-quickstart.Dockerfile . \ -t $$USERNAME/zenml-public-pipelines:quickstart-$TAG_NAME-py3.11-azure - id: build-quickstart-3.11-azure - waitFor: [ '-' ] + waitFor: [ 'push-base' ] entrypoint: bash secretEnv: - USERNAME - # build server image - python 3.11 only + # push quickstart images - name: gcr.io/cloud-builders/docker args: - '-c' - - | - docker build \ - --build-arg ZENML_VERSION=$TAG_NAME \ - --build-arg PYTHON_VERSION=3.11 \ - --target server \ - -f docker/base.Dockerfile . \ - -t $$USERNAME/zenml-server:$TAG_NAME - - # use latest tags only for official releases - if [[ $TAG_NAME =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then - docker tag $$USERNAME/zenml-server:$TAG_NAME $$USERNAME/zenml-server:latest - fi - id: build-server - waitFor: ['-'] - entrypoint: bash - secretEnv: - - USERNAME - - # login to Dockerhub - - name: gcr.io/cloud-builders/docker - args: - - '-c' - - docker login --username=$$USERNAME --password=$$PASSWORD - id: docker-login - entrypoint: bash - secretEnv: - - USERNAME - - PASSWORD - - # push base images - - name: gcr.io/cloud-builders/docker - args: - - '-c' - - docker push --all-tags $$USERNAME/zenml - id: push-base - waitFor: - - docker-login - entrypoint: bash - secretEnv: - - USERNAME - - # push server images - - name: gcr.io/cloud-builders/docker - args: - - '-c' - - docker push --all-tags $$USERNAME/zenml-server - id: push-server + - docker push --all-tags $$USERNAME/zenml-public-pipelines + id: push-quickstart waitFor: + - build-quickstart-3.11-gcp + - build-quickstart-3.11-aws + - build-quickstart-3.11-azure - docker-login entrypoint: bash secretEnv: @@ -209,4 +223,4 @@ availableSecrets: - versionName: projects/$PROJECT_ID/secrets/docker-password/versions/1 env: PASSWORD - versionName: projects/$PROJECT_ID/secrets/docker-username/versions/1 - env: USERNAME + env: USERNAME \ No newline at end of file