mirror of
https://github.com/fscotto/infra.git
synced 2026-11-25 21:29:51 +00:00
Remove mise from WSL and tidy devcontainer tooling
- Drop mise installation, COPR repository, pinned tool checks and dotfiles from the Fedora WSL profile; keep the Maven pin for the devcontainers as workstation_maven_version. - Remove the Claude Code and Cline VS Code extensions from the devcontainer definitions; the CLIs and their mounts remain. - Add the cdp and ecaas devcontainer definitions and their docs. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
43
docs/deadalus-cdp-devcontainer.md
Normal file
43
docs/deadalus-cdp-devcontainer.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# cdp Java 25 / Node 20 dev container on deadalus
|
||||
|
||||
Same toolset and mounts as the [ecaas container](deadalus-ecaas-devcontainer.md)
|
||||
(Git configuration and GitLab CAs, Bash configuration, `~/.m2`, `~/.claude`,
|
||||
`~/.cline`, `~/.config/ai`, Docker outside of Docker, Claude Code, Cline, delta,
|
||||
Great Icons), with these differences:
|
||||
|
||||
- Java 25 (`mcr.microsoft.com/devcontainers/java:25-bookworm`) is the default JDK
|
||||
and also runs the Java and Spring language servers; there is no second JDK.
|
||||
- Maven is `workstation_maven_version`; Node is
|
||||
`workstation_cdp_node_version` (20.18.3) from the official Node image, used by
|
||||
the Angular Module Federation front ends and the Claude/Cline CLIs.
|
||||
- Angular Language Service and ESLint are added; forwarded ports are 4200, 4201,
|
||||
4202, 4210 (front ends) and 8083, 8084 (`mediation-ansc`, `ansc-allegati`).
|
||||
- `kubectl` 1.37.1 and Helm 4.2.2 are installed from the official releases with
|
||||
pinned SHA-256 checksums (amd64 and arm64), and the Kubernetes VS Code
|
||||
extension is added. The WSL `~/.kube` is bind-mounted read-write at
|
||||
`/home/vscode/.kube`, so contexts, tokens and cached data are shared with the
|
||||
host; the current `config` embeds the Rancher CA and credentials, which are
|
||||
therefore readable by anything in the container. The Rancher endpoint must be
|
||||
reachable from the container (VPN). `KUBECONFIG` on the host is not forwarded.
|
||||
- `glab` 1.114.0 (pinned checksum) is installed and `~/.config/glab-cli` is
|
||||
mounted read-write, as described in the ecaas document (tokens included).
|
||||
|
||||
Legacy `serv_roma-capitale-*` modules target Java 21 / Spring Boot 3.3.4 and
|
||||
are not covered by this image's JDK.
|
||||
|
||||
The workspace is multi-repo and not a Git repository itself; open
|
||||
`~/Work/sipo/cdp` from Fedora WSL. Maven needs the internal Nexus (VPN) and
|
||||
`-s settings.xml`, as described in the workspace `AGENTS.md`.
|
||||
|
||||
```sh
|
||||
ansible-playbook ansible/site.yml --limit deadalus --tags cdp_devcontainer -K
|
||||
```
|
||||
|
||||
The deploy writes `~/Work/sipo/cdp/.devcontainer/` (`devcontainer.json`,
|
||||
`Dockerfile`, `bashrc`, `bashrc.aliases`), backing up changed files. It shares
|
||||
the rendered Git configuration in `~/.local/state/ecaas-devcontainer/git` with
|
||||
the ecaas container and therefore also requires the ecaas GitLab CA. Then run
|
||||
**Dev Containers: Reopen in Container**. The `ANTHROPIC_AUTH_TOKEN` forwarding
|
||||
and credential caveats are the same as for ecaas.
|
||||
|
||||
Verify inside: `java -version`, `mvn -v`, `node -v` (v20.18.3), `docker info`.
|
||||
@@ -19,14 +19,16 @@ Do not use the production context to build or open the workspace.
|
||||
|
||||
The container uses Java 11 for the application and Maven, and Java 21 only for
|
||||
the Java and Spring language servers. VS Code installs the Java and Spring Boot
|
||||
extension packs, XML, YAML, Claude Code and Cline inside the container. The Java
|
||||
extension packs, XML, YAML and the VSCode Great Icons theme (selected as the
|
||||
file icon theme) inside the container. The Java
|
||||
pack includes Maven, the Java debugger and test integration. Prefer the project's
|
||||
Maven wrapper where present. Node is provided for the Claude and Cline CLIs.
|
||||
|
||||
Git is installed in the container. The image uses the repository's portable Bash
|
||||
configuration: prompt with Git status, aliases, history search, completion,
|
||||
`fzf` and `zoxide`. The image
|
||||
does not load the WSL host's Mise hook, production aliases, or Bash history.
|
||||
`fzf` and `zoxide`. The shared `.bashrc.aliases` is copied minus the
|
||||
production `npm-tunnel` alias. The image
|
||||
does not load the WSL host's production aliases or Bash history.
|
||||
Run the deploy and rebuild the container to pick up changes to the shared Bash
|
||||
configuration.
|
||||
|
||||
@@ -49,27 +51,58 @@ Open the project from Fedora WSL so VS Code Dev Containers can reuse WSL's
|
||||
HTTPS credential helper (including an existing `.git-credentials` used by
|
||||
`credential.helper=store`) and forward the SSH agent if configured. GPG
|
||||
signing remains enabled and needs the work key available through the GPG
|
||||
agent. No credential file, SSH private key, or GPG private key is copied or
|
||||
mounted by the playbook. Do not forward a production SSH identity to this
|
||||
agent. The WSL `~/.m2` (repository cache and `settings*.xml`, which may hold Maven
|
||||
server credentials) is bind-mounted read-write at `/home/vscode/.m2`. No other
|
||||
credential file, SSH private key, or GPG private key is copied or mounted by
|
||||
the playbook. Do not forward a production SSH identity to this
|
||||
development workspace.
|
||||
|
||||
To verify GitLab access from the container without changing the repo, run
|
||||
`git ls-remote origin HEAD` after checking that `origin` is the expected
|
||||
GitLab repository.
|
||||
|
||||
## Docker
|
||||
|
||||
The `docker-outside-of-docker` Dev Container feature installs the Docker CLI
|
||||
and Compose plugin and shares the local Fedora WSL engine's socket
|
||||
(`/var/run/docker.sock`) with the container. Containers started from inside are
|
||||
siblings on the WSL engine, and bind-mount sources resolve on the WSL host.
|
||||
The socket grants root-equivalent control of that engine, and the container
|
||||
never sees the host's Docker contexts, so the production context is
|
||||
unreachable. Verify with `docker info` and `docker compose version`.
|
||||
|
||||
## GitLab CLI
|
||||
|
||||
`glab` 1.114.0 is installed from the official `.deb` with a pinned SHA-256
|
||||
checksum (amd64 and arm64). The WSL `~/.config/glab-cli` is bind-mounted
|
||||
read-write at `/home/vscode/.config/glab-cli`, so hosts, API tokens and
|
||||
`skip_tls_verify` settings are shared with the host and readable by anything in
|
||||
the container; changes made by `glab` inside affect the WSL configuration.
|
||||
`GITLAB_TOKEN` and similar variables from the host are not forwarded.
|
||||
|
||||
## Agent configuration and smoke test
|
||||
|
||||
Claude and Cline seed only the supported settings, instructions, rules and
|
||||
skills present in the Fedora home into `~/.local/state/ecaas-devcontainer/`
|
||||
on the host. The initial import does not overwrite existing container settings
|
||||
or synchronize later changes back to WSL. Rules and skills imported from WSL
|
||||
must be trusted; host paths and tools referenced by them may need adaptation.
|
||||
Dedicated credential stores, provider files, VS Code global storage, and MCP
|
||||
configuration are not imported. Do not embed secrets in the settings or rules
|
||||
being imported. Sign in or configure providers inside the container when
|
||||
prompted; legacy Cline settings kept only in VS Code are not migrated.
|
||||
The state directory is private and must not be committed. Neither the Docker
|
||||
socket nor the full host home is mounted.
|
||||
Claude and Cline use the WSL configuration directly: `~/.claude` and `~/.cline`
|
||||
are bind-mounted read-write at `/home/vscode/.claude` and `/home/vscode/.cline`,
|
||||
and `~/.config/ai` read-only at `/home/vscode/.config/ai`. Settings, rules,
|
||||
skills, MCP configuration, sessions and **credential stores** are therefore
|
||||
shared with, and visible to, the container, and changes made inside it affect
|
||||
the WSL home. Host paths and tools referenced by rules or skills may need
|
||||
adaptation. The WSL login is the `ANTHROPIC_AUTH_TOKEN` exported by
|
||||
`~/.bashrc.d/60-claude-code.sh`, not the OAuth file. `remoteEnv` forwards it with
|
||||
`${localEnv:ANTHROPIC_AUTH_TOKEN}`: the value is never written to the repository
|
||||
or the image, but it is visible to processes in the container. VS Code must
|
||||
therefore be started from a WSL shell that exports it (`code .` after opening a
|
||||
new terminal; fully close any running VS Code server first). The endpoint and
|
||||
model come from the mounted `settings.json`. With `CLAUDE_CONFIG_DIR` set, Claude reads its account state from
|
||||
`~/.claude/.claude.json` instead of `~/.claude.json`, so the playbook seeds the
|
||||
missing `oauthAccount`, `hasCompletedOnboarding` and `userID` keys there from
|
||||
the WSL file without overwriting existing keys (`~/.claude.json` itself is not
|
||||
mounted); VS Code global storage is not shared
|
||||
either, so legacy Cline settings kept only there are not migrated. The full
|
||||
host home is not mounted. `~/.local/state/ecaas-devcontainer/` now holds only
|
||||
the rendered Git configuration.
|
||||
|
||||
|
||||
From the integrated terminal inside the Dev Container, verify:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user