Skip to content

Radical trim to MVP - #238

Merged
gilesknap merged 36 commits into
mainfrom
prototype/attach-hotfix
Sep 12, 2026
Merged

gilesknap merged 36 commits into
mainfrom
prototype/attach-hotfix

Conversation

@gilesknap

@gilesknap gilesknap commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Radically reduce Podbench to a small, working MVP for attaching a debugging seat and iterating on application source inside Kubernetes.

  • Capless ephemeral seats use the target identity and stock SSH / VS Code Remote-SSH over kubectl exec.
  • Durable workload-scoped PVCs support source initialization, Python dependency installation, editing, child-process restart, reinstall, and retirement.
  • hotfix enable SERVICE_DIRECTORY derives configuration from a live workload and edits IOC and services-template BlueAPI Helm wiring for GitOps review. hotfix values remains the generic manual path with overrides.
  • Publish the Podbench library Helm chart and its values schema; combine attached-seat and hotfix information in podbench status.
  • Native debugging uses GDB and the target filesystem. Hotfix initialization supplies an LD_PRELOAD shim that opts dynamically linked processes into Yama ptrace access without SYS_PTRACE.
  • podbench debug --python PID injects debugpy through GDB on demand. BlueAPI starts normally with debug.enabled: false; restarting the hotfix child removes the injected debugger after a session.
  • Keep the implementation small, with Python files below 300 lines and concise README documentation.

Validation

The head commit passes GitHub CI: lint/type checking, Python 3.11–3.14 checks, distribution build, Helm packaging, and container build. The published prototype image was exercised in t11-beamline:

  • Camera and motorsim IOCs: hotfix checkout/restart and real native GDB breakpoint/backtrace checks.
  • EPICS gateways: CA and PVA child restarts, native CA GDB breakpoint/backtrace, and a successful Channel Access query through the Service.
  • BlueAPI: source checkout and reinstall, health endpoint, GDB injection of debugpy, and a real DAP breakpoint in health_probe using the packaged CLI.
  • Durable hotfix state survives pod replacement; attaching again recreates the ephemeral seat.

All four workloads remain hotfix-wired for continued testing, with Bound PVCs, one seat each, Ready containers, and Synced/Healthy Argo applications. The final recreated pods have zero container restarts; an earlier BlueAPI debugger cleanup did trigger liveness-related container restarts, tracked as follow-up work.

MVP boundaries

Automatic Helm editing supports the documented chart shapes and requires a live workload. IDE/DAP connection and port forwarding remain manual. DAP disconnect does not unload debugpy, so a hotfix restart is required. BlueAPI restart/probe timing needs further hardening.

This PR merges the tested MVP only; no release or new tag is requested.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 252 files, which is 152 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e2375344-a26a-412b-a489-fe9695ab665e

📥 Commits

Reviewing files that changed from the base of the PR and between edfaf6d and b596ad1.

⛔ Files ignored due to path filters (2)
  • docs/images/dls-logo.svg is excluded by !**/*.svg
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (252)
  • .agents/skills/gkcluster-t11/SKILL.md
  • .agents/skills/gkcluster-t11/agents/openai.yaml
  • .agents/skills/gkcluster-t11/references/t11.md
  • .agents/skills/memo/SKILL.md
  • .agents/skills/memo/agents/openai.yaml
  • .agents/skills/podbench-live-testing/SKILL.md
  • .agents/skills/podbench-live-testing/agents/openai.yaml
  • .agents/skills/podbench-live-testing/references/attach.md
  • .agents/skills/podbench-live-testing/references/demo-cluster.md
  • .agents/skills/podbench-live-testing/references/hotfix.md
  • .agents/skills/vscode-workspace-title-colors/SKILL.md
  • .agents/skills/vscode-workspace-title-colors/agents/openai.yaml
  • .claude/evidence/phase1-prune-on-sync.md
  • .claude/evidence/phase10-editor-first-on-live-p47.md
  • .claude/evidence/phase2-from-pod-on-p47.md
  • .claude/evidence/phase5-live-run-on-p47.md
  • .claude/evidence/phase5-the-workflow-on-p47.md
  • .claude/evidence/phase7-the-contradiction.md
  • .claude/evidence/phase7-the-live-walk.md
  • .claude/evidence/phase7-vscode-and-the-two-failures.md
  • .claude/evidence/phase8-vscode-actually-debugs-on-p47.md
  • .claude/evidence/phase8-why-the-adapter-never-answers.md
  • .claude/evidence/phase9-vscode-is-slick-on-a-p47-replica.md
  • .claude/plans/attach-endgame.md
  • .claude/plans/editor-first-and-ordinary-git.md
  • .claude/plans/hotfix-after-the-first-live-run.md
  • .claude/plans/hotfix-becomes-a-workflow.md
  • .claude/plans/hotfix-becomes-easy-to-drive.md
  • .claude/plans/hotfix-beside-the-app.md
  • .claude/plans/the-claim-holds-the-seat.md
  • .claude/plans/vscode-actually-debugs.md
  • .claude/plans/vscode-attach-is-slick.md
  • .claude/skills/ephemeral-containers/SKILL.md
  • .claude/skills/gdb-across-namespaces/SKILL.md
  • .claude/skills/ghcr-registry/SKILL.md
  • .claude/skills/k3s-test-bed/SKILL.md
  • .claude/skills/ssh-over-exec/SKILL.md
  • .claude/skills/stacked-worktree-prs/SKILL.md
  • .claude/skills/terminal-reports/SKILL.md
  • .claude/skills/vscode-in-a-seat/SKILL.md
  • .coderabbit.yaml
  • .copier-answers.yml
  • .dockerignore
  • .github/CONTRIBUTING.md
  • .github/ISSUE_TEMPLATE/bug_report.md
  • .github/ISSUE_TEMPLATE/issue.md
  • .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
  • .github/pages/index.html
  • .github/pages/make_switcher.py
  • .github/scripts/ghcr_audit.py
  • .github/scripts/ghcr_prune.py
  • .github/workflows/_container.yml
  • .github/workflows/_dist.yml
  • .github/workflows/_docs.yml
  • .github/workflows/_e2e.yml
  • .github/workflows/_helm.yml
  • .github/workflows/_pypi.yml
  • .github/workflows/_release.yml
  • .github/workflows/_test.yml
  • .github/workflows/_tox.yml
  • .github/workflows/ci.yml
  • .github/workflows/periodic.yml
  • .gitignore
  • .pre-commit-config.yaml
  • .vscode/extensions.json
  • .vscode/launch.json
  • .vscode/settings.json
  • .vscode/tasks.json
  • AGENTS.md
  • CLAUDE.md
  • Charts/podbench-hotfix-claim/.helmignore
  • Charts/podbench-hotfix-claim/.schema.config.yaml
  • Charts/podbench-hotfix-claim/Chart.yaml
  • Charts/podbench-hotfix-claim/templates/_helpers.tpl
  • Charts/podbench-hotfix-claim/templates/pvc.yaml
  • Charts/podbench-hotfix-claim/values.schema.json
  • Charts/podbench-hotfix-claim/values.yaml
  • Charts/podbench/.helmignore
  • Charts/podbench/.schema.config.yaml
  • Charts/podbench/Chart.yaml
  • Charts/podbench/example.values.yaml
  • Charts/podbench/templates/_helpers.tpl
  • Charts/podbench/templates/configmap-seat-identity.yaml
  • Charts/podbench/templates/pvc-hotfix-project.yaml
  • Charts/podbench/templates/pvc-scratch.yaml
  • Charts/podbench/templates/rbac.yaml
  • Charts/podbench/values.schema.json
  • Charts/podbench/values.yaml
  • Dockerfile
  • README.md
  • docs/_api.rst
  • docs/_templates/custom-module-template.rst
  • docs/conf.py
  • docs/explanations.md
  • docs/explanations/architecture.md
  • docs/explanations/attach-flow.md
  • docs/explanations/decisions.md
  • docs/explanations/decisions/0001-record-architecture-decisions.md
  • docs/explanations/decisions/0002-switched-to-python-copier-template.md
  • docs/explanations/decisions/0003-publish-to-pypi-and-drop-the-kubectl-plugin.md
  • docs/explanations/decisions/0004-adopt-typer-for-the-cli.md
  • docs/explanations/decisions/0005-spend-a-second-runtime-dependency-on-round-tripping-yaml.md
  • docs/explanations/decisions/COPYME
  • docs/explanations/design-brief.md
  • docs/explanations/dev-flow.md
  • docs/explanations/hotfix-flow.md
  • docs/explanations/security.md
  • docs/explanations/spikes.md
  • docs/explanations/spikes/phase0-report.md
  • docs/explanations/spikes/s1.md
  • docs/explanations/spikes/s2.md
  • docs/explanations/spikes/s3.md
  • docs/explanations/spikes/s4.md
  • docs/explanations/spikes/s5.md
  • docs/explanations/spikes/s6.md
  • docs/explanations/spikes/s7.md
  • docs/explanations/status.md
  • docs/explanations/ways-in.md
  • docs/genindex.md
  • docs/how-to.md
  • docs/how-to/attach-to-a-pod.md
  • docs/how-to/contribute.md
  • docs/how-to/debug-with-gdb.md
  • docs/how-to/hotfix-a-running-pod.md
  • docs/how-to/iterate-on-python.md
  • docs/how-to/run-container.md
  • docs/how-to/vscode-remote-ssh.md
  • docs/index.md
  • docs/reference.md
  • docs/reference/cli.md
  • docs/reference/glossary.md
  • docs/tutorials.md
  • docs/tutorials/first-session.md
  • docs/tutorials/setup.md
  • image/README.md
  • image/bin/gdb-podbench
  • image/bin/podbench
  • image/gdb/rust_printers.py
  • justfile
  • k8s/hotfix-harness/podbench-test-fastcs.yaml
  • k8s/make-claude-sa.sh
  • kind.yaml
  • pyproject.toml
  • renovate.json
  • schemas/podbench-hotfix-claim.schema.json
  • src/podbench/__init__.py
  • src/podbench/__main__.py
  • src/podbench/agent.py
  • src/podbench/attach_cli.py
  • src/podbench/budget.py
  • src/podbench/cli.py
  • src/podbench/console.py
  • src/podbench/dap.py
  • src/podbench/debug.py
  • src/podbench/debug_model.py
  • src/podbench/dev.py
  • src/podbench/doctor.py
  • src/podbench/doctor_checks.py
  • src/podbench/editor.py
  • src/podbench/elf.py
  • src/podbench/execfile.py
  • src/podbench/flavour.py
  • src/podbench/gdb_support.py
  • src/podbench/gdbcmd.py
  • src/podbench/hotfix.py
  • src/podbench/hotfix_blueapi.py
  • src/podbench/hotfix_core.py
  • src/podbench/hotfix_enable.py
  • src/podbench/hotfix_runtime.py
  • src/podbench/hotfix_status.py
  • src/podbench/hotfix_values.py
  • src/podbench/jsonc.py
  • src/podbench/kubectl.py
  • src/podbench/launcher.py
  • src/podbench/model.py
  • src/podbench/oci.py
  • src/podbench/probe.py
  • src/podbench/proc.py
  • src/podbench/provision.py
  • src/podbench/ptrace_any.c
  • src/podbench/python_debug.py
  • src/podbench/resize.py
  • src/podbench/spec.py
  • src/podbench/ssh_agent.py
  • src/podbench/ssh_transport.py
  • src/podbench/sshcfg.py
  • src/podbench/status.py
  • src/podbench/vscode.py
  • tests/conftest.py
  • tests/data/proc/blueapi.txt
  • tests/data/proc/opis.txt
  • tests/data/proc/rabbitmq.txt
  • tests/data/proc/simdet.txt
  • tests/e2e/README.md
  • tests/e2e/__init__.py
  • tests/e2e/apps/README.md
  • tests/e2e/apps/deny-sys-ptrace.yaml
  • tests/e2e/apps/distroless-c.yaml
  • tests/e2e/apps/dls-ioc.yaml
  • tests/e2e/apps/nonroot-gid.yaml
  • tests/e2e/apps/python-service.yaml
  • tests/e2e/apps/strip-sys-ptrace.yaml
  • tests/e2e/conftest.py
  • tests/e2e/test_dls_ioc.py
  • tests/e2e/test_nonroot_gid_identity.py
  • tests/e2e/test_s1_transport.py
  • tests/e2e/test_s3_gdb.py
  • tests/e2e/test_s4_iterate.py
  • tests/e2e/test_s5_ladder.py
  • tests/e2e/test_shadowed_exec_file.py
  • tests/e2e/test_uvx_detached.py
  • tests/proc_samples.py
  • tests/test_agent.py
  • tests/test_budget.py
  • tests/test_chart_contract.py
  • tests/test_cli.py
  • tests/test_console.py
  • tests/test_dap.py
  • tests/test_dev.py
  • tests/test_doctor.py
  • tests/test_editor.py
  • tests/test_elf.py
  • tests/test_execfile.py
  • tests/test_flavour.py
  • tests/test_gdb_wrapper.py
  • tests/test_gdbcmd.py
  • tests/test_ghcr_audit.py
  • tests/test_ghcr_prune.py
  • tests/test_hotfix.py
  • tests/test_hotfix_claim_chart.py
  • tests/test_image_bin.py
  • tests/test_image_tag.py
  • tests/test_ioc_instance_contract.py
  • tests/test_jsonc.py
  • tests/test_kubectl.py
  • tests/test_launcher.py
  • tests/test_oci.py
  • tests/test_packaging.py
  • tests/test_probe.py
  • tests/test_proc.py
  • tests/test_provision.py
  • tests/test_resize.py
  • tests/test_spec.py
  • tests/test_sshcfg.py
  • tests/test_version.py
  • tests/test_vpn_api_tunnel.py
  • tests/test_vscode.py
  • tools/vscode-bridge/README.md
  • tools/vscode-bridge/code-with-bridge
  • tools/vscode-bridge/extension/extension.js
  • tools/vscode-bridge/extension/package.json
  • tools/vscode-bridge/vsc.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

@gilesknap
gilesknap force-pushed the prototype/attach-hotfix branch from 5b759e4 to 4edf3a3 Compare September 12, 2026 06:23
@gilesknap
gilesknap marked this pull request as ready for review September 12, 2026 12:55
@gilesknap
gilesknap merged commit bea06fe into main Sep 12, 2026
21 checks passed
@gilesknap gilesknap changed the title Reduce podbench to attach and hotfix prototype Radical trim to MVP Sep 12, 2026
gilesknap added a commit that referenced this pull request Sep 12, 2026
Harden attach and hotfix usability after #238
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.

1 participant