From c446a2eb4371e4328d8f99a1cb5ed83d55e6bb81 Mon Sep 17 00:00:00 2001 From: Maroun Touma Date: Wed, 23 Oct 2024 21:10:32 -0400 Subject: [PATCH] fix spark image build Signed-off-by: Maroun Touma --- .make.defaults | 21 ++++++++++++++++++--- tools/ingest2parquet/Makefile | 2 +- transforms/.make.transforms | 9 ++++++--- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.make.defaults b/.make.defaults index d164cdc7f..3aee29289 100644 --- a/.make.defaults +++ b/.make.defaults @@ -297,8 +297,8 @@ __check_defined = \ # available in the current directory for use by the Dockerfile (i.e. to install the library). # Note that this looks for the ../python directory, which is currently only used in the transform projects, # but we add it here as a convenience to avoid duplicating a lot of this in transforms/.make.transforms. -.PHONY: .defaults.lib-whl-image -.defaults.lib-whl-image:: .default.build-lib-wheel +.PHONY: .defaults.ray-lib-whl-image +.defaults.ray-lib-whl-image:: .default.build-lib-wheel # Must be called with a DOCKER_LOCAL_IMAGE= settings. @# Help: Build the Ray $(DOCKER_LOCAL_IMAGE) using the $(DOCKER_FILE) and library wheel @$(eval LIB_WHEEL_FILE := $(shell find data-processing-dist/*.whl)) @@ -313,7 +313,7 @@ __check_defined = \ # Build the base spark image used by spark-based transforms .PHONY: .defaults.spark-lib-base-image -.defaults.spark-lib-base-image-spark: +.defaults.spark-lib-base-image: $(MAKE) -C $(DPK_SPARK_LIB_DIR) image # Note that this looks for the ../python directory, which is currently only used in the transform projects, @@ -335,6 +335,21 @@ __check_defined = \ # -rm -rf data-processing-lib-spark # -rm -rf python-transform +.PHONY: .defaults.spark-lib-whl-image +.defaults.spark-lib-whl-image:: .default.build-lib-wheel .defaults.spark-lib-base-image +# Must be called with a DOCKER_LOCAL_IMAGE= settings. + @# Help: Build the Ray $(DOCKER_LOCAL_IMAGE) using the $(DOCKER_FILE) and library wheel + $(MAKE) IMAGE_NAME_TO_VERIFY=$(DOCKER_SPARK_BASE_IMAGE_NAME) .defaults.verify-image-availability + @$(eval LIB_WHEEL_FILE := $(shell find data-processing-dist/*.whl)) + $(eval LIB_WHEEL_FILE := $(shell basename $(LIB_WHEEL_FILE))) + if [ -e ../python ]; then \ + $(MAKE) LIB_PATH=../python LIB_NAME=python-transform .defaults.copy-lib; \ + fi + $(MAKE) DOCKER_IMAGE=$(DOCKER_LOCAL_IMAGE) BASE_IMAGE=$(DOCKER_SPARK_BASE_IMAGE) WHEEL_FILE_NAME=$(LIB_WHEEL_FILE) .defaults.image + -rm -rf python-transform + -rm -rf data-processing-dist + + # Install the source from the given directory into an existing venv diff --git a/tools/ingest2parquet/Makefile b/tools/ingest2parquet/Makefile index 888287e4a..47f5a0a31 100644 --- a/tools/ingest2parquet/Makefile +++ b/tools/ingest2parquet/Makefile @@ -16,7 +16,7 @@ test:: venv test-src test-image clean:: .defaults.clean -image:: .defaults.lib-whl-image +image:: .defaults.ray-lib-whl-image test-src:: .defaults.test-src test-local diff --git a/transforms/.make.transforms b/transforms/.make.transforms index d8c4518b1..3d0a4fda5 100644 --- a/transforms/.make.transforms +++ b/transforms/.make.transforms @@ -115,10 +115,10 @@ extra-help: .transforms.python-image:: .defaults.python-lib-whl-image .PHONY: .transforms.ray-image -.transforms.ray-image:: .defaults.lib-whl-image +.transforms.ray-image:: .defaults.ray-lib-whl-image .PHONY: .transforms.spark-image -.transforms.spark-image:: .defaults.lib-whl-image +.transforms.spark-image:: .defaults.spark-lib-whl-image .PHONY: .transforms.python-build .transforms.python-build:: .transforms.python-venv .transforms.python-image @@ -165,7 +165,10 @@ extra-help: .transforms.ray-test-image:: .transforms.ray-image .transforms.test-image-help .defaults.test-image-pytest .transforms.clean .PHONY: .transforms.spark-test-image -.transforms.spark-test-image:: .transforms.spark-image .transforms.test-spark_image-help .defaults.test-image-pytest .transforms.clean +.transforms.spark-test-image:: .transforms.spark-image + $(MAKE) .transforms.test-spark_image-help +# $(MAKE) .defaults.test-image-pytest + $(MAKE) .transforms.clean .PHONY: .transforms.test-image-pytest .transforms.test-image-pytest:: .defaults.test-image-pytest