You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2024/08/19 20:31:26 UTC
(spark-kubernetes-operator) branch main updated: [SPARK-49305] Revise `Spark Operator` docker image
This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 8edb032 [SPARK-49305] Revise `Spark Operator` docker image
8edb032 is described below
commit 8edb032b83f212fb43dc1d52e1c27459dd2f076e
Author: Dongjoon Hyun <do...@apache.org>
AuthorDate: Mon Aug 19 13:31:18 2024 -0700
[SPARK-49305] Revise `Spark Operator` docker image
### What changes were proposed in this pull request?
This PR aims to revise `Spark Operator` docker image.
### Why are the changes needed?
- Environment Variables.
- Remove `APP_VERSION` because image tag and metadata contain the version information already.
- Rename `OPERATOR_JAR` to `SPARK_OPERATOR_JAR` like `SPARK_OPERATOR_HOME` and `SPARK_OPERATOR_WORK_DIR`.
- Remove version string from jar name to simplify.
**BEFORE**
```
$ docker run -it --rm spark-kubernetes-operator:0.1.0-SNAPSHOT ls -al | tail -n1
-rw-r--r-- 1 spark spark 154955452 Aug 19 19:29 spark-kubernetes-operator-0.1.0-SNAPSHOT-all.jar
```
**AFTER**
```
$ docker run -it --rm spark-kubernetes-operator:0.1.0-SNAPSHOT ls -al | tail -n1
-rw-r--r-- 1 spark spark 154955452 Aug 19 19:18 spark-kubernetes-operator.jar
```
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #70 from dongjoon-hyun/SPARK-49305.
Authored-by: Dongjoon Hyun <do...@apache.org>
Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
build-tools/docker/Dockerfile | 5 ++---
build-tools/docker/docker-entrypoint.sh | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/build-tools/docker/Dockerfile b/build-tools/docker/Dockerfile
index c3f851a..fd0a7b7 100644
--- a/build-tools/docker/Dockerfile
+++ b/build-tools/docker/Dockerfile
@@ -30,15 +30,14 @@ LABEL org.opencontainers.image.version="${APP_VERSION}"
ENV SPARK_OPERATOR_HOME=/opt/spark-operator
ENV SPARK_OPERATOR_WORK_DIR=/opt/spark-operator/operator
-ENV APP_VERSION=$APP_VERSION
-ENV OPERATOR_JAR=spark-kubernetes-operator-$APP_VERSION-all.jar
+ENV SPARK_OPERATOR_JAR=spark-kubernetes-operator.jar
WORKDIR $SPARK_OPERATOR_WORK_DIR
RUN groupadd --system --gid=$SPARK_UID spark && \
useradd --system --home-dir $SPARK_OPERATOR_HOME --uid=$SPARK_UID --gid=spark spark && \
chown -R spark:spark $SPARK_OPERATOR_HOME
-COPY --from=builder --chown=spark:spark /app/spark-operator/build/libs/$OPERATOR_JAR .
+COPY --from=builder --chown=spark:spark /app/spark-operator/build/libs/spark-kubernetes-operator-$APP_VERSION-all.jar $SPARK_OPERATOR_JAR
COPY --from=builder --chown=spark:spark /app/build-tools/docker/docker-entrypoint.sh .
diff --git a/build-tools/docker/docker-entrypoint.sh b/build-tools/docker/docker-entrypoint.sh
index 7552ee8..1397996 100755
--- a/build-tools/docker/docker-entrypoint.sh
+++ b/build-tools/docker/docker-entrypoint.sh
@@ -26,7 +26,7 @@ if [ "$1" = "help" ]; then
elif [ "$1" = "operator" ]; then
echo "Starting Operator..."
- exec java -cp "./$OPERATOR_JAR" "$LOG_CONFIG" "$OPERATOR_JAVA_OPTS" org.apache.spark.k8s.operator.SparkOperator
+ exec java -cp "./$SPARK_OPERATOR_JAR" "$LOG_CONFIG" "$OPERATOR_JAVA_OPTS" org.apache.spark.k8s.operator.SparkOperator
fi
args=("${args[@]}")
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org