Skip to content

Commit d49e01a

Browse files
committed
Adding proper upgrade case and adding different image setup for pipeliens
1 parent 0bc4367 commit d49e01a

File tree

2 files changed

+78
-54
lines changed

2 files changed

+78
-54
lines changed

.github/workflows/upgrade-bootstrap-v2.yml

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,14 @@ on:
1212
type: string
1313
required: true
1414
description: "sbcli branch / version tag to bootstrap the cluster with (e.g. R25.10-Hotfix)"
15-
BASE_SPDK_IMAGE:
15+
CUSTOM_IMAGES:
1616
type: string
17-
default: ""
18-
description: "SPDK image for the base deployment (empty = bootstrap default)"
17+
default: 'base_spdk="" target_spdk="" base_docker="" target_docker=""'
18+
description: "Image overrides: set base_spdk, target_spdk, base_docker and/or target_docker values, leave as \"\" to skip."
1919
TARGET_SBCLI_BRANCH:
2020
type: string
2121
required: true
2222
description: "sbcli branch / version tag to upgrade to (e.g. main)"
23-
TARGET_SPDK_IMAGE:
24-
type: string
25-
default: ""
26-
description: "SPDK image for the target version (empty = default)"
2723
STORAGE_PRIVATE_IPS:
2824
type: string
2925
default: "192.168.10.205 192.168.10.206 192.168.10.207 192.168.10.208"
@@ -120,17 +116,13 @@ on:
120116
BASE_SBCLI_BRANCH:
121117
description: "sbcli branch / version tag to bootstrap the cluster with (e.g. R25.10-Hotfix)"
122118
required: true
123-
BASE_SPDK_IMAGE:
124-
description: "SPDK image for the base deployment (empty = bootstrap default)"
119+
CUSTOM_IMAGES:
120+
description: "Image overrides: set base_spdk, target_spdk, base_docker and/or target_docker values, leave as \"\" to skip."
125121
required: false
126-
default: ""
122+
default: 'base_spdk="" target_spdk="" base_docker="" target_docker=""'
127123
TARGET_SBCLI_BRANCH:
128124
description: "sbcli branch / version tag to upgrade to (e.g. main)"
129125
required: true
130-
TARGET_SPDK_IMAGE:
131-
description: "SPDK image for the target version (empty = default)"
132-
required: false
133-
default: ""
134126

135127
# ── Run-specific ─────────────────────────────────────────────────────────
136128
BOOTSTRAP_IS_SINGLE_NODE:
@@ -168,10 +160,9 @@ jobs:
168160

169161
env:
170162
# Upgrade-specific
171-
BASE_SBCLI_BRANCH: ${{ inputs.BASE_SBCLI_BRANCH }}
172-
BASE_SPDK_IMAGE: ${{ inputs.BASE_SPDK_IMAGE || '' }}
163+
BASE_SBCLI_BRANCH: ${{ inputs.BASE_SBCLI_BRANCH }}
173164
TARGET_SBCLI_BRANCH: ${{ inputs.TARGET_SBCLI_BRANCH }}
174-
TARGET_SPDK_IMAGE: ${{ inputs.TARGET_SPDK_IMAGE || '' }}
165+
CUSTOM_IMAGES: ${{ inputs.CUSTOM_IMAGES || 'base_spdk="" target_spdk="" base_docker="" target_docker=""' }}
175166

176167
# Cluster/lab env
177168
STORAGE_PRIVATE_IPS: ${{ inputs.STORAGE_PRIVATE_IPS || '192.168.10.205 192.168.10.206 192.168.10.207 192.168.10.208' }}
@@ -348,16 +339,33 @@ jobs:
348339
exit 1
349340
fi
350341
351-
- name: Export BASE_SPDK_IMAGE env (only if provided)
342+
- name: Parse CUSTOM_IMAGES overrides
352343
shell: bash
353344
run: |
354345
set -euxo pipefail
355-
if [[ -n "${BASE_SPDK_IMAGE}" ]]; then
356-
echo "SIMPLY_BLOCK_SPDK_ULTRA_IMAGE=${BASE_SPDK_IMAGE}" >> "$GITHUB_ENV"
357-
echo "Base SPDK image exported: ${BASE_SPDK_IMAGE}"
358-
else
359-
echo "Base SPDK image not provided; bootstrap will use its default"
360-
fi
346+
custom="${CUSTOM_IMAGES}"
347+
for item in $custom; do
348+
key="${item%%=*}"
349+
value="${item#*=}"
350+
value="${value//\"/}"
351+
if [[ -z "$value" ]]; then
352+
echo "Skipping $key (empty)"
353+
continue
354+
fi
355+
case "$key" in
356+
base_spdk) echo "BASE_SPDK_IMAGE=$value" >> "$GITHUB_ENV"
357+
echo "SIMPLY_BLOCK_SPDK_ULTRA_IMAGE=$value" >> "$GITHUB_ENV"
358+
echo "Base SPDK image set: $value" ;;
359+
target_spdk) echo "TARGET_SPDK_IMAGE=$value" >> "$GITHUB_ENV"
360+
echo "Target SPDK image set: $value" ;;
361+
base_docker) echo "BASE_DOCKER_IMAGE=$value" >> "$GITHUB_ENV"
362+
echo "SIMPLY_BLOCK_DOCKER_IMAGE=$value" >> "$GITHUB_ENV"
363+
echo "Base Docker image set: $value" ;;
364+
target_docker) echo "TARGET_DOCKER_IMAGE=$value" >> "$GITHUB_ENV"
365+
echo "Target Docker image set: $value" ;;
366+
*) echo "Unknown image key: $key (ignored)" ;;
367+
esac
368+
done
361369
362370
- name: Resolve KEY_PATH and validate key exists
363371
shell: bash
@@ -600,10 +608,13 @@ jobs:
600608
chmod +x ./bootstrap-cluster.sh
601609
602610
extra_args=()
603-
# BASE_SPDK_IMAGE exported as SIMPLY_BLOCK_SPDK_ULTRA_IMAGE in an earlier step
611+
# Images exported by the "Parse CUSTOM_IMAGES overrides" step
604612
if [[ -n "${SIMPLY_BLOCK_SPDK_ULTRA_IMAGE-}" ]]; then
605613
extra_args+=( --spdk-image "${SIMPLY_BLOCK_SPDK_ULTRA_IMAGE}" )
606614
fi
615+
if [[ -n "${SIMPLY_BLOCK_DOCKER_IMAGE-}" ]]; then
616+
extra_args+=( --docker-image "${SIMPLY_BLOCK_DOCKER_IMAGE}" )
617+
fi
607618
if [[ "${{ inputs.BOOTSTRAP_IS_SINGLE_NODE }}" == "true" ]]; then
608619
extra_args+=( --is-single-node true )
609620
fi
@@ -744,8 +755,9 @@ jobs:
744755
python3 -u upgrade_e2e.py \
745756
--base_version "${BASE_SBCLI_BRANCH}" \
746757
--target_version "${TARGET_SBCLI_BRANCH}" \
747-
--base_spdk_image "${BASE_SPDK_IMAGE}" \
748-
--target_spdk_image "${TARGET_SPDK_IMAGE}" \
758+
--base_spdk_image "${BASE_SPDK_IMAGE:-}" \
759+
--target_spdk_image "${TARGET_SPDK_IMAGE:-}" \
760+
--target_docker_image "${TARGET_DOCKER_IMAGE:-}" \
749761
"${TESTNAME_ARGS[@]}" \
750762
2>&1 | tee output.log
751763

.github/workflows/upgrade-bootstrap.yml

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@ on:
1111
type: string
1212
required: true
1313
description: "sbcli branch / version tag to bootstrap the cluster with (e.g. R25.10-Hotfix)"
14-
BASE_SPDK_IMAGE:
14+
CUSTOM_IMAGES:
1515
type: string
16-
default: ""
17-
description: "SPDK image for the base deployment (empty = bootstrap default)"
16+
default: 'base_spdk="" target_spdk="" base_docker="" target_docker=""'
17+
description: "Image overrides: set base_spdk, target_spdk, base_docker and/or target_docker values, leave as \"\" to skip."
1818
TARGET_SBCLI_BRANCH:
1919
type: string
2020
required: true
2121
description: "sbcli branch / version tag to upgrade to (e.g. main)"
22-
TARGET_SPDK_IMAGE:
23-
type: string
24-
default: ""
25-
description: "SPDK image for the target version (empty = default)"
2622
STORAGE_PRIVATE_IPS:
2723
type: string
2824
default: "192.168.10.205 192.168.10.206 192.168.10.207 192.168.10.208"
@@ -96,17 +92,13 @@ on:
9692
BASE_SBCLI_BRANCH:
9793
description: "sbcli branch / version tag to bootstrap the cluster with (e.g. R25.10-Hotfix)"
9894
required: true
99-
BASE_SPDK_IMAGE:
100-
description: "SPDK image for the base deployment (empty = bootstrap default)"
95+
CUSTOM_IMAGES:
96+
description: "Image overrides: set base_spdk, target_spdk, base_docker and/or target_docker values, leave as \"\" to skip."
10197
required: false
102-
default: ""
98+
default: 'base_spdk="" target_spdk="" base_docker="" target_docker=""'
10399
TARGET_SBCLI_BRANCH:
104100
description: "sbcli branch / version tag to upgrade to (e.g. main)"
105101
required: true
106-
TARGET_SPDK_IMAGE:
107-
description: "SPDK image for the target version (empty = default)"
108-
required: false
109-
default: ""
110102
STORAGE_PRIVATE_IPS:
111103
description: "Space-separated storage node IPs (also used for cleanup)"
112104
required: true
@@ -207,10 +199,9 @@ jobs:
207199

208200
env:
209201
# Upgrade-specific
210-
BASE_SBCLI_BRANCH: ${{ inputs.BASE_SBCLI_BRANCH }}
211-
BASE_SPDK_IMAGE: ${{ inputs.BASE_SPDK_IMAGE || '' }}
202+
BASE_SBCLI_BRANCH: ${{ inputs.BASE_SBCLI_BRANCH }}
212203
TARGET_SBCLI_BRANCH: ${{ inputs.TARGET_SBCLI_BRANCH }}
213-
TARGET_SPDK_IMAGE: ${{ inputs.TARGET_SPDK_IMAGE || '' }}
204+
CUSTOM_IMAGES: ${{ inputs.CUSTOM_IMAGES || 'base_spdk="" target_spdk="" base_docker="" target_docker=""' }}
214205

215206
# Cluster/lab env
216207
STORAGE_PRIVATE_IPS: ${{ inputs.STORAGE_PRIVATE_IPS || '192.168.10.205 192.168.10.206 192.168.10.207 192.168.10.208' }}
@@ -290,16 +281,33 @@ jobs:
290281
exit 1
291282
fi
292283
293-
- name: Export BASE_SPDK_IMAGE env (only if provided)
284+
- name: Parse CUSTOM_IMAGES overrides
294285
shell: bash
295286
run: |
296287
set -euxo pipefail
297-
if [[ -n "${BASE_SPDK_IMAGE}" ]]; then
298-
echo "SIMPLY_BLOCK_SPDK_ULTRA_IMAGE=${BASE_SPDK_IMAGE}" >> "$GITHUB_ENV"
299-
echo "Base SPDK image exported: ${BASE_SPDK_IMAGE}"
300-
else
301-
echo "Base SPDK image not provided; bootstrap will use its default"
302-
fi
288+
custom="${CUSTOM_IMAGES}"
289+
for item in $custom; do
290+
key="${item%%=*}"
291+
value="${item#*=}"
292+
value="${value//\"/}"
293+
if [[ -z "$value" ]]; then
294+
echo "Skipping $key (empty)"
295+
continue
296+
fi
297+
case "$key" in
298+
base_spdk) echo "BASE_SPDK_IMAGE=$value" >> "$GITHUB_ENV"
299+
echo "SIMPLY_BLOCK_SPDK_ULTRA_IMAGE=$value" >> "$GITHUB_ENV"
300+
echo "Base SPDK image set: $value" ;;
301+
target_spdk) echo "TARGET_SPDK_IMAGE=$value" >> "$GITHUB_ENV"
302+
echo "Target SPDK image set: $value" ;;
303+
base_docker) echo "BASE_DOCKER_IMAGE=$value" >> "$GITHUB_ENV"
304+
echo "SIMPLY_BLOCK_DOCKER_IMAGE=$value" >> "$GITHUB_ENV"
305+
echo "Base Docker image set: $value" ;;
306+
target_docker) echo "TARGET_DOCKER_IMAGE=$value" >> "$GITHUB_ENV"
307+
echo "Target Docker image set: $value" ;;
308+
*) echo "Unknown image key: $key (ignored)" ;;
309+
esac
310+
done
303311
304312
- name: Resolve KEY_PATH and validate key exists
305313
shell: bash
@@ -542,10 +550,13 @@ jobs:
542550
chmod +x ./bootstrap-cluster.sh
543551
544552
extra_args=()
545-
# BASE_SPDK_IMAGE exported as SIMPLY_BLOCK_SPDK_ULTRA_IMAGE in an earlier step
553+
# Images exported by the "Parse CUSTOM_IMAGES overrides" step
546554
if [[ -n "${SIMPLY_BLOCK_SPDK_ULTRA_IMAGE-}" ]]; then
547555
extra_args+=( --spdk-image "${SIMPLY_BLOCK_SPDK_ULTRA_IMAGE}" )
548556
fi
557+
if [[ -n "${SIMPLY_BLOCK_DOCKER_IMAGE-}" ]]; then
558+
extra_args+=( --docker-image "${SIMPLY_BLOCK_DOCKER_IMAGE}" )
559+
fi
549560
if [[ "${{ inputs.BOOTSTRAP_IS_SINGLE_NODE }}" == "true" ]]; then
550561
extra_args+=( --is-single-node true )
551562
fi
@@ -670,8 +681,9 @@ jobs:
670681
python3 -u upgrade_e2e.py \
671682
--base_version "${BASE_SBCLI_BRANCH}" \
672683
--target_version "${TARGET_SBCLI_BRANCH}" \
673-
--base_spdk_image "${BASE_SPDK_IMAGE}" \
674-
--target_spdk_image "${TARGET_SPDK_IMAGE}" \
684+
--base_spdk_image "${BASE_SPDK_IMAGE:-}" \
685+
--target_spdk_image "${TARGET_SPDK_IMAGE:-}" \
686+
--target_docker_image "${TARGET_DOCKER_IMAGE:-}" \
675687
"${TESTNAME_ARGS[@]}" \
676688
2>&1 | tee output.log
677689

0 commit comments

Comments
 (0)