Skip to content

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

Closed
cloud-fan wants to merge 3 commits into
apache:branch-4.1from
cloud-fan:release-infra-4.1
Closed

[SPARK-55115][INFRA][4.1] Use composable Dockerfile for release builds#53906
cloud-fan wants to merge 3 commits into
apache:branch-4.1from
cloud-fan:release-infra-4.1

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 branch-4.1:
- 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:54
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 23, 2026

Copy link
Copy Markdown
ContributorAuthor

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

cloud-fan added a commit that referenced this pull request Jan 23, 2026
### 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
Closes#53906 from cloud-fan/release-infra-4.1.
Lead-authored-by: Wenchen Fan <wenchen@databricks.com>
Co-authored-by: Wenchen Fan <cloud0fan@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
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