3.5 KiB
3.5 KiB
Console CI runner (offline-friendly)
Status: runner spec + CI now wired to PRs; runner image scaffold + CI build workflow now available with baked npm + Playwright cache.
Runner profile
- OS: Ubuntu 22.04 LTS (x86_64) with Docker available for Playwright deps if needed.
- Node: 20.x (LTS). Enable corepack; prefer npm (default) to avoid extra downloads.
- Caches:
- npm:
~/.npmkeyed bysrc/Web/package-lock.jsonhash. - Playwright:
~/.cache/ms-playwrightpre-seeded with Chromium sonpm test -- --browsers=ChromeHeadlesscan run offline. Seed once usingnpx playwright install chromiumon a connected runner, then snapshot the directory into the runner image. - Angular build cache: optional
~/.cache/angularif using angular.json cache; safe to keep.
- npm:
- Artifacts retention: keep lint/test/build outputs 14 days; limit to 500 MB per run (coverage + dist + test reports). Artifacts path:
artifacts/(dist, coverage, junit/trx if produced).
Pipeline steps (expected)
- Checkout
- Node 20 setup with npm cache restore (package-lock at
src/Web/package-lock.json). - Install:
npm ci --prefer-offline --no-audit --progress=falseinsrc/Web. - Lint:
npm run lint -- --no-progress. - Unit:
npm test -- --watch=false --browsers=ChromeHeadless --no-progress(headless Chromium from pre-seeded cache). - Build:
npm run build -- --configuration=production --progress=false. - Artifact collect:
dist/,coverage/, anytest-results/**.
Offline/airgap notes
- Do not hit external registries during CI; rely on pre-seeded npm mirror or cached tarballs. Runner image should contain npm cache prime. If mirror is used, set
NPM_CONFIG_REGISTRY=https://registry.npmjs.orgequivalent mirror URL inside the runner; default pipeline does not hard-code it. - Playwright browsers must be pre-baked; the workflow will not download them.
Runner image (with baked caches)
- Dockerfile:
ops/devops/console/Dockerfile.runner(Node 20, npm cache, Playwright Chromium cache). Builds withnpm ci+playwright install chromium --with-depsduring the image build. - Build locally:
IMAGE_TAG=stellaops/console-runner:offline OUTPUT_TAR=ops/devops/artifacts/console-runner/console-runner.tar ops/devops/console/build-runner-image.shOUTPUT_TARoptional; when set, the script saves the image for airgap transport.
- Runner expectations:
NPM_CONFIG_CACHE=~/.npm,PLAYWRIGHT_BROWSERS_PATH=~/.cache/ms-playwright(paths already baked). Register the runner with a label (e.g.,console-ci) and point.gitea/workflows/console-ci.ymlat that runner pool. - CI build helper:
ops/devops/console/build-runner-image-ci.shwraps the build, sets a run-scoped tag, emits metadata JSON, and saves a tarball underops/devops/artifacts/console-runner/. - CI workflow:
.gitea/workflows/console-runner-image.yml(manual + path-trigger) builds the runner image and uploads the tarball + metadata as an artifact namedconsole-runner-image-<run_id>.
Seeding Playwright cache (one-time per runner image, host-based option)
ops/devops/console/seed_playwright.sh
# then bake ~/.cache/ms-playwright into the runner image or mount it on the agent
How to run
- PR-triggered via
.gitea/workflows/console-ci.yml; restrict runners to images with baked Playwright cache. - Manual
workflow_dispatchremains available for dry runs or cache updates. - To refresh the runner image, run the
console-runner-imageworkflow or executeops/devops/console/build-runner-image-ci.shlocally to generate a tarball and metadata for distribution.