Skip to content

Commit

Permalink
Hotfix for release flow (#2961)
Browse files Browse the repository at this point in the history
* hotfix for release flow

* fix cloudbuild
  • Loading branch information
avishniakov authored Aug 29, 2024
1 parent 47a5ba4 commit a2b8ffb
Showing 1 changed file with 76 additions and 62 deletions.
138 changes: 76 additions & 62 deletions release-cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
steps:
steps:
# build client base image - python 3.8
- name: gcr.io/cloud-builders/docker
args:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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

0 comments on commit a2b8ffb

Please sign in to comment.