From 00b4146e79a967ce7e080bbd8e47c508f4ecd85b Mon Sep 17 00:00:00 2001 From: zwangsheng <2213335496@qq.com> Date: Wed, 1 Dec 2021 17:06:14 +0800 Subject: [PATCH] [KYUUBI #1478] Docker-image-tool.sh awareness of incorrectly configured SPARK_HOME ### _Why are the changes needed?_ When you use docker-image-tool.sh to help build docker image, you can use a non-existent path as SPARK_HOME.You won't be aware of the problem until Dockerfile does the COPY SPARK_HOME operation. See #1478 ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #1479 from zwangsheng/KYUUBI/1478. Closes #1478 cac129eb [zwangsheng] 1478 Authored-by: zwangsheng <2213335496@qq.com> Signed-off-by: ulysses-you --- bin/docker-image-tool.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/docker-image-tool.sh b/bin/docker-image-tool.sh index 8359c93f6..c28584ce4 100755 --- a/bin/docker-image-tool.sh +++ b/bin/docker-image-tool.sh @@ -119,6 +119,9 @@ function build { if [[ ! -d "$KYUUBI_ROOT/spark-binary" ]]; then mkdir "$KYUUBI_ROOT/spark-binary" fi + if [[ ! -d "$SPARK_HOME" ]]; then + error "Cannot found dir $SPARK_HOME, you must configure SPARK_HOME correct." + fi cp -r "$SPARK_HOME/" "$KYUUBI_ROOT/spark-binary/" # Verify that the Docker image content directory is present