DLPX-97162 Add internal-claude variant for Claude Code developer environments#864
DLPX-97162 Add internal-claude variant for Claude Code developer environments#864prakashsurya wants to merge 2 commits into
Conversation
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>
|
Do we want the .claude/settings.json to include the Generated with Claude stamp if developers will be submitting PRs from these VMs? |
|
This may be a v2 thing, but include dlpx-qa-gate for E-2-E testing. |
| @@ -0,0 +1,26 @@ | |||
| # | |||
| # Copyright 2018 Delphix | |||
Yea, that would make sense. I'll defer to another spec for that, though.
Good idea, let me pull that in for v1. |
|
Closing in favour of #865 — the branch was not under the |
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-claudeappliance variant (AWS-only) that layers aclaude-internalAnsible role on top ofminimal-common + minimal-internal + minimal-development. On first boot the VM provides:/usr/local/bin/claude)~delphix/src/at their configuredbranches, with remote URLs rewritten to SSH form (no build-time token on disk):
delphix/dlpx-app-gate@developdelphix/dlpx-qa-gate@developdelphix/dms-core-gate@developdelphix/zfs@developdelphix/cd-aidlc@maindelphix/git-utils@maindelphixas a member/nasvia a systemdnas.mountunit(
After/Wants=network-online.target); uses a unit file rather than/etc/fstabbecause90-raw-disk-image.binaryoverwrites fstab after theansible chroot stage
/etc/cloud/cloud.cfg.d/99-delphix-claude.cfg)/etc/profile.d/Also fixes
80-build-configuration.binaryto usetrap cleanup EXITso/proc,/sys, and/devbind mounts are always torn down even when theansible playbook fails mid-run.
The build requires
GITHUB_TOKENto be set (asserted at the top of the role);without it the build fails fast with a clear message.
Testing Done
./gradlew buildInternalClaudeAwssucceeds withGITHUB_TOKENset —produces
internal-claude-aws.{vmdk,debs.tar.gz,packages.list}./gradlew buildInternalClaudeAwswithoutGITHUB_TOKENfails fast at theassertion task with the expected
fail_msggit-ab-pre-push -v internal-claude --no-testspassed CI(appliance-build pre-push #13984, stage1 #62229)
claude --version→2.1.132 (Claude Code)support-toolsgid 4000,delphixin groupnas.mountenabled, unit file correct99-delphix-claude.cfgpresent with correct contentgit-utils/binin PATH~/.claude/settings.jsonFuture Work
~/.claude/settings.jsonwith "Generated with Claude" attributiondefaults (deferred to a follow-on spec)
JIRA: https://perforce.atlassian.net/browse/DLPX-97162