Skip to content

docs: consolidate Claude Code deployment docs and fix settings.json mount#181

Open
jwm4 wants to merge 8 commits into
red-hat-data-services:mainfrom
jwm4:docs/claude-code-deployment-followup-2
Open

docs: consolidate Claude Code deployment docs and fix settings.json mount#181
jwm4 wants to merge 8 commits into
red-hat-data-services:mainfrom
jwm4:docs/claude-code-deployment-followup-2

Conversation

@jwm4

@jwm4 jwm4 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Consolidates three overlapping documents (deployment/README.md, mlflow-tracing.md, docs/claude-code-vllm-direct.md) into a single agents/claude-code/README.md, deduplicating repeated build, interactive mode, and debug mode steps across all four backend options
  • Fixes settings.json ConfigMap mount to support MLflow autolog: stages the ConfigMap at a read-only path (/etc/claude-config/settings.json) and copies it to the writable PVC in the entrypoint, so mlflow autolog can inject hooks at runtime
  • Adds commented-out MLflow and context window env var placeholders to all four deployment manifests
  • Adds MLflow UI access instructions (use gateway URL from ConsoleLink, login with deployer identity)
  • Adds 32K context window example to the configuration table
  • Reverts test-specific values in deployment-vllm.yaml to placeholders

Test plan

  • Deployed Claude Code with vLLM backend on OpenShift using these manifests
  • Verified settings.json copy logic: entrypoint copies from staged path, MLflow autolog successfully injects hooks
  • Ran inference ("Say hello") and confirmed traces recorded in MLflow experiment
  • Verified MLflow UI accessible via gateway URL as cluster-admin
  • Confirmed all four manifests have consistent structure (MLflow placeholders, settings mount path)

From Bill Murdock with assistance from Claude Code.

🤖 Generated with Claude Code

jwm4 and others added 2 commits June 12, 2026 10:31
Add "Retrieving Files from the Container" section showing how to use
oc cp to download generated files (reports, documents, code) from the
container to a local machine without pushing to a Git repository.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ount

Consolidate three overlapping documents (deployment/README.md,
mlflow-tracing.md, docs/claude-code-vllm-direct.md) into a single
agents/claude-code/README.md. Deduplicate repeated build, interactive
mode, and debug mode steps across all four backend options.

Fix settings.json ConfigMap mount to support MLflow autolog: stage
the ConfigMap at a read-only path (/etc/claude-config/settings.json)
and copy it to the writable PVC in the entrypoint, so mlflow autolog
can inject hooks at runtime.

Add commented-out MLflow and context window env var placeholders to
all four deployment manifests. Add MLflow UI access instructions
(use gateway URL from ConsoleLink, login with deployer identity).
Add 32K context window example to the configuration table. Revert
test-specific values in deployment-vllm.yaml to placeholders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jwm4 jwm4 requested a review from a team as a code owner June 12, 2026 17:30
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 299fbee2-915c-436c-9bcc-e9e94d6e6f14

📥 Commits

Reviewing files that changed from the base of the PR and between f01beac and a0d1a65.

📒 Files selected for processing (8)
  • agents/claude-code/README.md
  • agents/claude-code/deployment/Containerfile
  • agents/claude-code/deployment/deployment-ogx-vllm.yaml
  • agents/claude-code/deployment/deployment-vertex.yaml
  • agents/claude-code/deployment/deployment-vllm.yaml
  • agents/claude-code/deployment/deployment.yaml
  • agents/claude-code/deployment/entrypoint.sh
  • agents/claude-code/mlflow-tracing.md
✅ Files skipped from review due to trivial changes (2)
  • agents/claude-code/mlflow-tracing.md
  • agents/claude-code/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • agents/claude-code/deployment/deployment-ogx-vllm.yaml

📝 Walkthrough

Walkthrough

Consolidates OpenShift deployment docs into a central Claude Code guide, stages ConfigMap data under /etc in all deployment manifests with optional MLflow env blocks, tweaks the Containerfile, and implements entrypoint logic to copy/symlink staged settings/skills and pre-approve Anthropic API keys.

Changes

Claude Code OpenShift Deployment Documentation & Manifests

Layer / File(s) Summary
Comprehensive Deployment Guide
agents/claude-code/README.md
Adds a large reference covering licensing, prerequisites, image build, four backend deployment options (Anthropic, Vertex, vLLM direct, vLLM+OGX), usage, configuration (persistence, MCP, skills, settings.json override), optional MLflow tracing setup, troubleshooting, and cleanup.
Deployment directory README (concise)
agents/claude-code/deployment/README.md
Replaces prior step-by-step file with a short overview and table referencing the main Claude Code OpenShift guide and key deployment artifacts.
Manifest updates: staging paths & optional MLflow
agents/claude-code/deployment/deployment*.yaml
All deployment YAMLs stage skills and settings under /etc/* read-only mounts (/etc/claude-skills, /etc/claude-config/settings.json), remove embedded default SKILL.md, and add commented optional MLflow env blocks. deployment-vllm.yaml and OGX variant add/adjust CLAUDE_MODEL/ANTHROPIC_BASE_URL placeholders.
Entrypoint staging & API-key pre-approval
agents/claude-code/deployment/entrypoint.sh
Copies staged /etc/claude-config/settings.json into ${CLAUDE_CONFIG_DIR} when absent, symlinks /etc/claude-skills into the config dir, ensures group-writable PVC directories, and pre-approves ANTHROPIC_API_KEY in .claude.json (Vertex mode skipped).
Containerfile tweaks
agents/claude-code/deployment/Containerfile
Adds tar to installed packages and sets ENV HOME=... while preserving PATH augmentation for ~/.local/bin.
MLflow tracing & vLLM docs
agents/claude-code/mlflow-tracing.md, agents/claude-code/vllm/README.md
Refines MLflow tracing doc (Agent-side spans, privacy note, formatting) and expands vLLM README with a configuration reference, OpenShift deployment/route verification examples, env var table, limitations, and cleanup commands.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: consolidating Claude Code deployment documentation and fixing the settings.json mount point, which are the core objectives of this PR.
Description check ✅ Passed The description provides a clear summary of the changes (consolidation of docs, settings.json fix, environment variables, MLflow UI instructions) and includes a test plan showing the PR was validated on OpenShift.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

Large PR detected (2799 lines changed)

This PR exceeds 1200 lines of code changes (excluding lock files, generated content, and images). Large PRs are harder to review thoroughly and are more likely to introduce bugs.

Consider splitting this PR into smaller, focused changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@agents/claude-code/deployment/entrypoint.sh`:
- Around line 193-195: The startup copy unconditionally overwrites persisted
settings.json; change the logic around staged_settings/target_settings so we
only copy when target_settings does not already exist (or is empty) to preserve
runtime/user updates across restarts: check if "${target_settings}" exists and
is non-empty and skip the cp (calling log_info to state preservation), otherwise
copy staged_settings to target_settings and log the copy; update the conditional
around staged_settings and the log_info call in entrypoint.sh to reflect the new
behavior.

In `@agents/claude-code/mlflow-tracing.md`:
- Around line 42-48: Add an explicit privacy/retention warning noting that the
"Prompt / response" field captures full prompt and output text (which may
contain secrets, PII, or proprietary code) and that MLflow experiments/backends
must be treated as sensitive; update the documentation near the Claude Code hook
/ OTel spans section (adjacent to the table rows "Prompt / response" and
"Session ID") to state required retention policies, redaction/obfuscation
recommendations, and operator access controls, and include a short example of
mitigation steps (e.g., automatic redaction, encryption at rest, shorter
retention) so operators know how to handle traced data.

In `@agents/claude-code/README.md`:
- Around line 599-600: The README currently hardcodes `/workspace/.claude` for
where the entrypoint writes settings; update the wording to reference the
configurable environment variable `CLAUDE_CONFIG_DIR` (and the path
`${CLAUDE_CONFIG_DIR}/settings.json`) instead so the doc matches the entrypoint
behavior when persistence is disabled or the config dir is customized; change
the sentence that says "copied to `/workspace/.claude/settings.json`" to "copied
to `${CLAUDE_CONFIG_DIR}/settings.json` (the entrypoint writes to
$CLAUDE_CONFIG_DIR/settings.json)" and keep the note about the staged read-only
source `/etc/claude-config/settings.json` and the varying ConfigMap names
(`claude-settings`, `claude-vertex-settings`, `claude-vllm-settings`,
`claude-ogx-vllm-settings`).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: b8e49603-a2a2-4c8e-ac59-da74bf85ef1f

📥 Commits

Reviewing files that changed from the base of the PR and between 39af02c and f01beac.

📒 Files selected for processing (10)
  • agents/claude-code/README.md
  • agents/claude-code/deployment/README.md
  • agents/claude-code/deployment/deployment-ogx-vllm.yaml
  • agents/claude-code/deployment/deployment-vertex.yaml
  • agents/claude-code/deployment/deployment-vllm.yaml
  • agents/claude-code/deployment/deployment.yaml
  • agents/claude-code/deployment/entrypoint.sh
  • agents/claude-code/mlflow-tracing.md
  • agents/claude-code/vllm/README.md
  • docs/claude-code-vllm-direct.md
💤 Files with no reviewable changes (1)
  • docs/claude-code-vllm-direct.md

Comment thread agents/claude-code/deployment/entrypoint.sh Outdated
Comment thread agents/claude-code/mlflow-tracing.md
Comment thread agents/claude-code/README.md Outdated
@jwm4 jwm4 marked this pull request as draft June 12, 2026 17:43
jwm4 and others added 5 commits June 12, 2026 13:43
Remove inline sample skill from Anthropic and Vertex manifests to
match vLLM/OGX (all four now have empty skills ConfigMap). Move
example skill content and complete injection instructions into the
README, including the required items mapping that was previously
undocumented.

Testing confirmed that skills require the items mapping to create
the subdirectory structure Claude Code expects. Without it, files
appear flat and are not discovered.

Drop scheme prefix from URL placeholders (YOUR_VLLM_URL, YOUR_OGX_URL)
to avoid implying http vs https.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Preserve runtime settings.json across pod restarts instead of
unconditionally overwriting on every start. Update README to reference
CLAUDE_CONFIG_DIR variable instead of hardcoded path. Add privacy note
to mlflow-tracing.md about traced data containing sensitive content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ents

Replace misleading oc rollout restart with oc set image, which correctly
updates the deployment to use the new build. OpenShift pins deployments
to a specific image digest, so a restart alone recreates pods with the
old image.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ments

- Move skills ConfigMap mount to /etc/claude-skills/ with entrypoint
  symlink to prevent Kubernetes from creating /workspace/.claude/ as
  root on fresh PVCs
- Add chmod g+w to config/projects dirs for OpenShift group-writable
  requirement
- Add approve_api_key() to entrypoint to pre-approve configured API key,
  preventing interactive wizard authentication trap
- Add CLAUDE_MODEL env var to vLLM and OGX manifests (required for
  --model CLI flag)
- Add ENV HOME to Containerfile, removing need for export HOME in all
  oc exec examples
- Add tar to container image (required for oc cp)
- Add ANTHROPIC_BASE_URL examples (http internal, https external route)
- Add auth loop troubleshooting section with recovery script

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jwm4 jwm4 marked this pull request as ready for review June 12, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant