Skip to content

feat(keploy-ci-java): bundle jattach v2.2 (multi-arch)#17

Merged
AkashKumar7902 merged 3 commits into
mainfrom
feat/keploy-ci-java-bundle-jattach
May 7, 2026
Merged

feat(keploy-ci-java): bundle jattach v2.2 (multi-arch)#17
AkashKumar7902 merged 3 commits into
mainfrom
feat/keploy-ci-java-bundle-jattach

Conversation

@AkashKumar7902
Copy link
Copy Markdown
Collaborator

Summary

  • Bake jattach v2.2 (both linux-x64 and linux-arm64) into keploy-ci-java so the keploy/enterprise release pipelines stop re-downloading it from GitHub on every release build.
  • Both binaries land under /opt/jattach/<arch>/jattach. /usr/local/bin/jattach is symlinked to the host-arch binary so the image is also natively usable.
  • SHA256s are pinned per-arch (acd9e17f… amd64, 288ae5ed… arm64) — an upstream tarball replacement fails the image build rather than silently shipping a different binary.

Background

keploy/enterprise's release pipelines build a multi-arch keploy/enterprise image but, until #1995, didn't stage jattach at all — the v3.5.0 release tag failed at the buildx step ("/jattach": not found). #1995 fixes that by adding a per-pipeline curl + sha-verify of jattach v2.2.

This PR moves that responsibility one level up: by bundling jattach into the keploy-ci-java base image (which the release pipelines already use for the build-jvm-attach-assets step), the per-pipeline curl can be replaced with a simple cp /opt/jattach/<arch>/jattach ./jattach-<arch>. That:

  • removes 2 GitHub downloads per release (1× per arch, ×4 release pipelines = up to 8/release)
  • removes a network failure mode at release time
  • centralizes the jattach version + checksum in one place

Follow-up

Once a tagged keploy-ci-java:java-1.2.27 (or whichever version cuts this) is published, a tiny follow-up on keploy/enterprise will drop .ci/scripts/fetch-jattach.sh in favor of a cp from the bundled location.

Test plan

  • docker buildx build --platform linux/amd64,linux/arm64 -t keploy-ci-java:test ./keploy-ci-java succeeds.
  • docker run --rm --platform linux/amd64 keploy-ci-java:test sh -c 'ls -la /opt/jattach/amd64 /opt/jattach/arm64 && file /opt/jattach/amd64/jattach /opt/jattach/arm64/jattach' shows x86-64 + ARM aarch64 ELFs.
  • docker run --rm --platform linux/amd64 keploy-ci-java:test jattach 2>&1 | head -1 prints jattach usage (proves the symlink is wired up correctly).

Copilot AI review requested due to automatic review settings May 7, 2026 11:31
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5fa99df126

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread keploy-ci-java/Dockerfile Outdated
Copy link
Copy Markdown

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

Bundles jattach v2.2 into the keploy-ci-java base image to eliminate per-release pipeline downloads and provide a consistent, checksummed source for multi-arch keploy/enterprise builds.

Changes:

  • Adds build-time download + SHA256 verification of jattach v2.2 tarballs for linux-x64 and linux-arm64.
  • Installs extracted binaries under /opt/jattach/{amd64,arm64}/jattach.
  • Creates /usr/local/bin/jattach symlink to the build target architecture binary.

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

Comment thread keploy-ci-java/Dockerfile Outdated
AkashKumar7902 added a commit that referenced this pull request May 7, 2026
Address review feedback from Copilot + Codex on #17:

- TARGETARCH may be unset on legacy non-BuildKit builds, causing the
  jattach symlink to resolve to /opt/jattach//jattach. Fall back to
  `dpkg --print-architecture` (matches the keploy-ci/Dockerfile pattern)
  and validate ARCH ∈ {amd64, arm64}.
- `jattach | head -1 || true` masks a missing/broken symlink. Add
  explicit `test -x` checks on both staged binaries and the symlink so
  the build fails loud if anything is wrong.
@AkashKumar7902 AkashKumar7902 requested a review from Copilot May 7, 2026 11:36
Copy link
Copy Markdown

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 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread keploy-ci-java/Dockerfile Outdated
AkashKumar7902 added a commit that referenced this pull request May 7, 2026
Address #17 review nit — include the supported values and a hint about
BuildKit/--build-arg so users can self-correct without reading the
Dockerfile.
@AkashKumar7902 AkashKumar7902 requested a review from Copilot May 7, 2026 11:39
Pre-stage both arches under /opt/jattach/<arch>/jattach so keploy/enterprise
release pipelines can `cp /opt/jattach/<arch>/jattach ./jattach-<arch>`
into a multi-arch buildx context without re-downloading from GitHub on
every build (and without needing per-pipeline curl + sha verification).

SHA256s are pinned against the upstream-published v2.2 archives so an
upstream replacement fails the image build instead of silently shipping
a different binary. /usr/local/bin/jattach is symlinked to the host-arch
binary for native use of the image as well.

Context: keploy/enterprise release pipelines are currently growing their
own per-pipeline jattach download (see keploy/enterprise#1995); baking it
into the CI base image lets that PR's follow-up drop the curl entirely.

Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Address review feedback from Copilot + Codex on #17:

- TARGETARCH may be unset on legacy non-BuildKit builds, causing the
  jattach symlink to resolve to /opt/jattach//jattach. Fall back to
  `dpkg --print-architecture` (matches the keploy-ci/Dockerfile pattern)
  and validate ARCH ∈ {amd64, arm64}.
- `jattach | head -1 || true` masks a missing/broken symlink. Add
  explicit `test -x` checks on both staged binaries and the symlink so
  the build fails loud if anything is wrong.

Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Address #17 review nit — include the supported values and a hint about
BuildKit/--build-arg so users can self-correct without reading the
Dockerfile.

Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Copy link
Copy Markdown

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 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread keploy-ci-java/Dockerfile
@AkashKumar7902 AkashKumar7902 force-pushed the feat/keploy-ci-java-bundle-jattach branch from 6bf2231 to bb09315 Compare May 7, 2026 11:44
@AkashKumar7902 AkashKumar7902 merged commit b1055af into main May 7, 2026
22 checks passed
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