Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-37319][K8S] Support K8s image building with Java 17 #34586

Closed
wants to merge 2 commits into from
Closed

[SPARK-37319][K8S] Support K8s image building with Java 17 #34586

wants to merge 2 commits into from

Conversation

dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Nov 14, 2021

What changes were proposed in this pull request?

This PR aims to support K8s image building with Java 17.
Please note that we need more efforts to achieve to run all tests successfully.

Why are the changes needed?

OpenJDK docker hub image switches the underlying OS from Debian to OracleLinux since Java 12.
So, java_image_tag doesn't work any longer.

BEFORE

$ bin/docker-image-tool.sh -n -b java_image_tag=17 build
[+] Building 0.8s (6/17)
 => [internal] load build definition from Dockerfile                                                                                                 0.0s
 => => transferring dockerfile: 37B                                                                                                                  0.0s
 => [internal] load .dockerignore                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/openjdk:17                                                                                        0.4s
 => CACHED [ 1/13] FROM docker.io/library/openjdk:17@sha256:c7fffc2024948e6d75922025a17b7d81cb747fd0fe0167fef13c6fcfc72e4144                         0.0s
 => [internal] load build context                                                                                                                    0.1s
 => => transferring context: 69.25kB                                                                                                                 0.0s
 => ERROR [ 2/13] RUN set -ex &&     sed -i 's/http:\/\/deb.\(.*\)/https:\/\/deb.\1/g' /etc/apt/sources.list &&     apt-get update &&     ln -s /li  0.2s
------
 > [ 2/13] RUN set -ex &&     sed -i 's/http:\/\/deb.\(.*\)/https:\/\/deb.\1/g' /etc/apt/sources.list &&     apt-get update &&     ln -s /lib /lib64 &&     apt install -y bash tini libc6 libpam-modules krb5-user libnss3 procps &&     mkdir -p /opt/spark &&     mkdir -p /opt/spark/examples &&     mkdir -p /opt/spark/work-dir &&     touch /opt/spark/RELEASE &&     rm /bin/sh &&     ln -sv /bin/bash /bin/sh &&     echo "auth required pam_wheel.so use_uid" >> /etc/pam.d/su &&     chgrp root /etc/passwd && chmod ug+rw /etc/passwd &&     rm -rf /var/cache/apt/*:
#5 0.230 + sed -i 's/http:\/\/deb.\(.*\)/https:\/\/deb.\1/g' /etc/apt/sources.list
#5 0.232 sed: can't read /etc/apt/sources.list: No such file or directory
------
executor failed running [/bin/sh -c set -ex &&     sed -i 's/http:\/\/deb.\(.*\)/https:\/\/deb.\1/g' /etc/apt/sources.list &&     apt-get update &&     ln -s /lib /lib64 &&     apt install -y bash tini libc6 libpam-modules krb5-user libnss3 procps &&     mkdir -p /opt/spark &&     mkdir -p /opt/spark/examples &&     mkdir -p /opt/spark/work-dir &&     touch /opt/spark/RELEASE &&     rm /bin/sh &&     ln -sv /bin/bash /bin/sh &&     echo "auth required pam_wheel.so use_uid" >> /etc/pam.d/su &&     chgrp root /etc/passwd && chmod ug+rw /etc/passwd &&     rm -rf /var/cache/apt/*]: exit code: 2
Failed to build Spark JVM Docker image, please refer to Docker build output for details.

AFTER (This PR with -f option)

$ bin/docker-image-tool.sh -n -f kubernetes/dockerfiles/spark/Dockerfile.java17 build
[+] Building 29.3s (19/19) FINISHED
 => [internal] load build definition from Dockerfile.java17                                                                                          0.0s
 => => transferring dockerfile: 2.49kB                                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/debian:bullseye-slim                                                                              1.5s
 => [auth] library/debian:pull token for registry-1.docker.io                                                                                        0.0s
 => [internal] load build context                                                                                                                    0.1s
 => => transferring context: 80.54kB                                                                                                                 0.0s
 => CACHED [ 1/13] FROM docker.io/library/debian:bullseye-slim@sha256:dddc0f5f01db7ca3599fd8cf9821ffc4d09ec9d7d15e49019e73228ac1eee7f9               0.0s
 => [ 2/13] RUN set -ex &&     apt-get update &&     ln -s /lib /lib64 &&     apt install -y bash tini libc6 libpam-modules krb5-user libnss3 proc  25.5s
 => [ 3/13] COPY jars /opt/spark/jars                                                                                                                0.4s
 => [ 4/13] COPY bin /opt/spark/bin                                                                                                                  0.0s
 => [ 5/13] COPY sbin /opt/spark/sbin                                                                                                                0.0s
 => [ 6/13] COPY kubernetes/dockerfiles/spark/entrypoint.sh /opt/                                                                                    0.0s
 => [ 7/13] COPY kubernetes/dockerfiles/spark/decom.sh /opt/                                                                                         0.0s
 => [ 8/13] COPY examples /opt/spark/examples                                                                                                        0.0s
 => [ 9/13] COPY kubernetes/tests /opt/spark/tests                                                                                                   0.0s
 => [10/13] COPY data /opt/spark/data                                                                                                                0.0s
 => [11/13] WORKDIR /opt/spark/work-dir                                                                                                              0.0s
 => [12/13] RUN chmod g+w /opt/spark/work-dir                                                                                                        0.2s
 => [13/13] RUN chmod a+x /opt/decom.sh                                                                                                              0.2s
 => exporting to image                                                                                                                               1.3s
 => => exporting layers                                                                                                                              1.3s
 => => writing image sha256:ec961d957826c9b7eb4d00e900262130fc1708aef6cb51298b627d4bc91f834b                                                         0.0s
 => => naming to docker.io/library/spark                                                                                                             0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them

Does this PR introduce any user-facing change?

Yes, this is a new docker file exposed to the customer.

How was this patch tested?

Pass the K8s IT building.

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-XXX][K8S] Support K8s image building with Java 17 [SPARK-37319][K8S] Support K8s image building with Java 17 Nov 14, 2021
@SparkQA
Copy link

SparkQA commented Nov 14, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49670/

@SparkQA
Copy link

SparkQA commented Nov 14, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49670/

@SparkQA
Copy link

SparkQA commented Nov 14, 2021

Test build #145201 has finished for PR 34586 at commit f70024f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member Author

The building succeeded but it seems that Jenkins is building with a direct command.

@dongjoon-hyun dongjoon-hyun marked this pull request as ready for review November 14, 2021 08:59
@SparkQA
Copy link

SparkQA commented Nov 14, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49675/

@SparkQA
Copy link

SparkQA commented Nov 14, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49675/

@SparkQA
Copy link

SparkQA commented Nov 14, 2021

Test build #145206 has finished for PR 34586 at commit 8ffa233.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member Author

Could you review this, @sarutak ?

@dongjoon-hyun
Copy link
Member Author

Could you review this, @viirya ?

@sarutak
Copy link
Member

sarutak commented Nov 15, 2021

Merging to master. Thank you @dongjoon-hyun @viirya and @HyukjinKwon !

@sarutak sarutak closed this in bb9e1d9 Nov 15, 2021
@dongjoon-hyun
Copy link
Member Author

Thank you, @viirya , @HyukjinKwon , @sarutak !

@dongjoon-hyun dongjoon-hyun deleted the SPARK-37319 branch November 15, 2021 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants