Skip to content

Commit 3cb22a0

Browse files
authored
feat: add --chart-path option to run_demo.sh (#186)
Add support for installing custom Helm charts (e.g., umbrella charts for extensions) instead of the default diracx chart. Changes: - Add --chart-path command-line option to specify a custom chart directory - Default to ${script_dir}/diracx for backward compatibility - Update usage documentation with the new option This enables community extensions (like gubbins, lhcbdiracx) to use their own umbrella charts that depend on the base diracx chart while leveraging the run_demo.sh infrastructure. Note: helm dependency build should be run on the custom chart before calling this script (typically done in CI configuration).
1 parent f315416 commit 3cb22a0

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

run_demo.sh

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ function element_not_in_array() {
103103
return $found
104104
}
105105

106-
usage="${0##*/} [-h|--help] [--exit-when-done] [--offline] [--enable-coverage] [--no-mount-containerd] [--set-value key=value] [--ci-values=values.yaml] [--load-docker-image=<image_name:tag>] [--] [source directories]"
106+
usage="${0##*/} [-h|--help] [--exit-when-done] [--offline] [--enable-coverage] [--no-mount-containerd] [--set-value key=value] [--ci-values=values.yaml] [--load-docker-image=<image_name:tag>] [--chart-path=path] [--] [source directories]"
107107
usage+="\n\n"
108108
usage+=" -h|--help: Print this help message and exit\n"
109+
usage+=" --chart-path: Path to a custom Helm chart to install instead of the default diracx chart\n"
110+
usage+=" This is useful for installing umbrella charts that depend on diracx (e.g., extension charts)\n"
109111
usage+=" --ci-values: Path to a values.yaml file which contains diracx dev settings only enabled for CI\n"
110112
usage+=" --exit-when-done: Exit after the demo has been started (it will be left running in the background)\n"
111113
usage+=" --enable-coverage: Enable coverage reporting (used by diracx CI)\n"
@@ -134,6 +136,7 @@ editable_python=1
134136
open_telemetry=0
135137
declare -a ci_values_files=()
136138
declare -a docker_images_to_load=()
139+
chart_path=""
137140

138141
while [ -n "${1:-}" ]; do case $1 in
139142
# Print a brief usage summary and exit
@@ -236,6 +239,20 @@ while [ -n "${1:-}" ]; do case $1 in
236239
shift
237240
continue ;;
238241

242+
--chart-path)
243+
shift
244+
if [[ -z "${1:-}" ]]; then
245+
printf "%b Error: --chart-path requires an argument\n" ${SKULL_EMOJI}
246+
exit 1
247+
fi
248+
chart_path=$(realpath "${1}")
249+
if [[ ! -d "${chart_path}" ]]; then
250+
printf "%b Error: --chart-path does not point to a directory\n" ${SKULL_EMOJI}
251+
exit 1;
252+
fi
253+
shift
254+
continue ;;
255+
239256
# Double-dash: Terminate option parsing
240257
--)
241258
shift
@@ -601,9 +618,12 @@ done
601618

602619
fi;
603620

621+
# Set the chart path to use (default to the diracx chart in this repository)
622+
if [[ -z "${chart_path}" ]]; then
623+
chart_path="${script_dir}/diracx"
624+
fi
604625

605-
606-
if ! "${demo_dir}/helm" install --debug diracx-demo "${script_dir}/diracx" "${helm_arguments[@]}"; then
626+
if ! "${demo_dir}/helm" install --debug diracx-demo "${chart_path}" "${helm_arguments[@]}"; then
607627
printf "%b Error using helm DiracX\n" ${WARN_EMOJI}
608628
echo "Failed to run \"helm install\"" >> "${demo_dir}/.failed"
609629
else

0 commit comments

Comments
 (0)