Skip to content

AITRAX-2990: codetogether-ai chart 0.2.5 - read-only root filesystem - #233

Draft
CodeTogetherBot wants to merge 2 commits into
devfrom
aitrax-2990-ai-read-only-root
Draft

CodeTogetherBot wants to merge 2 commits into
devfrom
aitrax-2990-ai-read-only-root

Conversation

@CodeTogetherBot

@CodeTogetherBot CodeTogetherBot commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

AITRAX-2990, public chart part: codetogether-ai 0.2.5 runs the container with a read-only root filesystem, as the internal chart does in CodeTogether-Inc/ct-ai#3222.

Draft until the image release. The default image.tag is latest. An image without ct-ai#3222 crash-loops with a read-only root, so this ships with, or after, the first release that includes it. ctai.readOnlyRootFilesystemMinImage is a placeholder until then, and CI fails until it is set:

  1. ct-ai#3222 merges and reaches a release.
  2. Set ctai.readOnlyRootFilesystemMinImage to that release's version, and appVersion to it or later (CI checks min ≤ appVersion).
  3. Merge, then dev→main.

What changes

  • securityContext.readOnlyRootFilesystem: true by default.

  • writableDirectories: an emptyDir on /opt/ctai/runtime, /opt/ctai/www, /opt/ctai/logs, /opt/ctai/tmp and /tmp. Each has enabled, mountPath and an optional sizeLimit (empty by default, to avoid evictions).

  • The chart refuses:

    • an extraVolumeMounts entry on a writable directory's path, unless that directory is disabled;
    • a disabled directory with no volume of the customer's on its path;
    • duplicate paths or volume names, and an entry that is not a map;
    • a relative path;
    • a non-boolean readOnlyRootFilesystem.

    Paths are compared after path.Clean.

  • The previous layout (no writableDirectories, writable container layer) is used:

    • with readOnlyRootFilesystem: false, for a pre-start hook that writes elsewhere;
    • when image.tag (or appVersion) is older than the minimum image. The leading x.y.z is compared, so 1.2.8000-hotfix counts, and NOTES warns;
    • after helm upgrade --reuse-values from a chart before 0.2.5, which has no readOnlyRootFilesystem.
  • README:

    • a "Read-only root filesystem" section: paths, a PVC example, the refusals and when the previous layout is used;
    • an upgrade note for customers who already mount a volume on one of these paths;
    • new rows in the values table.
  • CI (helm-template-check.yml):

    • the placeholder and min ≤ appVersion checks;
    • the default render, the three previous-layout cases (plus a suffixed old tag), a customer volume, and six refusals.

Test plan

  • Render matrix: latest, old and new tags (with v and suffixes), digest, false, --reuse-values, sizeLimit, custom entries.

  • The new CI block run locally. It passes with a real minimum and fails with the placeholder. Negative controls (guard removed, mounts left on with false) fail.

  • helm lint and the CI block with Helm 3.9.0 (what CI installs; its template and does not short-circuit, which the first push tripped on) and 3.15.4. actionlint shows only the existing actions/checkout@v3 warning.

  • CI on this PR: lint passes; the job fails only on the placeholder minimum image, as intended until the release.

  • Dev cluster, throwaway namespace (deleted): this chart with image b8762 (a ct-ai#3222 feature build) and a real properties secret.

    • root mounted ro;
    • the YAML generated in runtime/config/;
    • /healthz, /actuator/health, /, /portal/, /clients/, /trackers/, /metric-lineage/ all return 200.
  • /code-review (high): 9 findings. Fixed:

    • suffixed tags;
    • a non-map entry;
    • an entry without enabled;
    • volume-name collisions;
    • the README on strings;
    • the upgrade note;
    • a shared helper for NOTES.

    Not changed:

    • the placeholder, which is intentional;
    • nginx tmp/nginx, which the image's start-ctai creates since ct-ai#3222, verified on the cluster;
    • parent-path volumes, an edge case.
  • Set the minimum image and appVersion once the release exists.

🤖 Generated with Claude Code

danc094codetogether and others added 2 commits November 13, 2026 05:37
The container runs with readOnlyRootFilesystem: true and an emptyDir on each
directory the image writes (writableDirectories: runtime, www, logs, tmp, /tmp),
each switchable to a customer volume, with an optional sizeLimit. The chart
refuses a customer volume on a writable directory's path unless that directory
is disabled, a disabled directory with no volume on its path, duplicate paths and
volume names, and a non-boolean readOnlyRootFilesystem.

The previous layout is kept for readOnlyRootFilesystem: false, for an image tag
older than the first image that supports it (with a NOTES warning), and after
--reuse-values from a chart before 0.2.5. ctai.readOnlyRootFilesystemMinImage is
a placeholder until that release exists, and CI fails until it is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI installs Helm 3.9.0, whose template `and` evaluates every argument: with
image.tag latest the version is empty and semverCompare failed, so helm lint
failed. The comparison is nested in an if instead.

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

This branch has not been deployed

No deployments
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.

2 participants