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/15 15:37:36 UTC

(spark) branch master updated: [SPARK-49243][INFRA][K8S] Add `OpenContainers` Annotations in docker images

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 470e3f948123 [SPARK-49243][INFRA][K8S] Add `OpenContainers` Annotations in docker images
470e3f948123 is described below

commit 470e3f9481231559199dd2bf2046539be2e7d287
Author: Dongjoon Hyun <dh...@apple.com>
AuthorDate: Thu Aug 15 08:37:26 2024 -0700

    [SPARK-49243][INFRA][K8S] Add `OpenContainers` Annotations in docker images
    
    ### What changes were proposed in this pull request?
    
    This PR aims to add `OpenContainers` Annotations to docker image to add metadata like `Apache License`.
    
    - https://specs.opencontainers.org/image-spec/annotations/
    
    ### Why are the changes needed?
    
    **BEFORE**
    ```
    $ docker inspect apache/spark:3.5.2 | jq '.[0].Config.Labels'
    {
      "org.opencontainers.image.ref.name": "ubuntu",
      "org.opencontainers.image.version": "20.04"
    }
    ```
    
    **AFTER**
    
    ```
    $ NO_MANUAL=1 ./dev/make-distribution.sh -Pkubernetes
    $ bin/docker-image-tool.sh -t SPARK-49243 -n build
    $ docker inspect spark:SPARK-49243 | jq '.[0].Config.Labels'
    {
      "org.opencontainers.image.authors": "Apache Spark project <devspark.apache.org>",
      "org.opencontainers.image.licenses": "Apache-2.0",
      "org.opencontainers.image.ref.name": "Apache Spark Scala/Java Image",
      "org.opencontainers.image.version": ""
    }
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    
    No, it's only a metadata change.
    
    ### How was this patch tested?
    
    Manual review.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #47766 from dongjoon-hyun/SPARK-49243.
    
    Authored-by: Dongjoon Hyun <dh...@apple.com>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 dev/create-release/spark-rm/Dockerfile                               | 5 +++++
 dev/infra/Dockerfile                                                 | 5 +++++
 .../kubernetes/docker/src/main/dockerfiles/spark/Dockerfile          | 5 +++++
 .../docker/src/main/dockerfiles/spark/bindings/R/Dockerfile          | 5 +++++
 .../docker/src/main/dockerfiles/spark/bindings/python/Dockerfile     | 5 +++++
 5 files changed, 25 insertions(+)

diff --git a/dev/create-release/spark-rm/Dockerfile b/dev/create-release/spark-rm/Dockerfile
index ca9e10bebfc5..e86b91968bf8 100644
--- a/dev/create-release/spark-rm/Dockerfile
+++ b/dev/create-release/spark-rm/Dockerfile
@@ -17,6 +17,11 @@
 
 # Image for building Spark releases. Based on Ubuntu 22.04.
 FROM ubuntu:jammy-20240227
+LABEL org.opencontainers.image.authors="Apache Spark project <de...@spark.apache.org>"
+LABEL org.opencontainers.image.licenses="Apache-2.0"
+LABEL org.opencontainers.image.ref.name="Apache Spark Release Manager Image"
+# Overwrite this label to avoid exposing the underlying Ubuntu OS version label
+LABEL org.opencontainers.image.version=""
 
 ENV FULL_REFRESH_DATE 20240318
 
diff --git a/dev/infra/Dockerfile b/dev/infra/Dockerfile
index 6ba9be87552a..b01e3c50e28d 100644
--- a/dev/infra/Dockerfile
+++ b/dev/infra/Dockerfile
@@ -18,6 +18,11 @@
 # Image for building and testing Spark branches. Based on Ubuntu 22.04.
 # See also in https://hub.docker.com/_/ubuntu
 FROM ubuntu:jammy-20240227
+LABEL org.opencontainers.image.authors="Apache Spark project <de...@spark.apache.org>"
+LABEL org.opencontainers.image.licenses="Apache-2.0"
+LABEL org.opencontainers.image.ref.name="Apache Spark Infra Image"
+# Overwrite this label to avoid exposing the underlying Ubuntu OS version label
+LABEL org.opencontainers.image.version=""
 
 ENV FULL_REFRESH_DATE 20240318
 
diff --git a/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/Dockerfile b/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/Dockerfile
index 8693561f8e56..731dc91fc373 100644
--- a/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/Dockerfile
+++ b/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/Dockerfile
@@ -17,6 +17,11 @@
 ARG java_image_tag=21
 
 FROM azul/zulu-openjdk:${java_image_tag}
+LABEL org.opencontainers.image.authors="Apache Spark project <de...@spark.apache.org>"
+LABEL org.opencontainers.image.licenses="Apache-2.0"
+LABEL org.opencontainers.image.ref.name="Apache Spark Scala/Java Image"
+# Overwrite this label to avoid exposing the underlying Ubuntu OS version label
+LABEL org.opencontainers.image.version=""
 
 ARG spark_uid=185
 
diff --git a/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/bindings/R/Dockerfile b/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/bindings/R/Dockerfile
index 2f23c45f1c30..64e66288b838 100644
--- a/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/bindings/R/Dockerfile
+++ b/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/bindings/R/Dockerfile
@@ -18,6 +18,11 @@
 ARG base_img
 
 FROM ${base_img:-spark}
+LABEL org.opencontainers.image.authors="Apache Spark project <de...@spark.apache.org>"
+LABEL org.opencontainers.image.licenses="Apache-2.0"
+LABEL org.opencontainers.image.ref.name="Apache Spark R Image"
+# Overwrite this label to avoid exposing the underlying Ubuntu OS version label
+LABEL org.opencontainers.image.version=""
 WORKDIR /
 
 # Reset to root to run installation tasks
diff --git a/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/bindings/python/Dockerfile b/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/bindings/python/Dockerfile
index 16ea46075d43..14ee735d0333 100644
--- a/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/bindings/python/Dockerfile
+++ b/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/bindings/python/Dockerfile
@@ -18,6 +18,11 @@
 ARG base_img
 
 FROM ${base_img:-spark}
+LABEL org.opencontainers.image.authors="Apache Spark project <de...@spark.apache.org>"
+LABEL org.opencontainers.image.licenses="Apache-2.0"
+LABEL org.opencontainers.image.ref.name="Apache Spark Python Image"
+# Overwrite this label to avoid exposing the underlying Ubuntu OS version label
+LABEL org.opencontainers.image.version=""
 WORKDIR /
 
 # Reset to root to run installation tasks


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org