Skip to content

[SPARK-55115][INFRA] Use composable Dockerfile for release builds - #53905

Closed
cloud-fan wants to merge 3 commits into
apache:masterfrom
cloud-fan:release-infra-master
Closed

[SPARK-55115][INFRA] Use composable Dockerfile for release builds#53905
cloud-fan wants to merge 3 commits into
apache:masterfrom
cloud-fan:release-infra-master

Conversation

@cloud-fan

@cloud-fancloud-fan commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR refactors the release Docker image build process to use a composable Dockerfile approach:

  1. Dockerfile.base: A shared base image containing common tools (Ubuntu 22.04, R packages, Ruby/bundler, TeX, Node.js)
  2. Dockerfile: Branch-specific image that extends the base with Java/Python versions and packages for this branch
  3. do-release-docker.sh: Updated to build the base image first, then the branch-specific image

Why are the changes needed?

Currently, each branch maintains its own full Dockerfile which leads to:

  • Duplicated common configuration across branches
  • Difficulty keeping base tools (R packages, Ruby, etc.) in sync
  • Expired GPG keys or outdated base images affecting all branches

With the composable approach:

  • Common tools are defined once in Dockerfile.base
  • Each branch only specifies its unique Java/Python requirements
  • Updates to base tools can be applied consistently

Version changes

This is a pure refactor. No package versions were changed.

Does this PR introduce any user-facing change?

No. This only affects the release infrastructure.

How was this patch tested?

Docker image built and verified successfully on remote machine.

Was this patch authored or co-authored using generative AI tooling?

Yes

@github-actions

Copy link
Copy Markdown

JIRA Issue Information

=== Improvement SPARK-55115 ===
Summary: Use master branch's Dockerfile for release builds
Assignee: None
Status: Open
Affected: ["4.2.0"]


This comment was automatically generated by GitHub Actions

Comment threaddev/create-release/do-release-docker.sh Outdated
This changes the release Dockerfile to use a composable approach:
- Dockerfile.base: Contains common tools shared across all Spark versions
(Ubuntu 22.04, R packages, Ruby/bundler, TeX, Node.js)
Does NOT include Java or Python - those are branch-specific.
- Dockerfile: Branch-specific configuration that extends the base image
(installs Java, Python, and version-specific pip packages)
For master (4.2-SNAPSHOT):
- Uses Java 17
- Uses Python 3.10
- Installs Sphinx 4.5.0, torch, and related packages for documentation
Comment threaddev/create-release/do-release-docker.sh Outdated
cloud-fanand others added 2 commits January 22, 2026 11:55
The original Dockerfile didn't set JAVA_HOME. The do-release.sh script
has fallback logic that sets JAVA_HOME=/usr which works correctly.
Setting JAVA_HOME in ENV at build time causes architecture mismatch issues.
@cloud-fan

cloud-fan commented Jan 22, 2026

Copy link
Copy Markdown
ContributorAuthor

cc @dongjoon-hyun@HyukjinKwon

I want to use the master-branch base docker image for all active branches, as we can't really "freeze" the docker file in old branches. Things will go stale over time, and it's more stable to use the actively maintained docker file in the master branch. Every time I try to build release from an old branch, the docker environment is always broken. For example, building docker image with branch-3.5 fails now for various issues.

I have PRs for all the active branches, and the base docker file is the same:
#53906
#53907
#53908

I've done tests locally for all of them, for all the release steps (except for uploading). The produced artifacts are also verified.

After these are merged, I'll update the github action release job to always use the master-branch base docker file: #53890

@HyukjinKwonHyukjinKwon changed the title [SPARK-55115][INFRA][MASTER] Use composable Dockerfile for release builds[SPARK-55115][INFRA] Use composable Dockerfile for release buildsJan 22, 2026
@cloud-fan

Copy link
Copy Markdown
ContributorAuthor

This is release infra change and CI failures is unrelated, thanks for review, merging to master!

dongjoon-hyun added a commit that referenced this pull request Jun 30, 2026
### What changes were proposed in this pull request?
This PR uses `Python 3.11` instead of 3.10 in `dev/create-release/spark-rm/Dockerfile` for Apache Spark 4.3.0+.
### Why are the changes needed?
Since `Python 3.10` reaches end-of-life in October 2026 before Apache Spark 4.3.0 release, Apache Spark 3.4.0 dropped it.
- #55914
So, ideally, we need to use Python 3.11+ in the release script. However, recently, on 2026-01-23, we share `Dockerfile.base` for all maintenance releases and `ubuntu:jammy` has only `Python 3.11.0rc1`. Since `Python 3.11.0rc1` is better than the EOL `Python 3.10`, this PR upgrades it only for Spark release.
- #53905https://github.com/apache/spark/blob/e28edaf0480e19abca83cd2b215450b85fdaf438/dev/create-release/spark-rm/Dockerfile.base#L30
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Manual review.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.8
Closes#56885 from dongjoon-hyun/SPARK-57771.
Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun added a commit that referenced this pull request Jun 30, 2026
### What changes were proposed in this pull request?
This PR uses `Python 3.11` instead of 3.10 in `dev/create-release/spark-rm/Dockerfile` for Apache Spark 4.3.0+.
### Why are the changes needed?
Since `Python 3.10` reaches end-of-life in October 2026 before Apache Spark 4.3.0 release, Apache Spark 3.4.0 dropped it.
- #55914
So, ideally, we need to use Python 3.11+ in the release script. However, recently, on 2026-01-23, we share `Dockerfile.base` for all maintenance releases and `ubuntu:jammy` has only `Python 3.11.0rc1`. Since `Python 3.11.0rc1` is better than the EOL `Python 3.10`, this PR upgrades it only for Spark release.
- #53905https://github.com/apache/spark/blob/e28edaf0480e19abca83cd2b215450b85fdaf438/dev/create-release/spark-rm/Dockerfile.base#L30
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Manual review.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.8
Closes#56885 from dongjoon-hyun/SPARK-57771.
Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit a57c537)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@cloud-fan@HyukjinKwon