Skip to content

Add HOLMESGPT_REF validation and align Dockerfile with gatekeeper source-build pattern#4756

Open
ArrisLee wants to merge 7 commits intomasterfrom
arris/holmesgpt/dev
Open

Add HOLMESGPT_REF validation and align Dockerfile with gatekeeper source-build pattern#4756
ArrisLee wants to merge 7 commits intomasterfrom
arris/holmesgpt/dev

Conversation

@ArrisLee
Copy link
Copy Markdown
Collaborator

@ArrisLee ArrisLee commented Apr 8, 2026

HOLMESGPT_REF had no default and no validation — omitting it caused a silent, non-obvious curl failure when building the image directly without the Makefile.

Changes

  • Dockerfile.holmesgpt: Add early RUN validation in the builder stage that fails fast with a clear error if HOLMESGPT_REF is unset:
    RUN test -n "${HOLMESGPT_REF}" || { echo "ERROR: HOLMESGPT_REF build arg must be set (e.g., --build-arg HOLMESGPT_REF=v0.23.0)"; exit 1; }
  • kubectl install: Added sha256 checksum verification before installing the kubectl binary to reduce supply-chain risk.

This adds a maintained HolmesGPT container image definition and Make targets to build and push it through the existing ARO-RP workflow with configurable versioning and base registry.

Made-with: Cursor
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds a first-class build/publish workflow for a HolmesGPT container image within the ARO-RP repo, keeping the image definition versioned alongside the codebase and providing Makefile targets to build and push it.

Changes:

  • Add Dockerfile.holmesgpt to build a HolmesGPT runtime image (installed from PyPI) and include kubectl tooling.
  • Add Makefile variables and targets to build (image-holmesgpt) and publish (publish-image-holmesgpt) the HolmesGPT image.
  • Introduce HOLMESGPT_BASE_REGISTRY to decouple the base-image source registry from the output image registry.

Reviewed changes

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

File Description
Makefile Adds HolmesGPT version/registry/image variables plus build/publish targets.
Dockerfile.holmesgpt Defines the HolmesGPT multi-stage build and installs runtime tooling (kubectl).

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

Comment thread Dockerfile.holmesgpt Outdated
Comment thread Dockerfile.holmesgpt Outdated
Remove the accidentally duplicated second half of Dockerfile.holmesgpt so the image definition remains single-sourced and easier to maintain.

Made-with: Cursor
@wanghaoran1988
Copy link
Copy Markdown
Collaborator

Similar to gatekeeper, you have to download the source code in the dockerfile and build the container image.

@ArrisLee ArrisLee assigned ArrisLee and unassigned ArrisLee Apr 8, 2026
@ArrisLee ArrisLee added the skippy pull requests raised by member of Team Skippy label Apr 8, 2026
This switches HolmesGPT builds to UBI Python base images, installs source from upstream tarball refs, updates Makefile build args, and aligns runtime entrypoint to python holmes_cli.py while keeping non-root execution.

Made-with: Cursor
Copilot AI review requested due to automatic review settings April 9, 2026 02:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 2 out of 2 changed files in this pull request and generated 3 comments.


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

Comment thread Dockerfile.holmesgpt
Comment on lines +5 to +7
ARG HOLMESGPT_REPO=https://github.com/robusta-dev/holmesgpt
ARG HOLMESGPT_REF

Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

HOLMESGPT_REF is declared but has no default and isn’t validated. If someone builds this Dockerfile directly (without the Makefile target), it will attempt to download /tags/.tar.gz and fail with a non-obvious curl error. Add an explicit check early in the build (with a clear error message) or provide a sensible default so failures are easier to diagnose.

Copilot uses AI. Check for mistakes.
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.

@copilot apply changes based on this feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Added an early validation check in the builder stage (commit 1989b88) that fails immediately with a clear error message if HOLMESGPT_REF is not set:

RUN test -n "${HOLMESGPT_REF}" || { echo "ERROR: HOLMESGPT_REF build arg must be set (e.g., --build-arg HOLMESGPT_REF=v0.23.0)"; exit 1; }

Comment thread Dockerfile.holmesgpt
Comment on lines +17 to +27
RUN HOLMESGPT_TARBALL_URL="${HOLMESGPT_REPO}/archive/refs/tags/${HOLMESGPT_REF}.tar.gz" \
&& curl -fsSL "${HOLMESGPT_TARBALL_URL}" -o /tmp/holmesgpt.tar.gz \
|| (case "${HOLMESGPT_REF}" in \
v*) ALT_REF="${HOLMESGPT_REF#v}" ;; \
*) ALT_REF="v${HOLMESGPT_REF}" ;; \
esac \
&& curl -fsSL "${HOLMESGPT_REPO}/archive/refs/tags/${ALT_REF}.tar.gz" -o /tmp/holmesgpt.tar.gz) \
&& mkdir -p /build/src \
&& tar -xzf /tmp/holmesgpt.tar.gz -C /build/src --strip-components=1 \
&& rm -f /tmp/holmesgpt.tar.gz \
&& pip install --no-cache-dir /build/src
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

The HolmesGPT source tarball is downloaded and executed (via pip install) without any integrity verification. This is a supply-chain risk; consider pinning and verifying a checksum (or signature) for the downloaded artifact, or using a mechanism that enforces hashes for dependencies/artifacts during the build.

Copilot uses AI. Check for mistakes.
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.

@copilot apply changes based on this feedback

Comment thread Dockerfile.holmesgpt
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 9, 2026 05:11
Agent-Logs-Url: https://github.com/Azure/ARO-RP/sessions/b62e8f78-8d31-455c-8660-144286b69658

Co-authored-by: ArrisLee <20032458+ArrisLee@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented Apr 9, 2026

Similar to gatekeeper, you have to download the source code in the dockerfile and build the container image.

The current Dockerfile.holmesgpt already follows the gatekeeper pattern — it downloads the source tarball from GitHub (https://github.com/robusta-dev/holmesgpt/archive/refs/tags/${HOLMESGPT_REF}.tar.gz) and installs from source via pip install --no-cache-dir /build/src in the builder stage, mirroring how gatekeeper downloads and builds from source.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 2 out of 2 changed files in this pull request and generated no new comments.


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

Copilot AI changed the title Add HolmesGPT image build and publish targets. Add HOLMESGPT_REF validation and align Dockerfile with gatekeeper source-build pattern Apr 9, 2026
Agent-Logs-Url: https://github.com/Azure/ARO-RP/sessions/58c8ddc6-751a-4f57-b300-70fe4330a4e4

Co-authored-by: ArrisLee <20032458+ArrisLee@users.noreply.github.com>
This reverts commit d0b686e.

Co-authored-by: ArrisLee <20032458+ArrisLee@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 14, 2026 01:25
@ArrisLee ArrisLee review requested due to automatic review settings April 14, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skippy pull requests raised by member of Team Skippy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants