@@ -9,20 +9,13 @@ 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
@@ -36,12 +29,8 @@ while [[ $# -gt 0 ]]; do
3629 case " $1 " in
3730 --cloud)
3831 CLOUD=" ${2:- } " ; shift 2;;
39- --parent-image)
40- PARENT_PREFIX=" ${2:- } " ; shift 2;;
4132 --new-version)
4233 NEW_VERSION=" ${2:- } " ; shift 2;;
43- --branch-ref)
44- BRANCH_REF=" ${2:- } " ; shift 2;;
4534 -h|--help)
4635 usage; exit 0;;
4736 * )
@@ -51,36 +40,20 @@ while [[ $# -gt 0 ]]; do
5140done
5241
5342# 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
43+ if [[ -z " ${CLOUD} " || -z " ${NEW_VERSION} " ]]; then
44+ echo " Error: --cloud and --new-version are required." >&2
5645 usage
5746 exit 1
5847fi
5948
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
6949
7050echo " === Quickstart Release Flow ==="
7151echo " Cloud stack: ${CLOUD} "
72- echo " Parent image prefix: ${PARENT_PREFIX} "
73- echo " New version: ${NEW_VERSION} "
74- echo " Git branch ref: ${BRANCH_REF} "
7552echo " ================================"
7653
7754# Minimal variables needed for the simplified flow
7855DIR_PUSHED=0
7956CLOUD_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]"
8457
8558_cleanup () {
8659 # Preserve original exit code from the point of trap invocation
@@ -106,36 +79,24 @@ echo "=== Switching to examples/quickstart directory ==="
10679pushd examples/quickstart > /dev/null
10780DIR_PUSHED=1
10881
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} "
82+ # Build parent image
83+ docker build -f docker/zenml-dev.Dockerfile -t zenmldocker/zenml:${NEW_VERSION} -py3.12 .
13284
13385# Phase 1: Run the pipeline locally
13486echo " === Phase 1: Run pipeline locally ==="
13587python run.py
13688
13789# Phase 2: Run on the cloud stack
13890echo " === Phase 2: Run pipeline on cloud stack ==="
91+
92+ if [[ " ${CLOUD} " == " aws" ]]; then
93+ zenml integration install aws s3 --uv -y
94+ elif [[ " ${CLOUD} " == " azure" ]]; then
95+ zenml integration install azure --uv -y
96+ elif [[ " ${CLOUD} " == " gcp" ]]; then
97+ zenml integration install gcp --uv -y
98+ fi
99+
139100zenml stack set " ${CLOUD_STACK} "
140101python run.py
141102
0 commit comments