Skip to content

fix: remove helm linux binaries from source repository#6058

Open
cheyang wants to merge 5 commits into
fluid-cloudnative:masterfrom
cheyang:remove_helm_linux_binary
Open

fix: remove helm linux binaries from source repository#6058
cheyang wants to merge 5 commits into
fluid-cloudnative:masterfrom
cheyang:remove_helm_linux_binary

Conversation

@cheyang

@cheyang cheyang commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Remove pre-committed helm ELF binaries (helm-linux-amd64, helm-linux-arm64) from the repository to resolve Scorecard Binary-Artifacts alerts. Helm binaries are now downloaded at build time via make download-helm in each Dockerfile's builder stage.

Ⅰ. Describe what this PR does

Ⅱ. Does this pull request fix one issue?

fixes #XXXX

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@fluid-e2e-bot

fluid-e2e-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from cheyang by writing /assign @cheyang in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the build process by adding a step to download Helm in the Makefile and multiple Dockerfiles, while also updating the .gitignore file to ignore the /bin/ directory. The review feedback suggests optimizing the Dockerfiles to leverage layer caching by copying the Makefile and running make download-helm before copying the rest of the source code, which prevents downloading Helm on every code change.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docker/Dockerfile.alluxioruntime Outdated
Comment on lines +6 to +9
COPY . .

ARG FLUID_VERSION
RUN make download-helm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To leverage Docker's layer caching and avoid downloading the Helm binaries (~30MB) on every single code change, copy only the Makefile first and run make download-helm before copying the rest of the source code. This significantly speeds up subsequent builds when only Go source files are modified.

COPY Makefile Makefile
RUN make download-helm
COPY . .

ARG FLUID_VERSION

Comment thread docker/Dockerfile.application Outdated
Comment on lines +6 to +9
COPY . .

ARG FLUID_VERSION
RUN make download-helm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To leverage Docker's layer caching and avoid downloading the Helm binaries (~30MB) on every single code change, copy only the Makefile first and run make download-helm before copying the rest of the source code. This significantly speeds up subsequent builds when only Go source files are modified.

COPY Makefile Makefile
RUN make download-helm
COPY . .

ARG FLUID_VERSION

Comment thread docker/Dockerfile.cacheruntime Outdated
Comment on lines +6 to +9
COPY . .

ARG FLUID_VERSION
RUN make download-helm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To leverage Docker's layer caching and avoid downloading the Helm binaries (~30MB) on every single code change, copy only the Makefile first and run make download-helm before copying the rest of the source code. This significantly speeds up subsequent builds when only Go source files are modified.

COPY Makefile Makefile
RUN make download-helm
COPY . .

ARG FLUID_VERSION

Comment thread docker/Dockerfile.dataset Outdated
Comment on lines +6 to +9
COPY . .

ARG FLUID_VERSION
RUN make download-helm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To leverage Docker's layer caching and avoid downloading the Helm binaries (~30MB) on every single code change, copy only the Makefile first and run make download-helm before copying the rest of the source code. This significantly speeds up subsequent builds when only Go source files are modified.

COPY Makefile Makefile
RUN make download-helm
COPY . .

ARG FLUID_VERSION

Comment thread docker/Dockerfile.efcruntime Outdated
Comment on lines +6 to +9
COPY . .

ARG FLUID_VERSION
RUN make download-helm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To leverage Docker's layer caching and avoid downloading the Helm binaries (~30MB) on every single code change, copy only the Makefile first and run make download-helm before copying the rest of the source code. This significantly speeds up subsequent builds when only Go source files are modified.

COPY Makefile Makefile
RUN make download-helm
COPY . .

ARG FLUID_VERSION

Comment thread docker/Dockerfile.jindoruntime Outdated
Comment on lines +6 to +9
COPY . .

ARG FLUID_VERSION
RUN make download-helm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To leverage Docker's layer caching and avoid downloading the Helm binaries (~30MB) on every single code change, copy only the Makefile first and run make download-helm before copying the rest of the source code. This significantly speeds up subsequent builds when only Go source files are modified.

COPY Makefile Makefile
RUN make download-helm
COPY . .

ARG FLUID_VERSION

Comment thread docker/Dockerfile.juicefsruntime Outdated
Comment on lines +6 to +9
COPY . .

ARG FLUID_VERSION
RUN make download-helm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To leverage Docker's layer caching and avoid downloading the Helm binaries (~30MB) on every single code change, copy only the Makefile first and run make download-helm before copying the rest of the source code. This significantly speeds up subsequent builds when only Go source files are modified.

COPY Makefile Makefile
RUN make download-helm
COPY . .

ARG FLUID_VERSION

Comment thread docker/Dockerfile.thinruntime Outdated
Comment on lines +6 to +9
COPY . .

ARG FLUID_VERSION
RUN make download-helm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To leverage Docker's layer caching and avoid downloading the Helm binaries (~30MB) on every single code change, copy only the Makefile first and run make download-helm before copying the rest of the source code. This significantly speeds up subsequent builds when only Go source files are modified.

COPY Makefile Makefile
RUN make download-helm
COPY . .

ARG FLUID_VERSION

Comment thread docker/Dockerfile.vineyardruntime Outdated
Comment on lines +6 to +9
COPY . .

ARG FLUID_VERSION
RUN make download-helm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To leverage Docker's layer caching and avoid downloading the Helm binaries (~30MB) on every single code change, copy only the Makefile first and run make download-helm before copying the rest of the source code. This significantly speeds up subsequent builds when only Go source files are modified.

COPY Makefile Makefile
RUN make download-helm
COPY . .

ARG FLUID_VERSION

Remove pre-committed helm ELF binaries (helm-linux-amd64, helm-linux-arm64)
from the repository to resolve Scorecard Binary-Artifacts alerts (fluid-cloudnative#1461, fluid-cloudnative#1462).
Helm binaries are now downloaded at build time via `make download-helm` in
each Dockerfile's builder stage.

Signed-off-by: cheyang <cheyang.cy@alibaba-inc.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR removes reliance on pre-committed Helm Linux binaries by switching the build to download Helm during image builds, and updates ignore/build wiring to prevent reintroducing binary artifacts into the repository.

Changes:

  • Adds make download-helm execution to each controller Dockerfile builder stage to fetch Helm during image build.
  • Wires download-helm into aggregate Makefile docker build targets.
  • Updates .gitignore to ignore the top-level /bin/ directory (including Helm/tooling outputs).

Reviewed changes

Copilot reviewed 10 out of 13 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
Makefile Ensures Helm download runs before aggregate docker build/buildx targets.
docker/Dockerfile.dataset Downloads Helm in builder stage before building dataset controller image.
docker/Dockerfile.application Downloads Helm in builder stage before building application controller image.
docker/Dockerfile.alluxioruntime Downloads Helm in builder stage before building alluxio runtime controller image.
docker/Dockerfile.cacheruntime Downloads Helm in builder stage before building cache runtime controller image.
docker/Dockerfile.efcruntime Downloads Helm in builder stage before building EFC runtime controller image.
docker/Dockerfile.jindoruntime Downloads Helm in builder stage before building Jindo runtime controller image.
docker/Dockerfile.juicefsruntime Downloads Helm in builder stage before building JuiceFS runtime controller image.
docker/Dockerfile.thinruntime Downloads Helm in builder stage before building thin runtime controller image.
docker/Dockerfile.vineyardruntime Downloads Helm in builder stage before building Vineyard runtime controller image.
.gitignore Stops tracking/adding build outputs under /bin/ (including Helm downloads).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docker/Dockerfile.dataset Outdated
Comment on lines +8 to +9
ARG FLUID_VERSION
RUN make download-helm
Comment thread docker/Dockerfile.application Outdated
Comment on lines +8 to +9
ARG FLUID_VERSION
RUN make download-helm
Comment thread docker/Dockerfile.alluxioruntime Outdated
Comment on lines +8 to +9
ARG FLUID_VERSION
RUN make download-helm
Comment thread docker/Dockerfile.cacheruntime Outdated
Comment on lines +8 to +9
ARG FLUID_VERSION
RUN make download-helm
Comment thread docker/Dockerfile.efcruntime Outdated
Comment on lines +8 to +9
ARG FLUID_VERSION
RUN make download-helm
Comment thread docker/Dockerfile.jindoruntime Outdated
Comment on lines +8 to +9
ARG FLUID_VERSION
RUN make download-helm
Comment thread docker/Dockerfile.juicefsruntime Outdated
Comment on lines +8 to +9
ARG FLUID_VERSION
RUN make download-helm
Comment thread docker/Dockerfile.thinruntime Outdated
Comment on lines +8 to +9
ARG FLUID_VERSION
RUN make download-helm
Comment thread docker/Dockerfile.vineyardruntime Outdated
Comment on lines +8 to +9
ARG FLUID_VERSION
RUN make download-helm
Comment thread Makefile

.PHONY: docker-build-all
docker-build-all: pre-setup ${DOCKER_BUILD}
docker-build-all: pre-setup download-helm ${DOCKER_BUILD}
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.90%. Comparing base (2553159) to head (f77995a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6058   +/-   ##
=======================================
  Coverage   64.90%   64.90%           
=======================================
  Files         480      480           
  Lines       33554    33554           
=======================================
  Hits        21779    21779           
  Misses      10049    10049           
  Partials     1726     1726           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread docker/Dockerfile.alluxioruntime Outdated
COPY . .

ARG FLUID_VERSION
RUN make download-helm

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

When this Dockerfile is built directly with docker build --build-arg HELM_VERSION=<version> (without first running make docker-build-all to populate bin/helm/<version>/ on the host), the builder stage falls back to the Makefile default HELM_VERSION ?= v3.19.5 because no ARG HELM_VERSION is declared before RUN make download-helm. The runtime stage, however, references ${HELM_VERSION} in COPY --from=builder ... /bin/helm/${HELM_VERSION}/helm-linux-${TARGETARCH} and would look up a directory the builder never created, breaking the build. Could you add ARG HELM_VERSION to the builder stage before RUN make download-helm so that override flows correctly through both stages? Same fix applies to the other 8 Dockerfile.* files in this PR.

@cheyang

cheyang commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for getting these binaries out of the source tree — the diff is mechanical and safe, and the migration to make download-helm is a clear net win for repo size and license hygiene. CI is green across the matrix and the change is mergeable from my side. A few notes that aren't anchorable to specific diff lines but are worth a follow-up:

  • Integrity verification. make download-helm (Makefile around line 452) does curl -fsSL ... | tar -xz with no checksum check. Now that this runs on every fresh build instead of being a one-off bootstrap, an upstream tampering or a corrupted release artifact would propagate silently into the published images. Pinning a SHA256 per HELM_VERSION (e.g. download to disk, verify against helm-<version>-linux-<arch>.tar.gz.sha256, then extract) would be cheap and would also catch partial transfers.
  • Failure surfacing in the for-loop. The recipe runs for arch in amd64 arm64; do ... curl ... | tar ... ; done without set -eo pipefail. If the amd64 fetch fails or the curl pipe is truncated, the loop still proceeds to arm64 and tar can exit 0 on a partial input, leaving bin/helm/<version>/ half-populated while the recipe reports success. A set -eo pipefail (or per-iteration || exit 1) would make a failed download a hard error.
  • Why a fork URL? The download points at github.com/fluid-cloudnative/helm/releases/... rather than upstream helm/helm. Assuming this is intentional (custom patches, mirrored arch coverage), a one-line comment near HELM_VERSION ?= capturing the rationale and the asset-name contract (helm-${HELM_VERSION}-linux-${arch}.tar.gz containing linux-${arch}/helm) would help future contributors avoid swapping the URL by accident.
  • Layer reuse. Each of the nine runtime Dockerfiles now runs RUN make download-helm independently, so cold caches re-fetch the same two binaries up to nine times per build matrix. Not a blocker, but factoring the helm fetch into a small shared stage (or relying on the host-side make download-helm already wired into docker-build-all/docker-buildx-all-push and skipping the in-image download when bin/helm/<version>/ is already present, which the current target does) could shave time on fresh CI runners as more runtime images are added.

None of the above blocks the PR; happy to land this once you've had a chance to weigh in on the in-builder ARG HELM_VERSION point inline.

Comment thread docker/Dockerfile.alluxioruntime Outdated
COPY . .

ARG FLUID_VERSION
RUN make download-helm

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

When this Dockerfile is built directly with docker build --build-arg HELM_VERSION=<version> (without first running make docker-build-all to populate bin/helm/<version>/ on the host), the builder stage has no ARG HELM_VERSION declared, so make download-helm falls back to the Makefile default HELM_VERSION ?= v3.19.5. The runtime stage then uses ${HELM_VERSION} from the build arg in COPY --from=builder ... /bin/helm/${HELM_VERSION}/helm-linux-${TARGETARCH} and would point at a directory the builder never created, breaking the build. Could you add ARG HELM_VERSION (and ARG TARGETARCH if intended for the for-loop side) to the builder stage before RUN make download-helm? The same change should be replicated across the other 8 docker/Dockerfile.* files updated in this PR.

cheyang and others added 2 commits June 24, 2026 14:56
…stage

Without ARG HELM_VERSION in the builder stage, make download-helm uses
the Makefile default while the runtime stage COPY references the build
arg value, causing path mismatch when HELM_VERSION is overridden.

Signed-off-by: cheyang <cheyang.cy@alibaba-inc.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy only the Makefile before running `make download-helm` so that the
helm download layer (~30MB) is cached and not invalidated by source code
changes. This speeds up subsequent image builds when only Go files are
modified.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: cheyang <cheyang.cy@alibaba-inc.com>
@cheyang cheyang force-pushed the remove_helm_linux_binary branch from a171e3d to dff2976 Compare June 24, 2026 07:12
Comment thread docker/Dockerfile.alluxioruntime Outdated
WORKDIR /go/src/github.com/fluid-cloudnative/fluid
COPY Makefile Makefile

ARG HELM_VERSION

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ARG HELM_VERSION has no default. When the project Makefile drives the build it always passes --build-arg HELM_VERSION=$(HELM_VERSION), so CI is fine. A direct docker build -f docker/Dockerfile.alluxioruntime . is not: ${HELM_VERSION} expands to empty, then make download-helm HELM_VERSION= overrides the Makefile's HELM_VERSION ?= v3.19.5 with the empty string, and the curl URL ends up as .../releases/download//helm--linux-amd64.tar.gz. Adding ARG HELM_VERSION=v3.19.5 here (and in the runtime stage that does the COPY --from=builder .../bin/helm/${HELM_VERSION}/...) would keep the Makefile as the single source of truth and let direct builds work. Same fix applies to all nine Dockerfiles in this PR.

Comment thread docker/Dockerfile.alluxioruntime Outdated
FROM golang:1.24.12-bookworm@sha256:1c64c586e1cf9dc4c394c5896ec574659c792a0840f4fa0eb54a88de146e978b as builder

WORKDIR /go/src/github.com/fluid-cloudnative/fluid
COPY Makefile Makefile

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Putting COPY Makefile Makefile ahead of COPY . . is the right idea for caching the helm download, but the Makefile is one of the more frequently edited files in this repo, so this layer will invalidate often and re-download helm anyway. Two cheap alternatives: extract just the helm-download logic into a small hack/download-helm.sh and copy that instead of the whole Makefile, or keep it as is and add a comment so the next person doesn't try to 'optimize' by moving it. Same observation applies to all nine Dockerfiles.

Comment thread Makefile

.PHONY: docker-build-all
docker-build-all: pre-setup ${DOCKER_BUILD}
docker-build-all: pre-setup download-helm ${DOCKER_BUILD}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

With host-side download-helm already gating docker-build-all, the in-builder make download-helm in each Dockerfile fires on cold caches up to nine times per matrix run. Not a blocker, but if more runtime images are added it scales linearly. Worth a follow-up to factor a shared builder base image (or a tiny pre-built helm-fetch stage) so the download happens once per build.

…lt HELM_VERSION

Move helm download logic from Makefile into hack/download-helm.sh so
Dockerfiles COPY only the small script instead of the entire Makefile,
improving layer cache stability. Add ARG HELM_VERSION=v3.19.5 default
in both builder and runtime stages so direct `docker build` without
--build-arg works correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: cheyang <cheyang.cy@alibaba-inc.com>
@cheyang cheyang force-pushed the remove_helm_linux_binary branch from a06cce3 to 26aa8aa Compare June 24, 2026 08:38
Comment thread hack/download-helm.sh
#!/bin/bash
set -euo pipefail

HELM_VERSION="${1:-v3.19.5}"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Nice cleanup — extracting this into a script and adding a default ARG HELM_VERSION=v3.19.5 in the Dockerfiles addresses the earlier feedback well, and the layer cache is much tighter now that only the script is copied. Heads-up that the default version string is now duplicated in three places (Makefile HELM_VERSION ?= v3.19.5, this script, and every Dockerfile builder/runtime stage). Not a blocker for this PR, but a follow-up to source it from a single place would make future helm bumps less error-prone.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 14 changed files in this pull request and generated 11 comments.

Comment thread Makefile

.PHONY: docker-build-all
docker-build-all: pre-setup ${DOCKER_BUILD}
docker-build-all: pre-setup download-helm ${DOCKER_BUILD}
Comment thread Makefile

.PHONY: docker-buildx-all-push
docker-buildx-all-push: pre-setup ${DOCKER_BUILDX_PUSH}
docker-buildx-all-push: pre-setup download-helm ${DOCKER_BUILDX_PUSH}
Comment on lines +8 to +9
ARG HELM_VERSION=v3.19.5
RUN hack/download-helm.sh ${HELM_VERSION}
Comment thread docker/Dockerfile.dataset
Comment on lines +8 to +9
ARG HELM_VERSION=v3.19.5
RUN hack/download-helm.sh ${HELM_VERSION}
Comment on lines +8 to +9
ARG HELM_VERSION=v3.19.5
RUN hack/download-helm.sh ${HELM_VERSION}
Comment on lines +8 to +9
ARG HELM_VERSION=v3.19.5
RUN hack/download-helm.sh ${HELM_VERSION}
Comment on lines +8 to +9
ARG HELM_VERSION=v3.19.5
RUN hack/download-helm.sh ${HELM_VERSION}
Comment on lines +8 to +9
ARG HELM_VERSION=v3.19.5
RUN hack/download-helm.sh ${HELM_VERSION}
Comment on lines +8 to +9
ARG HELM_VERSION=v3.19.5
RUN hack/download-helm.sh ${HELM_VERSION}
Comment on lines +8 to +9
ARG HELM_VERSION=v3.19.5
RUN hack/download-helm.sh ${HELM_VERSION}
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: cheyang <cheyang.cy@alibaba-inc.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants