Skip to content

DLPX-97162 Add internal-claude variant for Claude Code developer environments#864

Closed
prakashsurya wants to merge 2 commits into
developfrom
internal-claude-variant
Closed

DLPX-97162 Add internal-claude variant for Claude Code developer environments#864
prakashsurya wants to merge 2 commits into
developfrom
internal-claude-variant

Conversation

@prakashsurya

@prakashsurya prakashsurya commented May 7, 2026

Copy link
Copy Markdown
Contributor

Problem

Developers working with Claude Code need a pre-configured appliance image that
is ready to use on first boot — with the Claude CLI installed, product repos
pre-cloned, and standard tooling wired up. Today there is no such image; each
developer must manually install and configure everything on a stock internal VM.

Solution

Add a new internal-claude appliance variant (AWS-only) that layers a
claude-internal Ansible role on top of minimal-common + minimal-internal + minimal-development. On first boot the VM provides:

  • Claude CLI installed via npm (/usr/local/bin/claude)
  • Six product repos pre-cloned under ~delphix/src/ at their configured
    branches, with remote URLs rewritten to SSH form (no build-time token on disk):
    • delphix/dlpx-app-gate @ develop
    • delphix/dlpx-qa-gate @ develop
    • delphix/dms-core-gate @ develop
    • delphix/zfs @ develop
    • delphix/cd-aidlc @ main
    • delphix/git-utils @ main
  • support-tools group (gid 4000) with delphix as a member
  • NAS mount at /nas via a systemd nas.mount unit
    (After/Wants=network-online.target); uses a unit file rather than
    /etc/fstab because 90-raw-disk-image.binary overwrites fstab after the
    ansible chroot stage
  • apt sources modifiable post-boot (cloud-init override in
    /etc/cloud/cloud.cfg.d/99-delphix-claude.cfg)
  • git-utils/bin in the login shell PATH via /etc/profile.d/

Also fixes 80-build-configuration.binary to use trap cleanup EXIT so
/proc, /sys, and /dev bind mounts are always torn down even when the
ansible playbook fails mid-run.

The build requires GITHUB_TOKEN to be set (asserted at the top of the role);
without it the build fails fast with a clear message.

Testing Done

  • ./gradlew buildInternalClaudeAws succeeds with GITHUB_TOKEN set —
    produces internal-claude-aws.{vmdk,debs.tar.gz,packages.list}
  • ./gradlew buildInternalClaudeAws without GITHUB_TOKEN fails fast at the
    assertion task with the expected fail_msg
  • git-ab-pre-push -v internal-claude --no-tests passed CI
    (appliance-build pre-push #13984, stage1 #62229)
  • Boot-verify checks 4.1–4.10 all passed on a VM cloned from the produced AMI:
    • claude --version2.1.132 (Claude Code)
    • All 6 repos present at correct branches with SSH remote URLs
    • support-tools gid 4000, delphix in group
    • nas.mount enabled, unit file correct
    • 99-delphix-claude.cfg present with correct content
    • 61 GB free (> 50 GB)
    • git-utils/bin in PATH
    • No embedded credentials
    • No ~/.claude/settings.json

Future Work

  • Ship ~/.claude/settings.json with "Generated with Claude" attribution
    defaults (deferred to a follow-on spec)
  • Preload common build dependencies to speed up first use (out of scope)

JIRA: https://perforce.atlassian.net/browse/DLPX-97162

prakashsurya and others added 2 commits May 6, 2026 21:28
Implements the appliance-build half (Phase 1) of cd-aidlc spec 0004
[1]. Introduces a new variant `internal-claude`, sibling to
`internal-minimal` / `internal-dev`, intended as a centralized
developer environment for engineers running Claude Code.

The variant layers a new `appliance-build.claude-internal` role on top
of the same `minimal-common + minimal-internal + minimal-development`
base used by `internal-minimal`. The role:

  - Installs the Claude CLI via the official Anthropic installer.
  - Pre-clones five Delphix product repos under `~delphix/src/`
    (dlpx-app-gate, dms-core-gate, zfs, cd-aidlc, git-utils) at the
    HEAD of their configured branches at build time.
  - Strips the build-time bot token from each cloned repo's
    `remote.origin.url`, rewriting it to the SSH form so engineers
    push via their own SSH key.
  - Adds NFS access to the support-tools share at `/nas` via fstab
    `_netdev` (mounted at first boot, not during chroot build) plus a
    `support-tools` group at gid 4000 that the `delphix` user joins.
  - Drops `/etc/cloud/cloud.cfg.d/99-delphix-claude.cfg` to override
    the platform's `apt: preserve_sources_list: true` default so apt
    sources can be edited post-boot.
  - Adds `~delphix/src/git-utils/bin` to `$PATH` for login shells.

Build-time `GITHUB_TOKEN` is asserted required (fail-fast), stricter
than `devops-development`'s skip-if-missing pattern, because the
preloaded repos are core to what the variant is.

Variant gating to AWS-only and weekly Jenkins integration land
separately in `pipeline-shared` and `devops-gate` per Phase 2 of the
spec; gradle's autodiscovery picks the variant directory up without
`build.gradle` edits.

Open questions still being resolved on the spec PR:
  - Opinionated user defaults (`~/.claude/settings.json`, tmux config,
    etc.) — v1 ships none.
  - Common build dependencies (Java/Python/Go/Node/build-essential) —
    v1 ships none.
  - The Claude installer's `creates:` path may need adjustment if the
    installer's drop location has shifted; verify on first build.

[1] delphix/cd-aidlc#32
Replace curl/Bun claude.ai installer with npm install, which avoids the
SIGILL crash from Bun in this VM/chroot. Add git to the apt install so
ansible.builtin.git can run inside the chroot.

Add trap cleanup EXIT to 80-build-configuration.binary so /proc, /sys,
and /dev bind mounts are always unmounted even when ansible fails, rather
than being left stuck and causing the next rm -rf to traverse them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@david-mendez1

david-mendez1 commented May 7, 2026

Copy link
Copy Markdown
Contributor

Do we want the .claude/settings.json to include the Generated with Claude stamp if developers will be submitting PRs from these VMs?
"attribution": {
"commit": "Co-Authored-By: Claude xxxx noreply@anthropic.com",
"pr": "🤖 Generated with Claude Code"

@david-mendez1

Copy link
Copy Markdown
Contributor

This may be a v2 thing, but include dlpx-qa-gate for E-2-E testing.

@@ -0,0 +1,26 @@
#
# Copyright 2018 Delphix

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.

2018 -> 2026

@prakashsurya

Copy link
Copy Markdown
Contributor Author

Do we want the .claude/settings.json to include the Generated with Claude stamp if developers will be submitting PRs from these VMs?

Yea, that would make sense. I'll defer to another spec for that, though.

but include dlpx-qa-gate for E-2-E testing.

Good idea, let me pull that in for v1.

@prakashsurya prakashsurya changed the title Add internal-claude variant for Claude Code developer environments DLPX-97162 Add internal-claude variant for Claude Code developer environments May 7, 2026
@prakashsurya

Copy link
Copy Markdown
Contributor Author

Closing in favour of #865 — the branch was not under the projects/ namespace required by this repo's conventions. All changes (including review feedback) are squashed into a single commit on projects/internal-claude.

@sebroy sebroy deleted the internal-claude-variant branch May 8, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants