Skip to content

feat: add apm (Agent Package Manager) install support#7038

Merged
viceice merged 2 commits into
containerbase:mainfrom
MPV:claude/containerbase-apm-install-udtov6
Jul 14, 2026
Merged

feat: add apm (Agent Package Manager) install support#7038
viceice merged 2 commits into
containerbase:mainfrom
MPV:claude/containerbase-apm-install-udtov6

Conversation

@MPV

@MPV MPV commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Description

Adds install-tool apm support for APM (Agent Package Manager) — a language-agnostic dependency manager for AI-agent context (apm.yml / apm.lock.yaml).

This is a prerequisite for adding APM support to Renovate (see renovatebot/renovate discussion #42507 and PR #44390): Renovate needs the apm CLI available in its container image to regenerate the lock file after updating dependency refs.

How it works

APM publishes self-contained native binaries on its GitHub releases as apm-linux-<arch>.tar.gz (with a .sha256 sidecar per asset). Each archive is a PyInstaller onedir bundle — an apm executable next to an _internal/ directory — wrapped in a top-level apm-linux-<arch>/ folder.

The new ApmInstallService (modeled on the existing deno/bun single-binary tools):

  • downloads the arch-specific tarball (amd64x86_64, arm64arm64);
  • verifies the published .sha256 checksum;
  • extracts with strip: 1 so the apm binary and its sibling _internal/ land directly in the versioned tool path (keeping them adjacent, as the PyInstaller bootloader requires);
  • shell-wraps the apm binary onto PATH;
  • validates the install via apm --version.

Changes

  • src/cli/tools/apm.ts — new ApmInstallService.
  • src/cli/install-tool/index.ts — register the service in the DI container.
  • src/cli/tools/index.ts — add apm to NoPrepareTools (self-contained binary; no prepare/init step).
  • test/latest/Dockerfile — add an install-tool apm e2e check with a renovate: annotation (datasource=github-releases packageName=microsoft/apm).

Testing

  • prettier, eslint, and tsc pass on the changed files.
  • Existing unit tests pass, including the DI container spec (src/cli/install-tool/index.spec.ts).
  • The Docker e2e install is wired into the latest test image and will exercise a real download/extract/link on both x86_64 and aarch64 in CI.

Add an install service for APM (Agent Package Manager) which downloads
the self-contained native binary bundle from the `microsoft/apm` GitHub
releases, verifies the published `.sha256` checksum, extracts the
PyInstaller `onedir` layout (the `apm` binary plus its sibling
`_internal` directory), and wraps the binary onto PATH.

This is a prerequisite for adding APM (`apm.yml`) support to Renovate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UbMAQBiMRNkCNxc8EGQw1C
@MPV MPV force-pushed the claude/containerbase-apm-install-udtov6 branch from 8b32297 to 2b98e6b Compare July 7, 2026 09:08
@MPV MPV marked this pull request as ready for review July 7, 2026 09:09

@viceice viceice left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

otherwise LGTM

Comment thread test/latest/Dockerfile
Comment thread src/cli/tools/apm.ts
Address review feedback on the apm install support:

- add the `apm` install check to `test/latest/Dockerfile.arm64` so the
  binary is exercised on aarch64 as well as x86_64
- document the `apm` download urls in `docs/custom-registries.md`

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UbMAQBiMRNkCNxc8EGQw1C
@viceice viceice enabled auto-merge July 14, 2026 07:16
@viceice viceice added this pull request to the merge queue Jul 14, 2026
Merged via the queue into containerbase:main with commit ff9360b Jul 14, 2026
53 of 55 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.

3 participants