@@ -9,39 +9,26 @@ usage() {
99Usage:
1010 scripts/qs_run_release_flow.sh \
1111 --cloud <aws|azure|gcp> \
12- --parent-image <registry/repo:tag-prefix> \
13- --new-version <X.Y.Z> \
14- [--branch-ref <git ref, e.g. refs/heads/misc/prepare-release-X.Y.Z>]
12+ --new-version <X.Y.Z>
1513
1614Description:
1715 Runs the Quickstart release validation flow:
18- - Patches the example config's parent_image and requirements to use the branch ref
19- - Installs dependencies
2016 - Phase 1: Runs the pipeline locally
2117 - Phase 2: Runs the pipeline on the cloud stack
2218
23- Notes:
24- --branch-ref is optional. If not provided, the script falls back to $GITHUB_REF.
25- If neither is available, the script exits with an error.
2619USAGE
2720}
2821
2922# Simple argument parser
3023CLOUD=" "
31- PARENT_PREFIX=" "
3224NEW_VERSION=" "
33- BRANCH_REF=" ${BRANCH_REF:- } " # allow environment override if set externally
3425
3526while [[ $# -gt 0 ]]; do
3627 case " $1 " in
3728 --cloud)
3829 CLOUD=" ${2:- } " ; shift 2;;
39- --parent-image)
40- PARENT_PREFIX=" ${2:- } " ; shift 2;;
4130 --new-version)
4231 NEW_VERSION=" ${2:- } " ; shift 2;;
43- --branch-ref)
44- BRANCH_REF=" ${2:- } " ; shift 2;;
4532 -h|--help)
4633 usage; exit 0;;
4734 * )
@@ -51,36 +38,20 @@ while [[ $# -gt 0 ]]; do
5138done
5239
5340# Validate required args
54- if [[ -z " ${CLOUD} " || -z " ${PARENT_PREFIX} " || -z " ${ NEW_VERSION}" ]]; then
55- echo " Error: --cloud, --parent-image, and --new-version are required." >&2
41+ if [[ -z " ${CLOUD} " || -z " ${NEW_VERSION} " ]]; then
42+ echo " Error: --cloud and --new-version are required." >&2
5643 usage
5744 exit 1
5845fi
5946
60- # Determine branch ref
61- if [[ -z " ${BRANCH_REF} " ]]; then
62- if [[ -n " ${GITHUB_REF:- } " ]]; then
63- BRANCH_REF=" ${GITHUB_REF} "
64- else
65- echo " Error: --branch-ref not provided and GITHUB_REF is not set. Please supply one of them." >&2
66- exit 1
67- fi
68- fi
6947
7048echo " === Quickstart Release Flow ==="
7149echo " Cloud stack: ${CLOUD} "
72- echo " Parent image prefix: ${PARENT_PREFIX} "
73- echo " New version: ${NEW_VERSION} "
74- echo " Git branch ref: ${BRANCH_REF} "
7550echo " ================================"
7651
7752# Minimal variables needed for the simplified flow
7853DIR_PUSHED=0
7954CLOUD_STACK=" ${CLOUD} "
80- CONFIG=" configs/training_${CLOUD} .yaml"
81- REQS=" requirements_${CLOUD} .txt"
82- PARENT_IMAGE=" ${PARENT_PREFIX} -${NEW_VERSION} "
83- ZENML_GIT_SPEC=" git+https://github.com/zenml-io/zenml.git@${BRANCH_REF} #egg=zenml[server]"
8455
8556_cleanup () {
8657 # Preserve original exit code from the point of trap invocation
@@ -106,36 +77,24 @@ echo "=== Switching to examples/quickstart directory ==="
10677pushd examples/quickstart > /dev/null
10778DIR_PUSHED=1
10879
109- # Validate required files
110- if [[ ! -f " ${CONFIG} " ]]; then
111- echo " Error: Config file not found: ${CONFIG} " >&2
112- exit 1
113- fi
114- if [[ ! -f " ${REQS} " ]]; then
115- echo " Error: Requirements file not found: ${REQS} " >&2
116- exit 1
117- fi
118-
119- # Patch config parent_image
120- echo " === Patching parent_image in ${CONFIG} to: ${PARENT_IMAGE} ==="
121- # Replace the entire parent_image line, preserving indentation
122- sed -i -E " s|^([[:space:]]*parent_image:).*|\1 \" ${PARENT_IMAGE} \" |g" " ${CONFIG} "
123-
124- # Patch requirements to install zenml from the provided branch ref
125- echo " === Updating ${REQS} : pinning zenml to branch ref ${BRANCH_REF} ==="
126- # Replace any line that starts with 'zenml[server]' to make the pin robust to different version operators.
127- sed -i -E " s|^zenml\\ [server\\ ].*|${ZENML_GIT_SPEC} |g" " ${REQS} "
128-
129- # Install dependencies
130- echo " === Installing dependencies from ${REQS} ==="
131- pip install -r " ${REQS} "
80+ # Build parent image
81+ docker build -f docker/zenml-dev.Dockerfile -t zenmldocker/zenml:${NEW_VERSION} -py3.12 .
13282
13383# Phase 1: Run the pipeline locally
13484echo " === Phase 1: Run pipeline locally ==="
13585python run.py
13686
13787# Phase 2: Run on the cloud stack
13888echo " === Phase 2: Run pipeline on cloud stack ==="
89+
90+ if [[ " ${CLOUD} " == " aws" ]]; then
91+ zenml integration install aws s3 --uv -y
92+ elif [[ " ${CLOUD} " == " azure" ]]; then
93+ zenml integration install azure --uv -y
94+ elif [[ " ${CLOUD} " == " gcp" ]]; then
95+ zenml integration install gcp --uv -y
96+ fi
97+
13998zenml stack set " ${CLOUD_STACK} "
14099python run.py
141100
0 commit comments