Skip to content

feat: convert Module 08 into interactive autograded workspace - #1

Open
IshmaelRogers wants to merge 1 commit into
mainfrom
feat/interactive-workspace
Open

IshmaelRogers wants to merge 1 commit into
mainfrom
feat/interactive-workspace

Conversation

@IshmaelRogers

Copy link
Copy Markdown

What this does

Converts SWEXP Module 08 (Platform Engineering & Containerization) from a set of
lesson/lab markdown files into an interactive, autograded starter workspace, using the
same bats harness proven on Module 01.

Students no longer read lessons here — they author infrastructure-as-code (Dockerfiles,
docker-compose.yml, a CI workflow, k8s manifests) into starter files with # TODOs, and an
autograder scores each artifact. The conceptual lessons live in the LMS; resources/,
.devcontainer/, and the submission templates are kept.

Grading model (fast, deterministic, mostly Docker-free)

  • Dockerfiles — static grep/awk lint (pinned base, non-root USER, HEALTHCHECK,
    multi-stage, cache-ordered layers, --omit=dev, no baked secrets, complete .dockerignore).
  • compose / CI / k8s YAML — parsed with python3 (PyYAML) and policy-checked (services,
    health-gated depends_on, named volume, network segmentation/reachability, ordered CI
    gates, deploy needs build, SHA-image promotion, replicas/probes/limits/secretRef).
  • shell scripts — run directly under bats (the monorepo boundary check).
  • One real docker build of a tiny alpine image (lab-02) that must build and print
    forge-up — the only build in the whole module, so grading stays fast and reliable.

Harness

Reuses Module 01's scripts/grade.mjs (auto-discovers exercise folders under labs/ and
assignments/, parses TAP, runs the bash -n syntax gate), the Autograde GitHub Action,
package.json, and .gitignore. The syntax gate is hardened with nullglob so labs that
ship no solution.sh (most of them) don't break the glob. The workflow and dev container
ensure PyYAML is present for the YAML graders.

Exercises (10 folders, 59 tests)

Folder Student authors Graded by
labs/lab-00-setup config.yml + Dockerfile YAML parse + Dockerfile lint
labs/lab-01-monorepo solution.sh bats (boundary/cycle check)
labs/lab-02-dockerfile Dockerfile + .dockerignore + tiny build static lint + 1 real docker build
labs/lab-03-compose docker-compose.yml YAML parse
labs/lab-04-devcontainer package.json + devcontainer.json + lockfile reproducibility checks
labs/lab-05-prod-image multi-stage Dockerfile production-image lint
labs/lab-06-networking segmented docker-compose.yml YAML reachability
labs/lab-07-ci ci.yml pipeline policy parse
labs/lab-08-production deployment.yml (Deployment + Service) manifest policy parse
assignments/capstone all of the above under platform/ + solution.sh static + parse checks

Verification

  • Stub workspace: 12% (RED), exit 1 — every lab has at least one failing test (none falsely green).
  • Reference solution (built in a throwaway copy, then deleted — no answer keys shipped):
    100% (GREEN), exit 0, shell syntax clean, including the real lab-02 docker build.

Replace the lesson/lab markdown with a bats-based starter workspace where
students author infrastructure-as-code (Dockerfiles, docker-compose, a CI
workflow, and k8s manifests) and an autograder checks each artifact.

- Reuse the Module 01 bats harness: scripts/grade.mjs (auto-discovers
  labs/ + assignments/ exercise folders, parses TAP, shell-syntax gate),
  Autograde workflow, package.json, .gitignore.
- Harden the syntax gate with nullglob so labs without a solution.sh are
  tolerated (most author a Dockerfile/compose/manifest instead).
- Grading is fast and mostly Docker-free: Dockerfiles via static grep/awk
  lint; compose/CI/k8s YAML parsed with python3; shell scripts run under
  bats. Exactly one tiny real alpine 'docker build' (lab-02) proves an
  image actually builds.
- 9 labs (lab-00..lab-08) + an integrating capstone; 59 tests total.
- Keeps resources/, .devcontainer/, and submission templates.

Verified: stub workspace scores 12% (RED, exit 1); a reference solution
scores 100% (GREEN, exit 0) with the real docker build passing.
@github-actions

Copy link
Copy Markdown

Forge SWEXP — Module 08 autograde

Score: 7/59 tests (12%) · Shell syntax: ✅ clean

Exercise Tests Status
labs/lab-00-setup 0/6
labs/lab-01-monorepo 2/5
labs/lab-02-dockerfile 2/8
labs/lab-03-compose 0/6
labs/lab-04-devcontainer 0/6
labs/lab-05-prod-image 2/7
labs/lab-06-networking 0/4
labs/lab-07-ci 0/4
labs/lab-08-production 0/7
assignments/capstone 1/6

Keep going — open each exercise folder, complete the # TODOs in its starter (a Dockerfile, docker-compose.yml, ci.yml, deployment.yml, or solution.sh), and run npm test. The tests/*.bats files are the spec.

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