Skip to content

Commit e632353

Browse files
authored
Update test_jupyter_with_papermill.sh script for python312 (#1518)
Update test_jupyter_with_papermill.sh with Andy's help
1 parent f08389c commit e632353

File tree

1 file changed

+32
-18
lines changed

1 file changed

+32
-18
lines changed

scripts/test_jupyter_with_papermill.sh

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -185,28 +185,42 @@ function _get_source_of_truth_filepath()
185185
local notebook_id="${1##*/}"
186186

187187
local manifest_directory="${root_repo_directory}/manifests"
188-
local imagestream_directory="${manifest_directory}/base"
189-
190-
local file_suffix='notebook-imagestream.yaml'
188+
local imagestream_directory=
189+
local file_suffix=
191190
local filename=
192-
case "${notebook_id}" in
193-
*$jupyter_minimal_notebook_id*)
194-
filename="jupyter-${accelerator_flavor:+"$accelerator_flavor"-}${notebook_id}-${file_suffix}"
195-
if [ "${accelerator_flavor}" = 'cuda' ]; then
196-
filename="jupyter-${notebook_id}-gpu-${file_suffix}"
197-
fi
198-
;;
199-
*$jupyter_datascience_notebook_id* | *$jupyter_trustyai_notebook_id*)
200-
filename="jupyter-${notebook_id}-${file_suffix}"
191+
case "${python_flavor}" in
192+
python-3.12)
193+
imagestream_directory="${manifest_directory}/overlays/additional"
194+
file_suffix='imagestream.yaml'
195+
196+
local imagestream_accelerator_flavor="${accelerator_flavor:-cpu}"
197+
filename="jupyter-${notebook_id}-${imagestream_accelerator_flavor}-py312-${os_flavor}-${file_suffix}"
201198
;;
202-
*$jupyter_pytorch_notebook_id* | *$jupyter_tensorflow_notebook_id*)
203-
filename="jupyter-${accelerator_flavor:+"$accelerator_flavor"-}${notebook_id}-${file_suffix}"
204-
if [ "${accelerator_flavor}" = 'cuda' ]; then
205-
filename="jupyter-${notebook_id}-${file_suffix}"
206-
fi
199+
*)
200+
imagestream_directory="${manifest_directory}/base"
201+
file_suffix='notebook-imagestream.yaml'
202+
203+
case "${notebook_id}" in
204+
*$jupyter_minimal_notebook_id*)
205+
filename="jupyter-${accelerator_flavor:+"$accelerator_flavor"-}${notebook_id}-${file_suffix}"
206+
if [ "${accelerator_flavor}" = 'cuda' ]; then
207+
filename="jupyter-${notebook_id}-gpu-${file_suffix}"
208+
fi
209+
;;
210+
*$jupyter_datascience_notebook_id* | *$jupyter_trustyai_notebook_id*)
211+
filename="jupyter-${notebook_id}-${file_suffix}"
212+
;;
213+
*$jupyter_pytorch_notebook_id* | *$jupyter_tensorflow_notebook_id*)
214+
filename="jupyter-${accelerator_flavor:+"$accelerator_flavor"-}${notebook_id}-${file_suffix}"
215+
if [ "${accelerator_flavor}" = 'cuda' ]; then
216+
filename="jupyter-${notebook_id}-${file_suffix}"
217+
fi
218+
;;
219+
esac
207220
;;
208221
esac
209222

223+
210224
local filepath="${imagestream_directory}/${filename}"
211225

212226
if ! [ -e "${filepath}" ]; then
@@ -381,7 +395,7 @@ jupyter_pytorch_notebook_id='pytorch'
381395
jupyter_tensorflow_notebook_id='tensorflow'
382396

383397
notebook_name=$( _get_notebook_name "${test_target}" )
384-
python_flavor="python-${test_target//*-python-/}"
398+
python_flavor="python-${test_target//*-python-/}" # <-- python-3.11
385399
os_flavor=$(_get_os_flavor "${test_target}")
386400
accelerator_flavor=$(_get_accelerator_flavor "${test_target}")
387401

0 commit comments

Comments
 (0)