forked from zenml-io/zenml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update docker files and cloudbuild config * Update reference to docker image for the zenserver * Update default base image name to include python version * Add Dockerfile for local builds
- Loading branch information
Showing
10 changed files
with
102 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,16 @@ | ||
FROM ubuntu:20.04 | ||
ARG PYTHON_VERSION=3.9 | ||
FROM python:${PYTHON_VERSION}-slim AS base | ||
|
||
# python | ||
ENV PYTHONFAULTHANDLER=1 \ | ||
PYTHONUNBUFFERED=1 \ | ||
PYTHONHASHSEED=random \ | ||
PIP_NO_CACHE_DIR=off \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -q -y \ | ||
build-essential \ | ||
ca-certificates \ | ||
libsnappy-dev \ | ||
protobuf-compiler \ | ||
libprotobuf-dev \ | ||
python3 \ | ||
python3-dev \ | ||
python-is-python3 \ | ||
python3-venv \ | ||
python3-pip \ | ||
curl \ | ||
unzip \ | ||
git && \ | ||
apt-get autoclean && \ | ||
apt-get autoremove --purge | ||
|
||
RUN curl -sSL https://bootstrap.pypa.io/get-pip.py | python && \ | ||
pip install --no-cache-dir --upgrade --pre pip | ||
PIP_NO_CACHE_DIR=1 \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=1 | ||
|
||
ARG ZENML_VERSION | ||
|
||
# install the given zenml version (default to latest) | ||
RUN pip install --no-cache-dir zenml${ZENML_VERSION:+==$ZENML_VERSION} | ||
RUN pip install zenml${ZENML_VERSION:+==$ZENML_VERSION} | ||
|
||
FROM base AS server | ||
RUN pip install zenml${ZENML_VERSION:+==$ZENML_VERSION}[server] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
steps: | ||
# build base image - python 3.7 | ||
- name : 'gcr.io/cloud-builders/docker' | ||
id: 'build-base' | ||
waitFor: ['docker-login'] | ||
entrypoint: 'bash' | ||
args: ['-c', 'docker build --build-arg ZENML_VERSION=$TAG_NAME --build-arg PYTHON_VERSION=3.7 --target base -t $$USERNAME/zenml:$TAG_NAME-py3.7 -t $$USERNAME/zenml:py3.7 -f docker/base.Dockerfile .'] | ||
secretEnv: ['USERNAME'] | ||
|
||
# build base image - python 3.8 | ||
- name : 'gcr.io/cloud-builders/docker' | ||
id: 'build-base' | ||
waitFor: ['docker-login'] | ||
entrypoint: 'bash' | ||
args: ['-c', 'docker build --build-arg ZENML_VERSION=$TAG_NAME --build-arg PYTHON_VERSION=3.8 --target base -t $$USERNAME/zenml:$TAG_NAME-py3.8 -t $$USERNAME/zenml:py3.8 -t $$USERNAME/zenml:$TAG_NAME -t $$USERNAME/zenml:latest -f docker/base.Dockerfile .'] | ||
secretEnv: ['USERNAME'] | ||
|
||
# build base image - python 3.9 | ||
- name : 'gcr.io/cloud-builders/docker' | ||
id: 'build-base' | ||
waitFor: ['docker-login'] | ||
entrypoint: 'bash' | ||
args: ['-c', 'docker build --build-arg ZENML_VERSION=$TAG_NAME --build-arg PYTHON_VERSION=3.9 --target base -t $$USERNAME/zenml:$TAG_NAME-py3.9 -t $$USERNAME/zenml:py3.9 -f docker/base.Dockerfile .'] | ||
secretEnv: ['USERNAME'] | ||
|
||
# build server image - python 3.7 | ||
- name : 'gcr.io/cloud-builders/docker' | ||
id: 'build-base' | ||
waitFor: ['docker-login'] | ||
entrypoint: 'bash' | ||
args: ['-c', 'docker build --build-arg ZENML_VERSION=$TAG_NAME --build-arg PYTHON_VERSION=3.7 -t $$USERNAME/zenml-server:$TAG_NAME-py3.7 -t $$USERNAME/zenml-server:py3.7 -f docker/base.Dockerfile .'] | ||
secretEnv: ['USERNAME'] | ||
|
||
# build server image - python 3.8 | ||
- name : 'gcr.io/cloud-builders/docker' | ||
id: 'build-base' | ||
waitFor: ['docker-login'] | ||
entrypoint: 'bash' | ||
args: ['-c', 'docker build --build-arg ZENML_VERSION=$TAG_NAME --build-arg PYTHON_VERSION=3.8 -t $$USERNAME/zenml-server:$TAG_NAME-py3.8 -t $$USERNAME/zenml-server:py3.8 -t $$USERNAME/zenml-server:$TAG_NAME -t $$USERNAME/zenml-server:latest -f docker/base.Dockerfile .'] | ||
secretEnv: ['USERNAME'] | ||
|
||
# build server image - python 3.9 | ||
- name : 'gcr.io/cloud-builders/docker' | ||
id: 'build-base' | ||
waitFor: ['docker-login'] | ||
entrypoint: 'bash' | ||
args: ['-c', 'docker build --build-arg ZENML_VERSION=$TAG_NAME --build-arg PYTHON_VERSION=3.9 -t $$USERNAME/zenml-server:$TAG_NAME-py3.9 -t $$USERNAME/zenml-server:py3.9 -f docker/base.Dockerfile .'] | ||
secretEnv: ['USERNAME'] | ||
|
||
# login to dockerhub | ||
- name: 'gcr.io/cloud-builders/docker' | ||
id: 'docker-login' | ||
entrypoint: 'bash' | ||
args: ['-c', 'docker login --username=$$USERNAME --password=$$PASSWORD'] | ||
secretEnv: ['USERNAME', 'PASSWORD'] | ||
|
||
# push the base images | ||
- name: 'gcr.io/cloud-builders/docker' | ||
id: 'push' | ||
entrypoint: 'bash' | ||
args: [ '-c', 'docker push $$USERNAME/zenml' ] | ||
secretEnv: [ 'USERNAME' ] | ||
|
||
# push the server images | ||
- name: 'gcr.io/cloud-builders/docker' | ||
id: 'push' | ||
entrypoint: 'bash' | ||
args: [ '-c', 'docker push $$USERNAME/zenml-server' ] | ||
secretEnv: [ 'USERNAME' ] | ||
|
||
availableSecrets: | ||
secretManager: | ||
- versionName: projects/$PROJECT_ID/secrets/docker-password/versions/1 | ||
env: 'PASSWORD' | ||
- versionName: projects/$PROJECT_ID/secrets/docker-username/versions/1 | ||
env: 'USERNAME' | ||
timeout: 3600s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters