Worker read-only mounts: reserve relocated install dirs, portable test fixtures, recursive read-only

Open
#67 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, python, shell
Domain
devops, testing

Research direction

Start with setup-scripts/debian13-worker/check-ro-mounts.sh, then trace how load_env, run-fleet.sh, install-release.sh and the Makefile pass the effective directories. Read the named Bats tests and run them with relocated paths and a checkout under a reserved prefix. For recursive read-only behavior, perform the described Debian 13 worker check and document the result; done means all acceptance criteria pass, including compatibility and the Unreleased changelog entry.

Written by the indexing model from the issue text.

Description

client enhancement P3

Problem

setup-scripts/debian13-worker/check-ro-mounts.sh validates WORKER_RO_MOUNTS. Three gaps remain.

  1. The reserved list is fixed. RESERVED is hardcoded (setup-scripts/debian13-worker/check-ro-mounts.sh:63) and covers the default config and home dirs only. A relocated CONFIG_DIR (setup-scripts/debian13-worker/lib.sh:29) or WORKER_HOME (setup-scripts/debian13-worker/lib.sh:276) is not reserved, and the worker INSTALL_DIR (ops/release/install-release.sh:507) is not reserved even at its default. A mount of one of those dirs passes the validator. Those dirs can hold the worker env files and setup.env.
  2. Test fixtures depend on the checkout path. The bats tests create fixtures with mktemp -d "${BATS_TEST_DIRNAME}/ro-fixture.XXXXXX" (setup-scripts/debian13-worker/tests/test_check_ro_mounts.bats:18, setup-scripts/debian13-worker/tests/test_makefile_ro_mounts.bats:36, setup-scripts/debian13-worker/tests/test_run_fleet.bats:187, ops/release/tests/test_install_release.bats:73). A checkout under a reserved prefix (for example /tmp, /var or a home dir in the list) makes every positive test fail, because the validator rejects the fixture path.
  3. :ro may not be recursive. The Makefile mounts each entry with -v $(d):$(d):ro (Makefile:329). Depending on the Podman and crun versions, a filesystem mounted under a declared dir may stay writable inside the container. Podman offers rro for a recursive read-only mount. This has not been checked.

Proposed change

  1. Add an optional --reserve <path> argument (repeatable) to check-ro-mounts.sh. load_env (setup-scripts/debian13-worker/lib.sh:327), run-fleet.sh (setup-scripts/debian13-worker/run-fleet.sh:141), install-release.sh and the Makefile (Makefile:956) pass the effective CONFIG_DIR, WORKER_HOME and INSTALL_DIR. The rule stays in one script.
  2. Add a fixture root for the tests (for example RO_FIXTURE_ROOT). When it resolves under a reserved prefix, skip with a clear message instead of failing.
  3. Test on a Debian 13 worker with a tmpfs mounted under a declared dir. If it stays writable, use rro when the installed Podman supports it, or document that submounts are not covered.

Compatibility

  • --reserve is a new optional argument. Callers that do not pass it behave as today.
  • A host whose WORKER_RO_MOUNTS overlaps a newly reserved dir would fail validation, and make up client would stop. Guard: in the first release, a collision with a path added through --reserve logs a warning and does not fail. It fails in a later release, announced in the CHANGELOG.
  • rro is used only when the installed Podman accepts it. Otherwise the mount stays :ro, so a worker on an older Podman still starts.

Acceptance criteria

  • check-ro-mounts.sh --reserve <dir> '<dir>/sub' reports the collision (warning in the first release) and names the reserved dir (bats test).
  • The callers pass the effective CONFIG_DIR, WORKER_HOME and INSTALL_DIR (bats test with relocated values).
  • The bats suites pass from a checkout under a reserved prefix, or skip with a clear message.
  • A documented manual check shows whether a submount under a declared dir is writable inside the container, and the result is applied (rro or a documented limit).
  • Existing deployments keep working without config changes: a WORKER_RO_MOUNTS accepted today still lets make up client start the worker in this release.
  • A worker on a Podman without rro support still starts with :ro mounts.
  • CHANGELOG entry under Unreleased, including the planned switch from warning to error.
Dominant language
Python
Stars
0
Forks
0
Avg merge
1d 1h
Merged PRs (30d)
10

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AInvirion/orcaster

All issues in AInvirion/orcaster

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.