@@ -14,7 +14,7 @@ MAKEFLAGS += --no-builtin-rules
14
14
15
15
# todo: leave the default recipe prefix for now
16
16
ifeq ($(origin .RECIPEPREFIX ) , undefined)
17
- $(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
17
+ $(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
18
18
endif
19
19
.RECIPEPREFIX =
20
20
@@ -492,16 +492,16 @@ undeploy-c9s-%: bin/kubectl
492
492
# ARG 1: UBI flavor
493
493
# ARG 1: Python kernel
494
494
define test_with_papermill
495
- $(eval PREFIX_NAME := $(subst /,-,$(1 ) _$(2 ) ) ) \
496
- $(KUBECTL_BIN ) exec $(FULL_NOTEBOOK_NAME ) -- /bin/sh -c "python3 -m pip install papermill" ; \
497
- if ! $(KUBECTL_BIN ) exec $(FULL_NOTEBOOK_NAME ) -- /bin/sh -c "wget ${NOTEBOOK_REPO_BRANCH_BASE}/jupyter/$(1 ) /$(2 ) -$(3 ) /test/test_notebook.ipynb -O test_notebook.ipynb && python3 -m papermill test_notebook.ipynb $(PREFIX_NAME ) _output.ipynb --kernel python3 --stderr-file $(PREFIX_NAME ) _error.txt" ; then \
498
- echo "ERROR: The $(1 ) $(2 ) notebook encountered a failure. To investigate the issue, you can review the logs located in the ocp-ci cluster on 'artifacts/notebooks-e2e-tests/jupyter-$(1 ) -$(2 ) -$(3 ) -test-e2e' directory or run 'cat $(PREFIX_NAME ) _error.txt' within your container. The make process has been aborted." ; \
499
- exit 1 ; \
500
- fi ; \
501
- if $(KUBECTL_BIN ) exec $(FULL_NOTEBOOK_NAME ) -- /bin/sh -c "cat $(PREFIX_NAME ) _error.txt | grep --quiet FAILED" ; then \
502
- echo "ERROR: The $(1 ) $(2 ) notebook encountered a failure. The make process has been aborted." ; \
503
- $(KUBECTL_BIN ) exec $(FULL_NOTEBOOK_NAME ) -- /bin/sh -c "cat $(PREFIX_NAME ) _error.txt" ; \
504
- exit 1 ; \
495
+ $(eval PREFIX_NAME := $(subst /,-,$(1 ) _$(2 ) ) )
496
+ $(KUBECTL_BIN ) exec $(FULL_NOTEBOOK_NAME ) -- /bin/sh -c "python3 -m pip install papermill"
497
+ if ! $(KUBECTL_BIN ) exec $(FULL_NOTEBOOK_NAME ) -- /bin/sh -c "wget ${NOTEBOOK_REPO_BRANCH_BASE}/jupyter/$(1 ) /$(2 ) -$(3 ) /test/test_notebook.ipynb -O test_notebook.ipynb && python3 -m papermill test_notebook.ipynb $(PREFIX_NAME ) _output.ipynb --kernel python3 --stderr-file $(PREFIX_NAME ) _error.txt" ; then
498
+ echo "ERROR: The $(1 ) $(2 ) notebook encountered a failure. To investigate the issue, you can review the logs located in the ocp-ci cluster on 'artifacts/notebooks-e2e-tests/jupyter-$(1 ) -$(2 ) -$(3 ) -test-e2e' directory or run 'cat $(PREFIX_NAME ) _error.txt' within your container. The make process has been aborted."
499
+ exit 1
500
+ fi
501
+ if $(KUBECTL_BIN ) exec $(FULL_NOTEBOOK_NAME ) -- /bin/sh -c "cat $(PREFIX_NAME ) _error.txt | grep --quiet FAILED" ; then
502
+ echo "ERROR: The $(1 ) $(2 ) notebook encountered a failure. The make process has been aborted."
503
+ $(KUBECTL_BIN ) exec $(FULL_NOTEBOOK_NAME ) -- /bin/sh -c "cat $(PREFIX_NAME ) _error.txt"
504
+ exit 1
505
505
fi
506
506
endef
507
507
@@ -513,32 +513,32 @@ test-%: bin/kubectl
513
513
$(eval PYTHON_VERSION := $(shell echo $* | sed 's/.* -python-//') )
514
514
$(info # Running tests for $(NOTEBOOK_NAME ) notebook...)
515
515
$(KUBECTL_BIN ) wait --for=condition=ready pod -l app=$(NOTEBOOK_NAME ) --timeout=600s
516
- $(KUBECTL_BIN ) port-forward svc/$(NOTEBOOK_NAME ) -notebook 8888:8888 & curl --retry 5 --retry-delay 5 --retry-connrefused http://localhost:8888/notebook/opendatahub/jovyan/api ; EXIT_CODE=$$? ; echo && pkill --full " ^$( KUBECTL_BIN) .*port-forward.*" ; \
516
+ $(KUBECTL_BIN ) port-forward svc/$(NOTEBOOK_NAME ) -notebook 8888:8888 & curl --retry 5 --retry-delay 5 --retry-connrefused http://localhost:8888/notebook/opendatahub/jovyan/api ; EXIT_CODE=$$? ; echo && pkill --full " ^$( KUBECTL_BIN) .*port-forward.*"
517
517
$(eval FULL_NOTEBOOK_NAME = $(shell ($(KUBECTL_BIN ) get pods -l app=$(NOTEBOOK_NAME ) -o custom-columns=":metadata.name" | tr -d '\n') ) )
518
518
519
519
# Tests notebook's functionalities
520
- if echo "$(FULL_NOTEBOOK_NAME)" | grep -q "minimal-ubi9"; then \
521
- $(call test_with_papermill,minimal,ubi9,python-$(PYTHON_VERSION)) \
522
- elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-tensorflow-ubi9"; then \
523
- $(call test_with_papermill,intel/tensorflow,ubi9,python-$(PYTHON_VERSION)) \
524
- elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-pytorch-ubi9"; then \
525
- $(call test_with_papermill,intel/pytorch,ubi9,python-$(PYTHON_VERSION)) \
526
- elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "datascience-ubi9"; then \
527
- $(MAKE) validate-ubi9-datascience PYTHON_VERSION=$(PYTHON_VERSION) -e FULL_NOTEBOOK_NAME=$(FULL_NOTEBOOK_NAME); \
528
- elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "pytorch-ubi9"; then \
529
- $(MAKE) validate-ubi9-datascience PYTHON_VERSION=$(PYTHON_VERSION) -e FULL_NOTEBOOK_NAME=$(FULL_NOTEBOOK_NAME); \
530
- $(call test_with_papermill,pytorch,ubi9,python-$(PYTHON_VERSION)) \
531
- elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "tensorflow-ubi9"; then \
532
- $(MAKE) validate-ubi9-datascience PYTHON_VERSION=$(PYTHON_VERSION) -e FULL_NOTEBOOK_NAME=$(FULL_NOTEBOOK_NAME); \
533
- $(call test_with_papermill,tensorflow,ubi9,python-$(PYTHON_VERSION)) \
534
- elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-ml-ubi9"; then \
535
- $(call test_with_papermill,intel/ml,ubi9,python-$(PYTHON_VERSION)) \
536
- elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "trustyai-ubi9"; then \
537
- $(call test_with_papermill,trustyai,ubi9,python-$(PYTHON_VERSION)) \
538
- elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "anaconda"; then \
539
- echo "There is no test notebook implemented yet for Anaconda Notebook...." \
540
- else \
541
- echo "No matching condition found for $(FULL_NOTEBOOK_NAME)." ; \
520
+ if echo "$(FULL_NOTEBOOK_NAME)" | grep -q "minimal-ubi9"; then
521
+ $(call test_with_papermill,minimal,ubi9,python-$(PYTHON_VERSION))
522
+ elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-tensorflow-ubi9"; then
523
+ $(call test_with_papermill,intel/tensorflow,ubi9,python-$(PYTHON_VERSION))
524
+ elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-pytorch-ubi9"; then
525
+ $(call test_with_papermill,intel/pytorch,ubi9,python-$(PYTHON_VERSION))
526
+ elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "datascience-ubi9"; then
527
+ $(MAKE) validate-ubi9-datascience PYTHON_VERSION=$(PYTHON_VERSION) -e FULL_NOTEBOOK_NAME=$(FULL_NOTEBOOK_NAME)
528
+ elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "pytorch-ubi9"; then
529
+ $(MAKE) validate-ubi9-datascience PYTHON_VERSION=$(PYTHON_VERSION) -e FULL_NOTEBOOK_NAME=$(FULL_NOTEBOOK_NAME)
530
+ $(call test_with_papermill,pytorch,ubi9,python-$(PYTHON_VERSION))
531
+ elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "tensorflow-ubi9"; then
532
+ $(MAKE) validate-ubi9-datascience PYTHON_VERSION=$(PYTHON_VERSION) -e FULL_NOTEBOOK_NAME=$(FULL_NOTEBOOK_NAME)
533
+ $(call test_with_papermill,tensorflow,ubi9,python-$(PYTHON_VERSION))
534
+ elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-ml-ubi9"; then
535
+ $(call test_with_papermill,intel/ml,ubi9,python-$(PYTHON_VERSION))
536
+ elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "trustyai-ubi9"; then
537
+ $(call test_with_papermill,trustyai,ubi9,python-$(PYTHON_VERSION))
538
+ elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "anaconda"; then
539
+ echo "There is no test notebook implemented yet for Anaconda Notebook...."
540
+ else
541
+ echo "No matching condition found for $(FULL_NOTEBOOK_NAME)."
542
542
fi
543
543
544
544
.PHONY : validate-ubi9-datascience
@@ -553,95 +553,95 @@ validate-runtime-image: bin/kubectl
553
553
$(eval NOTEBOOK_NAME := $(subst .,-,$(subst cuda-,,$* ) ) )
554
554
$(info # Running tests for $(NOTEBOOK_NAME ) runtime...)
555
555
$(KUBECTL_BIN ) wait --for=condition=ready pod runtime-pod --timeout=300s
556
- @required_commands=$(REQUIRED_RUNTIME_IMAGE_COMMANDS ) ; \
557
- fail=0 ; \
558
- if [[ $$ image == " " ]] ; then \
559
- echo " Usage: make validate-runtime-image image=<container-image-name>" ; \
560
- exit 1 ; \
561
- fi ; \
562
- for cmd in $$ required_commands ; do \
563
- echo " => Checking container image $$ image for $$ cmd..." ; \
564
- if ! $( KUBECTL_BIN) exec runtime-pod which $$ cmd > /dev/null 2>&1 ; then \
565
- echo " ERROR: Container image $$ image does not meet criteria for command: $$ cmd" ; \
566
- fail=1; \
567
- continue ; \
568
- fi ; \
569
- if [ $$ cmd == " python3" ]; then \
570
- echo " => Checking notebook execution..." ; \
556
+ @required_commands=$(REQUIRED_RUNTIME_IMAGE_COMMANDS )
557
+ fail=0
558
+ if [[ $$ image == " " ]] ; then
559
+ echo " Usage: make validate-runtime-image image=<container-image-name>"
560
+ exit 1
561
+ fi
562
+ for cmd in $$ required_commands ; do
563
+ echo " => Checking container image $$ image for $$ cmd..."
564
+ if ! $( KUBECTL_BIN) exec runtime-pod which $$ cmd > /dev/null 2>&1 ; then
565
+ echo " ERROR: Container image $$ image does not meet criteria for command: $$ cmd"
566
+ fail=1
567
+ continue
568
+ fi
569
+ if [ $$ cmd == " python3" ]; then
570
+ echo " => Checking notebook execution..."
571
571
if ! $( KUBECTL_BIN) exec runtime-pod -- /bin/sh -c " curl https://raw.githubusercontent.com/opendatahub-io/elyra/refs/heads/main/etc/generic/requirements-elyra.txt --output req.txt && \
572
572
python3 -m pip install -r req.txt > /dev/null && \
573
573
curl https://raw.githubusercontent.com/nteract/papermill/main/papermill/tests/notebooks/simple_execute.ipynb --output simple_execute.ipynb && \
574
- python3 -m papermill simple_execute.ipynb output.ipynb > /dev/null" ; then \
575
- echo " ERROR: Image does not meet Python requirements criteria in pipfile" ; \
576
- fail=1; \
577
- fi ; \
578
- fi ; \
579
- done ; \
580
- if [ $$ fail -eq 1 ]; then \
581
- echo " => ERROR: Container image $$ image is not a suitable Elyra runtime image" ; \
582
- exit 1 ; \
583
- else \
584
- echo " => Container image $$ image is a suitable Elyra runtime image" ; \
574
+ python3 -m papermill simple_execute.ipynb output.ipynb > /dev/null" ; then
575
+ echo " ERROR: Image does not meet Python requirements criteria in pipfile"
576
+ fail=1
577
+ fi
578
+ fi
579
+ done
580
+ if [ $$ fail -eq 1 ]; then
581
+ echo " => ERROR: Container image $$ image is not a suitable Elyra runtime image"
582
+ exit 1
583
+ else
584
+ echo " => Container image $$ image is a suitable Elyra runtime image"
585
585
fi ;
586
586
587
587
.PHONY : validate-codeserver-image
588
588
validate-codeserver-image : bin/kubectl
589
589
$(eval NOTEBOOK_NAME := $(subst .,-,$(subst cuda-,,$* ) ) )
590
590
$(info # Running tests for $(NOTEBOOK_NAME ) code-server image...)
591
591
$(KUBECTL_BIN ) wait --for=condition=ready pod codeserver-pod --timeout=300s
592
- @required_commands=$(REQUIRED_CODE_SERVER_IMAGE_COMMANDS ) ; \
593
- if [[ $$ image == " " ]] ; then \
594
- echo " Usage: make validate-codeserver-image image=<container-image-name>" ; \
595
- exit 1 ; \
596
- fi ; \
597
- for cmd in $$ required_commands ; do \
598
- echo " => Checking container image $$ image for $$ cmd..." ; \
599
- if ! $( KUBECTL_BIN) exec codeserver-pod which $$ cmd > /dev/null 2>&1 ; then \
600
- echo " ERROR: Container image $$ image does not meet criteria for command: $$ cmd" ; \
601
- fail=1; \
602
- continue ; \
603
- fi ; \
604
- done ; \
592
+ @required_commands=$(REQUIRED_CODE_SERVER_IMAGE_COMMANDS )
593
+ if [[ $$ image == " " ]] ; then
594
+ echo " Usage: make validate-codeserver-image image=<container-image-name>"
595
+ exit 1
596
+ fi
597
+ for cmd in $$ required_commands ; do
598
+ echo " => Checking container image $$ image for $$ cmd..."
599
+ if ! $( KUBECTL_BIN) exec codeserver-pod which $$ cmd > /dev/null 2>&1 ; then
600
+ echo " ERROR: Container image $$ image does not meet criteria for command: $$ cmd"
601
+ fail=1
602
+ continue
603
+ fi
604
+ done
605
605
606
606
.PHONY : validate-rstudio-image
607
607
validate-rstudio-image : bin/kubectl
608
608
$(eval NOTEBOOK_NAME := $(subst .,-,$(subst cuda-,,$(image ) ) ) )
609
609
$(eval PYTHON_VERSION := $(shell echo $(image ) | sed 's/.* -python-//') )
610
610
$(info # Running tests for $(NOTEBOOK_NAME ) RStudio Server image...)
611
611
$(KUBECTL_BIN ) wait --for=condition=ready pod rstudio-pod --timeout=300s
612
- @required_commands=$(REQUIRED_R_STUDIO_IMAGE_COMMANDS ) ; \
613
- if [[ $$ image == " " ]] ; then \
614
- echo " Usage: make validate-rstudio-image image=<container-image-name>" ; \
615
- exit 1 ; \
616
- fi ; \
617
- echo " => Checking container image $$ image for package installation..." ; \
618
- $(KUBECTL_BIN ) exec -it rstudio-pod -- mkdir -p /opt/app-root/src/R/temp-library > /dev/null 2>&1 ; \
619
- if $( KUBECTL_BIN) exec rstudio-pod -- R -e " install.packages('tinytex', lib='/opt/app-root/src/R/temp-library')" > /dev/null 2>&1 ; then \
620
- echo "Tinytex installation successful!"; \
621
- else \
622
- echo "Error : Tinytex installation failed."; \
623
- fi ; \
624
- for cmd in $$ required_commands ; do \
625
- echo " => Checking container image $$ image for $$ cmd..." ; \
626
- if $( KUBECTL_BIN) exec rstudio-pod which $$ cmd > /dev/null 2>&1 ; then \
627
- echo "$$cmd executed successfully!"; \
628
- else \
629
- echo "ERROR : Container image $$image does not meet criteria for command: $$cmd" ; \
630
- fail=1; \
631
- continue ; \
632
- fi ; \
633
- done ; \
634
- echo " => Fetching R script from URL and executing on the container..." ; \
635
- curl -sSL -o test_script.R " ${NOTEBOOK_REPO_BRANCH_BASE} /rstudio/c9s-python-$( PYTHON_VERSION) /test/test_script.R" > /dev/null 2>&1 ; \
636
- $(KUBECTL_BIN ) cp test_script.R rstudio-pod:/opt/app-root/src/test_script.R > /dev/null 2>&1 ; \
637
- if $( KUBECTL_BIN) exec rstudio-pod -- Rscript /opt/app-root/src/test_script.R > /dev/null 2>&1 ; then \
638
- echo "R script executed successfully!"; \
639
- rm test_script.R ; \
640
- else \
641
- echo "Error : R script failed."; \
642
- fail=1; \
643
- continue ; \
644
- fi ; \
612
+ @required_commands=$(REQUIRED_R_STUDIO_IMAGE_COMMANDS )
613
+ if [[ $$ image == " " ]] ; then
614
+ echo " Usage: make validate-rstudio-image image=<container-image-name>"
615
+ exit 1
616
+ fi
617
+ echo " => Checking container image $$ image for package installation..."
618
+ $(KUBECTL_BIN ) exec -it rstudio-pod -- mkdir -p /opt/app-root/src/R/temp-library > /dev/null 2>&1
619
+ if $( KUBECTL_BIN) exec rstudio-pod -- R -e " install.packages('tinytex', lib='/opt/app-root/src/R/temp-library')" > /dev/null 2>&1 ; then
620
+ echo " Tinytex installation successful!"
621
+ else
622
+ echo " Error: Tinytex installation failed."
623
+ fi
624
+ for cmd in $$ required_commands ; do
625
+ echo " => Checking container image $$ image for $$ cmd..."
626
+ if $( KUBECTL_BIN) exec rstudio-pod which $$ cmd > /dev/null 2>&1 ; then
627
+ echo " $$ cmd executed successfully!"
628
+ else
629
+ echo " ERROR: Container image $$ image does not meet criteria for command: $$ cmd"
630
+ fail=1
631
+ continue
632
+ fi
633
+ done
634
+ echo " => Fetching R script from URL and executing on the container..."
635
+ curl -sSL -o test_script.R " ${NOTEBOOK_REPO_BRANCH_BASE} /rstudio/c9s-python-$( PYTHON_VERSION) /test/test_script.R" > /dev/null 2>&1
636
+ $(KUBECTL_BIN ) cp test_script.R rstudio-pod:/opt/app-root/src/test_script.R > /dev/null 2>&1
637
+ if $( KUBECTL_BIN) exec rstudio-pod -- Rscript /opt/app-root/src/test_script.R > /dev/null 2>&1 ; then
638
+ echo " R script executed successfully!"
639
+ rm test_script.R
640
+ else
641
+ echo " Error: R script failed."
642
+ fail=1
643
+ continue
644
+ fi
645
645
646
646
# This recipe used mainly from the Pipfile.locks Renewal Action
647
647
# Default Python version
@@ -679,26 +679,26 @@ OPT_DIRS := jupyter/intel/ml/ubi9-python-$(PYTHON_VERSION) \
679
679
.PHONY : refresh-pipfilelock-files
680
680
refresh-pipfilelock-files :
681
681
@echo " Updating Pipfile.lock files for Python $( PYTHON_VERSION) "
682
- @if [ " $( INCLUDE_OPT_DIRS) " = " true" ]; then \
683
- echo " Including optional directories" ; \
684
- DIRS=" $( BASE_DIRS) $( OPT_DIRS) " ; \
685
- else \
686
- DIRS=" $( BASE_DIRS) " ; \
687
- fi ; \
688
- for dir in $$ DIRS; do \
689
- echo " Processing directory: $$ dir" ; \
690
- cd $(ROOT_DIR ) ; \
691
- if [ -d " $$ dir" ]; then \
692
- echo " Updating $( PYTHON_VERSION) Pipfile.lock in $$ dir" ; \
693
- cd $$ dir; \
694
- if [ -f " Pipfile" ]; then \
695
- pipenv lock; \
696
- else \
697
- echo " No Pipfile found in $$ dir, skipping." ; \
698
- fi ; \
699
- else \
700
- echo " Skipping $$ dir as it does not exist" ; \
701
- fi ; \
682
+ @if [ " $( INCLUDE_OPT_DIRS) " = " true" ]; then
683
+ echo " Including optional directories"
684
+ DIRS=" $( BASE_DIRS) $( OPT_DIRS) "
685
+ else
686
+ DIRS=" $( BASE_DIRS) "
687
+ fi
688
+ for dir in $$ DIRS; do
689
+ echo " Processing directory: $$ dir"
690
+ cd $(ROOT_DIR )
691
+ if [ -d " $$ dir" ]; then
692
+ echo " Updating $( PYTHON_VERSION) Pipfile.lock in $$ dir"
693
+ cd $$ dir
694
+ if [ -f " Pipfile" ]; then
695
+ pipenv lock
696
+ else
697
+ echo " No Pipfile found in $$ dir, skipping."
698
+ fi
699
+ else
700
+ echo " Skipping $$ dir as it does not exist"
701
+ fi
702
702
done
703
703
704
704
# This is only for the workflow action
0 commit comments