62
62
CONTAINER_ENGINE := podman
63
63
endif
64
64
65
- # Build function for the notebok image:
65
+ # Build function for the notebook image:
66
66
# ARG 1: Image tag name.
67
- # ARG 2: Path of image context we want to build.
68
- # ARG 3: Base image tag name (optional).
67
+ # ARG 2: Path of container engine build context.
68
+ # ARG 3: Path of image context we want to build.
69
+ # ARG 4: Base image tag name (optional).
69
70
define build_image
70
71
$(eval IMAGE_NAME := $(IMAGE_REGISTRY ) :$(1 ) -$(IMAGE_TAG ) )
71
72
$(info # Building $(IMAGE_NAME ) image...)
72
73
$(if $(3 ) ,
73
- $(eval BASE_IMAGE_NAME := $(IMAGE_REGISTRY ) :$(3 ) -$(IMAGE_TAG ) )
74
+ $(eval BASE_IMAGE_NAME := $(IMAGE_REGISTRY ) :$(4 ) -$(IMAGE_TAG ) )
74
75
$(eval BUILD_ARGS := --build-arg BASE_IMAGE=$(BASE_IMAGE_NAME ) ) ,
75
76
$(eval BUILD_ARGS :=)
76
77
)
77
- $(ROOT_DIR ) /scripts/sandbox.py --dockerfile '$(2 ) /Dockerfile' -- \
78
- $(CONTAINER_ENGINE ) build $(CONTAINER_BUILD_CACHE_ARGS ) --tag $(IMAGE_NAME ) --file '$(2 ) /Dockerfile' $(BUILD_ARGS ) {}\;
78
+ $(ROOT_DIR ) /scripts/sandbox.py --dockerfile '$(2 ) /$( 3 ) / Dockerfile' --build-context ' $( 2 ) ' -- \
79
+ $(CONTAINER_ENGINE ) build $(CONTAINER_BUILD_CACHE_ARGS ) --tag $(IMAGE_NAME ) --file '$(2 ) /$( 3 ) / Dockerfile' $(BUILD_ARGS ) {}\;
79
80
endef
80
81
81
- # Push function for the notebok image:
82
+ # Push function for the notebook image:
82
83
# ARG 1: Path of image context we want to build.
83
84
define push_image
84
85
$(eval IMAGE_NAME := $(IMAGE_REGISTRY ) :$(subst /,-,$(1 ) ) -$(IMAGE_TAG ) )
@@ -94,10 +95,10 @@ endef
94
95
# BUILD_DEPENDENT_IMAGES: only build images that were explicitly given as a goal on command line
95
96
# PUSH_IMAGES: allows skipping podman push
96
97
define image
97
- $(info #* # Image build directory: <$(2 ) > #(MACHINE-PARSED LINE) # *#...)
98
+ $(info #* # Image build directory: <$(RELEASE ) / $( 2 ) > #(MACHINE-PARSED LINE) # *#...)
98
99
99
100
$(if $(or $(BUILD_DEPENDENT_IMAGES:no= ) , $(filter $@ ,$(MAKECMDGOALS ) ) ) ,
100
- $(call build_image,$(1 ) ,$(2 ) ,$(3 ) )
101
+ $(call build_image,$(1 ) ,$(RELEASE ) , $( 2 ) ,$(3 ) )
101
102
102
103
$(if $(PUSH_IMAGES:no= ) ,
103
104
$(call push_image,$(1 ) )
@@ -269,7 +270,7 @@ endif
269
270
deploy9-% : bin/kubectl bin/yq
270
271
$(eval TARGET := $(shell echo $* | sed 's/-ubi9-python.* //') )
271
272
$(eval PYTHON_VERSION := $(shell echo $* | sed 's/.* -python-//') )
272
- $(eval NOTEBOOK_DIR := $(subst -,/,$(subst cuda-,,$(TARGET ) ) ) /ubi9-python-$(PYTHON_VERSION ) /kustomize/base)
273
+ $(eval NOTEBOOK_DIR := $(RELEASE ) / $( subst -,/,$(subst cuda-,,$(TARGET ) ) ) /ubi9-python-$(PYTHON_VERSION ) /kustomize/base)
273
274
ifndef NOTEBOOK_TAG
274
275
$(eval NOTEBOOK_TAG := $*-$(IMAGE_TAG))
275
276
endif
@@ -290,7 +291,7 @@ undeploy9-%: bin/kubectl
290
291
deploy-c9s-% : bin/kubectl bin/yq
291
292
$(eval TARGET := $(shell echo $* | sed 's/-c9s-python.* //') )
292
293
$(eval PYTHON_VERSION := $(shell echo $* | sed 's/.* -python-//') )
293
- $(eval NOTEBOOK_DIR := $(subst -,/,$(subst cuda-,,$(TARGET ) ) ) /c9s-python-$(PYTHON_VERSION ) /kustomize/base)
294
+ $(eval NOTEBOOK_DIR := $(RELEASE ) / $( subst -,/,$(subst cuda-,,$(TARGET ) ) ) /c9s-python-$(PYTHON_VERSION ) /kustomize/base)
294
295
ifndef NOTEBOOK_TAG
295
296
$(eval NOTEBOOK_TAG := $*-$(IMAGE_TAG))
296
297
endif
@@ -311,7 +312,7 @@ undeploy-c9s-%: bin/kubectl
311
312
.PHONY : test
312
313
test-% : bin/kubectl
313
314
$(info # Running tests for $* notebook...)
314
- @./scripts/test_jupyter_with_papermill.sh $*
315
+ @./scripts/test_jupyter_with_papermill.sh $( RELEASE ) $ *
315
316
316
317
# Validate that runtime image meets minimum criteria
317
318
# This validation is created from subset of https://github.com/elyra-ai/elyra/blob/9c417d2adc9d9f972de5f98fd37f6945e0357ab9/Makefile#L325
0 commit comments