Skip to content

Commit

Permalink
fix spark image build
Browse files Browse the repository at this point in the history
Signed-off-by: Maroun Touma <[email protected]>
  • Loading branch information
touma-I committed Oct 24, 2024
1 parent 0f40c8a commit c446a2e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
21 changes: 18 additions & 3 deletions .make.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/ingest2parquet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 6 additions & 3 deletions transforms/.make.transforms
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c446a2e

Please sign in to comment.