Skip to content

[Feature] Add Spark 4 platform images - #314

Merged
royischoss merged 5 commits into
mlrun:developmentfrom
gtopper:feature/ML-13080-isolated-spark4-images
Sep 23, 2026
Merged

royischoss merged 5 commits into
mlrun:developmentfrom
gtopper:feature/ML-13080-isolated-spark4-images

Conversation

@gtopper

@gtopper gtopper commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

📝 Description

Adds Spark 4.2.0 CPU and CUDA application images for ML-13080 without changing the existing Spark 3 recipes or configured defaults.

Both variants use centrally pinned upstream images, Spark 4.2.0, Scala 2.13, Hadoop 3.5.0, Temurin 25.0.4+7, and Python 3.11, with validation for runtime metadata and CPU/CUDA parity.


🛠️ Changes Made

  • Added docker/spark/Dockerfile.spark4 for the linux/amd64 CPU image.
  • Added docker/spark/Dockerfile.spark4.cuda for the linux/amd64 CUDA image without downloading Spark or Java again.
  • Centralized the Spark and CUDA base-image digests in docker/spark/Makefile.
  • Added docker/spark/scripts/ce-customize-spark4.sh for Python 3.11, manifest-driven connector installation, and a writable /home/spark.
  • Added the eight connector artifacts listed in docker/spark/scripts/jars-4.2.0.txt to both images.
  • Added docker/spark/scripts/validate-spark4.sh for Spark, Scala, Java, Hadoop, Python, connector inventory, architecture, locale, ownership, entrypoint, CUDA, cuDNN, and NVIDIA metadata validation.
  • Added docker/spark/scripts/jar-parity.sh to compare every CPU and CUDA Spark JAR by SHA-256.
  • Added docker/spark/scripts/env-parity.sh to enforce shared runtime metadata while allowing documented CUDA-specific and build-provenance differences.
  • Added independent Spark 4 build and validation targets to docker/spark/Makefile.
  • Documented Spark 4 build, local validation, deferred provider testing, MLRun and mlefi selection, manual publication, and evidence capture in docker/spark/README.md.

✅ Checklist

  • I have tested the changes in this PR
  • I confirmed whether my changes require a change in documentation and if so, I created another PR in MLRun for the relevant documentation.
  • I confirmed whether my changes require a changes in QA tests, for example: credentials changes, resources naming change and if so, I updated the relevant Jira ticket for QA.
  • I increased the Chart version in charts/mlrun-ce/Chart.yaml.
  • I confirmed that the installation works both on a local Docker Desktop environment and on a real cluster when using the required prerequisites.
    • If installation issues were found, I updated the relevant Jira ticket with the issue and steps to reproduce, or updated the prerequisites documentation if the issue is related to missing or outdated prerequisites.
  • If needed, update https://github.com/mlrun/ce/blob/development/charts/mlrun-ce/README.md with the relevant installation instructions and version Matrix.
  • If needed, update the following values files for multi namespace support:

🧪 Testing

  • Built both linux/amd64 images with make build-spark4-all.
  • Ran make validate-spark4-all; both images passed Spark, Scala, Java, Hadoop, Python, architecture, entrypoint, user, home-directory, ownership, locale, and image-metadata checks.
  • Validated CUDA 12.8.1, cuDNN 9.8.0.87-1, nvcc, cuDNN libraries, labels, and NVIDIA runtime environment metadata.
  • Verified CPU/CUDA environment parity, including JAVA_VERSION, the expected CUDA PATH addition, allowed CUDA-only variables, and intentional Spark build-provenance omissions.
  • Verified the S3A, ABFS workload-identity, and GCS filesystem classes resolve and that no duplicate connector versions are present.
  • Ran SparkPi successfully in both images.
  • Confirmed all 284 JARs matched by SHA-256 between the CPU and CUDA images.
  • Confirmed the protected Spark 3 files have no diff from development.

🔗 References


🚨 Breaking Changes?

  • Yes (explain below)
  • No

No configured image defaults, chart values, resource names, ports, Secrets, ConfigMaps, or installation behavior are changed.


🔍️ Additional Notes

ML-13080 originally excludes storage-provider libraries and validation; the images nevertheless package the same connector family as the published Spark 3 image so Spark 4 can serve as a like-for-like replacement. Authenticated provider testing and BigQuery compatibility validation against Spark 4.2 remain deferred to activation work.

GCS consumers must use org.apache.hadoop.fs.gs.GoogleHadoopFileSystem, and AWS consumers using SDK v1 credential-provider classes may need to migrate their configuration for Hadoop AWS 3.5.0.

JFrog publication uses manually managed tags; attach the resulting repository digests, pull-by-digest output, image inspection output, version output, JAR inventories, pinned base references, and source commit to ML-13080.

Warnings

  • The Chart version is intentionally unchanged because this PR only adds manually published Docker image recipes.
  • Installation on Docker Desktop and a real Kubernetes cluster still requires human confirmation.

Adds separately maintained Spark 4.2.0 CPU and CUDA application images for ML-13080 without changing the existing Spark 3 recipes or configured defaults.

Both variants use pinned upstream images, Spark 4.2.0, Scala 2.13, Hadoop 3.5.0, Temurin 25.0.4+7, and Python 3.11, with local validation for image metadata and CPU/CUDA JAR parity.

---

- Added `docker/spark/Dockerfile.spark4` for the CPU image using a digest-pinned upstream Spark base.
- Added `docker/spark/Dockerfile.spark4.cuda` for the CUDA image using digest-pinned Spark and CUDA bases without downloading Spark or Java again.
- Added `docker/spark/scripts/ce-customize-spark4.sh` for Python 3.11 and a writable `/home/spark`.
- Added `docker/spark/scripts/validate-spark4.sh` for Spark, Scala, Java, Hadoop, Python, architecture, locale, ownership, entrypoint, CUDA, cuDNN, and NVIDIA metadata validation.
- Added `docker/spark/scripts/jar-parity.sh` to compare every CPU and CUDA Spark JAR by SHA-256.
- Added independent Spark 4 build and validation targets to `docker/spark/Makefile`.
- Documented Spark 4 build, validation, connector limitations, selection, manual publication, and evidence capture in `docker/spark/README.md`.

---

- [ ] I have tested the changes in this PR
- [ ] I confirmed whether my changes require a change in documentation and if so, I created another PR in MLRun for the relevant documentation.
- [ ] I confirmed whether my changes require a changes in QA tests, for example: credentials changes, resources naming change and if so, I updated the relevant Jira ticket for QA.
- [ ] I increased the Chart version in `charts/mlrun-ce/Chart.yaml`.
- [ ] I confirmed that the installation works both on a local Docker Desktop environment and on a real cluster when using the required [prerequisites](https://docs.mlrun.org/en/stable/install-mlrun-ce/kubernetes-install.html#prerequisites).
  - [ ] If installation issues were found, I updated the relevant Jira ticket with the issue and steps to reproduce, or updated the prerequisites documentation if the issue is related to missing or outdated prerequisites.
- [x] If needed, update https://github.com/mlrun/ce/blob/development/charts/mlrun-ce/README.md with the relevant installation instructions and version Matrix.
- [x] If needed, update the following values files for multi namespace support:
  - [x] [Admin values](https://github.com/mlrun/ce/blob/development/charts/mlrun-ce/admin_installation_values.yaml)
  - [x] [User values Node Port](https://github.com/mlrun/ce/blob/development/charts/mlrun-ce/non_admin_installation_values.yaml)
  - [x] [User values ClusterIP](https://github.com/mlrun/ce/blob/development/charts/mlrun-ce/non_admin_cluster_ip_installation_values.yaml)

---

- Built both `linux/amd64` images with `make build-spark4-all`.
- Ran `make validate-spark4-all`; both images passed Spark, Scala, Java, Hadoop, Python, architecture, entrypoint, user, home-directory, ownership, locale, and image-metadata checks.
- Validated CUDA 12.8.1, cuDNN 9.8.0.87-1, `nvcc`, cuDNN libraries, labels, and NVIDIA runtime environment metadata.
- Ran SparkPi successfully in both images.
- Ran `make jar-parity-spark4`; all 276 JARs matched by SHA-256.
- Confirmed the protected Spark 3 files have no diff from `development` and the existing Spark 3 Make targets are unchanged.

---

- Ticket link: https://ecliptos.atlassian.net/browse/ML-13080
- External links: https://hub.docker.com/_/spark and https://hub.docker.com/r/nvidia/cuda
- Design docs links (Optional): `docker/spark/README.md`
---

- [ ] Yes (explain below)
- [x] No

No configured image defaults, chart values, resource names, ports, Secrets, ConfigMaps, or installation behavior are changed.

---

The Spark 4 images intentionally exclude S3A, ABFS, GCS, and BigQuery connectors, so connector support requires a later immutable image revision.

JFrog publication uses immutable tags and remains a manual checkpoint; attach the resulting repository digests, pull-by-digest output, image inspection output, version output, JAR inventories, and source commit to ML-13080.

- Confirm both immutable JFrog images were published successfully and attach the required evidence to ML-13080.
- Installation on Docker Desktop and a real Kubernetes cluster still requires human confirmation.

@royischoss royischoss left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey looks good few comments

Comment thread docker/spark/Dockerfile.spark4 Outdated
Comment thread docker/spark/Dockerfile.spark4.cuda
Comment thread docker/spark/README.md Outdated
Comment thread docker/spark/scripts/validate-spark4.sh
@gtopper

gtopper commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

Hey looks good few comments

Thanks for the detailed review, @royischoss. I addressed all four comments:

  • Centralized the pinned Spark and CUDA base references in the Makefile and pass them to both Dockerfiles as required build arguments.
  • Added JAVA_VERSION=jdk-25.0.4+7 to the CUDA image, documented the intentional omission of the Spark build-provenance variables, and added CPU/CUDA environment-parity validation.
  • Clarified that MLRun derives the CUDA repository by appending -cuda, while mlefi resolves both repositories and extracts the Spark version from the tag.
  • Locked the Spark 4 build and validation paths to linux/amd64.

We also added the cloud connector family shipped by the Spark 3 image so Spark 4 can serve as a like-for-like platform image. Both CPU and CUDA images now install the eight artifacts listed in scripts/jars-4.2.0.txt, covering S3A, ABFS, GCS, BigQuery, and their required AWS and Azure dependencies.

The rebuilt images pass local validation: all eight connector artifacts are present, the S3A/ABFS/GCS classes resolve, no duplicate connector versions are present, CPU/CUDA environment parity passes, and all 284 JARs match by SHA-256. Authenticated provider testing and BigQuery compatibility validation against Spark 4.2 remain deferred to the activation work.

@gtopper
gtopper requested a review from royischoss September 22, 2026 12:35
Comment thread docker/spark/scripts/validate-spark4.sh Outdated

@royischoss royischoss left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@royischoss
royischoss merged commit e96bc66 into mlrun:development Sep 23, 2026
2 checks passed
Sign up for free to 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