Skip to content

Commit a421ee7

Browse files
committed
RHOAIENG-19043: chore(tests): fix 2024b ci builds after repo restructuring
1 parent cea9eb4 commit a421ee7

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ define build_image
7474
$(eval BUILD_ARGS := --build-arg BASE_IMAGE=$(BASE_IMAGE_NAME)),
7575
$(eval BUILD_ARGS :=)
7676
)
77-
$(ROOT_DIR)/scripts/sandbox.py --dockerfile '$(2)/Dockerfile' -- \
77+
$(ROOT_DIR)/scripts/sandbox.py --dockerfile '$(2)/Dockerfile' --build-context '$(RELEASE)' -- \
7878
$(CONTAINER_ENGINE) build $(CONTAINER_BUILD_CACHE_ARGS) --tag $(IMAGE_NAME) --file '$(2)/Dockerfile' $(BUILD_ARGS) {}\;
7979
endef
8080

@@ -94,10 +94,10 @@ endef
9494
# BUILD_DEPENDENT_IMAGES: only build images that were explicitly given as a goal on command line
9595
# PUSH_IMAGES: allows skipping podman push
9696
define image
97-
$(info #*# Image build directory: <$(2)> #(MACHINE-PARSED LINE)#*#...)
97+
$(info #*# Image build directory: <$(RELEASE)/$(2)> #(MACHINE-PARSED LINE)#*#...)
9898

9999
$(if $(or $(BUILD_DEPENDENT_IMAGES:no=), $(filter $@,$(MAKECMDGOALS))),
100-
$(call build_image,$(1),$(2),$(3))
100+
$(call build_image,$(1),$(RELEASE)/$(2),$(3))
101101
102102
$(if $(PUSH_IMAGES:no=),
103103
$(call push_image,$(1))
@@ -269,7 +269,7 @@ endif
269269
deploy9-%: bin/kubectl bin/yq
270270
$(eval TARGET := $(shell echo $* | sed 's/-ubi9-python.*//'))
271271
$(eval PYTHON_VERSION := $(shell echo $* | sed 's/.*-python-//'))
272-
$(eval NOTEBOOK_DIR := $(subst -,/,$(subst cuda-,,$(TARGET)))/ubi9-python-$(PYTHON_VERSION)/kustomize/base)
272+
$(eval NOTEBOOK_DIR := $(RELEASE)/$(subst -,/,$(subst cuda-,,$(TARGET)))/ubi9-python-$(PYTHON_VERSION)/kustomize/base)
273273
ifndef NOTEBOOK_TAG
274274
$(eval NOTEBOOK_TAG := $*-$(IMAGE_TAG))
275275
endif
@@ -311,7 +311,7 @@ undeploy-c9s-%: bin/kubectl
311311
.PHONY: test
312312
test-%: bin/kubectl
313313
$(info # Running tests for $* notebook...)
314-
@./scripts/test_jupyter_with_papermill.sh $*
314+
@./scripts/test_jupyter_with_papermill.sh $(RELEASE) $*
315315

316316
# Validate that runtime image meets minimum criteria
317317
# This validation is created from subset of https://github.com/elyra-ai/elyra/blob/9c417d2adc9d9f972de5f98fd37f6945e0357ab9/Makefile#L325

ci/cached-builds/gen_gha_matrix_jobs.py

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import argparse
24
import itertools
35
import json

scripts/sandbox.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919

2020
class Args(argparse.Namespace):
2121
dockerfile: pathlib.Path
22+
build_context: pathlib.Path
2223
remaining: list[str]
2324

2425

2526
def main() -> int:
2627
p = argparse.ArgumentParser(allow_abbrev=False)
2728
p.add_argument("--dockerfile", type=pathlib.Path, required=True)
29+
p.add_argument("--build-context", type=pathlib.Path, required=True)
2830
p.add_argument('remaining', nargs=argparse.REMAINDER)
2931

3032
args = cast(Args, p.parse_args())
@@ -42,12 +44,12 @@ def main() -> int:
4244
subprocess.check_call([MAKE, "bin/buildinputs"], cwd=ROOT_DIR)
4345
stdout = subprocess.check_output([ROOT_DIR / "bin/buildinputs", str(args.dockerfile)],
4446
text=True, cwd=ROOT_DIR)
45-
prereqs = [pathlib.Path(file) for file in json.loads(stdout)] if stdout != "\n" else []
47+
prereqs = [args.build_context / pathlib.Path(file) for file in json.loads(stdout)] if stdout != "\n" else []
4648
print(f"{prereqs=}")
4749

4850
with tempfile.TemporaryDirectory(delete=True) as tmpdir:
4951
setup_sandbox(prereqs, pathlib.Path(tmpdir))
50-
command = [arg if arg != "{};" else tmpdir for arg in args.remaining[1:]]
52+
command = [arg if arg != "{};" else tmpdir / args.build_context for arg in args.remaining[1:]]
5153
print(f"running {command=}")
5254
try:
5355
subprocess.check_call(command)

scripts/test_jupyter_with_papermill.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,20 @@ function _get_accelerator_flavor()
9999
# Returns the absolute path of notebook resources in the notebooks/ repo based on the notebook name
100100
#
101101
# Arguments:
102-
# $1 : Name of the notebook identifier
103-
# $2 : [optional] Subdirectory to append to computed absolute path
102+
# $1 : Release to test (2024a, 2024n, ...)
103+
# $2 : Name of the notebook identifier
104+
# $3 : [optional] Subdirectory to append to computed absolute path
104105
# - path should NOT start with a leading /
105106
#
106107
# Returns:
107108
# Absolute path to the jupyter notebook directory for the given notebook test target
108109
function _get_jupyter_notebook_directory()
109110
{
110-
local notebook_id="${1:-}"
111-
local subpath="${2:-}"
111+
local release="${1:-}"
112+
local notebook_id="${2:-}"
113+
local subpath="${3:-}"
112114

113-
local jupyter_base="${root_repo_directory}/jupyter"
115+
local jupyter_base="${root_repo_directory}/${release}/jupyter"
114116
local directory="${jupyter_base}/${notebook_id}/${os_flavor}-${python_flavor}${subpath:+"/$subpath"}"
115117

116118
printf '%s' "${directory}"

0 commit comments

Comments
 (0)