mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 06:17:25 +00:00
The per-matrix selection never picked anything but ext4. candidates() intersected what every distribution in the entry supports, and with the list the orchestrator passes - arch debian ubuntu fedora centos - that leaves ext4 alone: centos stream has no btrfs, zfs is debian/ubuntu only. btrfs was reachable only by stating it in the manual input. The intersection is right for swarm and wrong for the other two. distros.sh runs 00_one.sh per distribution and each round builds its own lab, so a swarm pick must hold in every round's nodes. compose and host carve the data root on the runner itself, whose OS is fixed; there DISTROS names the application images and has nothing to do with the filesystem underneath docker. A fourth argument says which, rather than parsing it out of the label, and guards with `:?` so a forgotten call site fails loudly. The runner pool omits zfs: the runner-image build installs neither the zfs userland nor linux-modules-extra, where the Ubuntu azure kernel keeps zfs.ko, so a drawn zfs would decline on every run. A stated one still overrides the pool and is marked required, so `filesystem: zfs` fails loudly instead of quietly falling back. The test executes the resolver rather than reading it, and pins the relation that breaks silently: the keys it writes to GITHUB_ENV are the keys the three workflows read. A typo on either side hands docker_dataroot.sh an empty string, which reports "no filesystem stated" and exits 0 - the feature switched off under a green run. Pool contents are policy and are not asserted; the per-distro expectation is derived from the resolver's own answers. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
256 lines
8.2 KiB
YAML
256 lines
8.2 KiB
YAML
name: "📦 Test: Deploy (compose)"
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
distros:
|
|
description: "Space-separated distro list"
|
|
required: true
|
|
type: string
|
|
whitelist:
|
|
description: "Optional space-separated whitelist of app ids"
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
lifecycles:
|
|
description: "Lifecycle envelope for discovery (comma/space-separated)."
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
blacklist:
|
|
description: "Optional space-separated app ids to drop from discovery"
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
marker:
|
|
description: "Optional suffix appended to the discover job name (e.g. ' ⭐' for the priority line)"
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
filesystem:
|
|
description: "Filesystem the docker data root runs on (ext4, btrfs, zfs). Empty picks one at random."
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
|
|
env:
|
|
INFINITO_DISTROS: ${{ inputs.distros }}
|
|
NIX_CONFIG: |
|
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
|
INFINITO_IMAGE_TAG: ci-${{ github.sha }}
|
|
INFINITO_GHCR_MIRROR_PREFIX: mirror
|
|
INFINITO_PLAYWRIGHT_KEEP: ${{ vars.INFINITO_PLAYWRIGHT_KEEP }}
|
|
INFINITO_APP_DISCOVERY_RUNNER: host
|
|
INFINITO_DEPLOY_MODE: compose
|
|
INFINITO_LIFECYCLES: ${{ inputs.lifecycles }}
|
|
INFINITO_BLACKLIST: ${{ inputs.blacklist }}
|
|
jobs:
|
|
discover:
|
|
name: 🪼 Compose (${{ inputs.distros }})${{ inputs.marker }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
outputs:
|
|
apps: ${{ steps.discover.outputs.apps }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7.0.0
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: 🔍 Resolve repository owner
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
echo "GITHUB_REPOSITORY_OWNER=$(scripts/meta/resolve/repository/owner.sh)" >> "$GITHUB_ENV"
|
|
|
|
- name: 📦 Install jq
|
|
shell: bash
|
|
run: ./scripts/install/apt.sh jq
|
|
|
|
- name: 📦 Install deps (jq + envsubst)
|
|
shell: bash
|
|
run: ./scripts/install/apt.sh jq gettext-base
|
|
|
|
- name: 🔧 Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
cache-dependency-path: pyproject.toml
|
|
|
|
- name: 📦 Install project (host venv)
|
|
shell: bash
|
|
run: make install
|
|
|
|
- name: 🔍 Resolve effective whitelist (diff vs origin/main)
|
|
id: resolve_wl
|
|
shell: bash
|
|
env:
|
|
INPUT_WHITELIST: ${{ inputs.whitelist }}
|
|
run: ./scripts/github/resolve/effective_whitelist.sh
|
|
|
|
- name: 🔍 Discover apps
|
|
id: discover
|
|
shell: bash
|
|
env:
|
|
INFINITO_WHITELIST: ${{ steps.resolve_wl.outputs.whitelist }}
|
|
run: ./scripts/github/resolve/output_apps.sh
|
|
|
|
- name: 🗺️ Render the plan into the run summary
|
|
shell: bash
|
|
run: |
|
|
source scripts/meta/env/load.sh
|
|
"${PYTHON}" -m cli.meta.ci.plan \
|
|
--distros "${{ inputs.distros }}" \
|
|
--whitelist "${{ steps.resolve_wl.outputs.whitelist }}" \
|
|
--priority "${{ inputs.blacklist }}" \
|
|
--modes "compose" \
|
|
--lifecycles "${{ inputs.lifecycles }}" \
|
|
>> "$GITHUB_STEP_SUMMARY"
|
|
|
|
compose:
|
|
name: 🐳 ${{ matrix.apps }}${{ matrix.variant && format(' {0}',matrix.variant) || '' }}
|
|
if: needs.discover.outputs.apps != '' && needs.discover.outputs.apps != '[]'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 355
|
|
needs: discover
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include: ${{ fromJson(needs.discover.outputs.apps) }}
|
|
|
|
steps:
|
|
- name: 🧹 Free disk space
|
|
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
|
|
with:
|
|
tool-cache: true
|
|
android: true
|
|
dotnet: true
|
|
haskell: true
|
|
large-packages: true
|
|
docker-images: true
|
|
swap-storage: true
|
|
|
|
- uses: actions/checkout@v7.0.0
|
|
|
|
- name: "📥 Load rescue-diagnostics SPOT into job env"
|
|
shell: bash
|
|
run: grep '^INFINITO_RESCUE_DIAGNOSTICS_BASE=' default.env >> "$GITHUB_ENV"
|
|
|
|
- name: 💾 Enlarge swap space
|
|
shell: bash
|
|
run: ./scripts/github/runner/enlarge_swap.sh
|
|
|
|
- name: 📦 Relocate Docker data-root onto /mnt when roomier
|
|
if: ${{ !env.ACT }}
|
|
shell: bash
|
|
run: ./scripts/github/runner/relocate_docker_dataroot.sh
|
|
|
|
- name: 🗄️ Resolve the filesystem
|
|
if: ${{ !env.ACT }}
|
|
shell: bash
|
|
run: >-
|
|
./scripts/tests/deploy/utils/filesystem/resolve.sh "${{ inputs.filesystem }}"
|
|
"compose/${{ matrix.apps }}" "${{ inputs.distros }}" runner
|
|
|
|
- name: 🗄️ Put the Docker data-root on it
|
|
if: ${{ !env.ACT }}
|
|
shell: bash
|
|
run: >-
|
|
sudo -E ./scripts/tests/deploy/utils/filesystem/docker_dataroot.sh
|
|
"${INFINITO_DOCKER_FILESYSTEM}" "${INFINITO_DOCKER_FILESYSTEM_REQUIRED}"
|
|
|
|
- name: 🔍 Resolve repository owner
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
echo "GITHUB_REPOSITORY_OWNER=$(scripts/meta/resolve/repository/owner.sh)" >> "$GITHUB_ENV"
|
|
|
|
- name: 📦 Install jq
|
|
shell: bash
|
|
run: ./scripts/install/apt.sh jq
|
|
|
|
- name: 🚀 Deploy app
|
|
timeout-minutes: 350
|
|
shell: bash
|
|
env:
|
|
apps: ${{ matrix.apps }}
|
|
variant: ${{ matrix.variant }}
|
|
ANSIBLE_LOG_PATH: /tmp/ansible-${{ matrix.apps }}.log
|
|
run: ./scripts/tests/deploy/ci/all.sh 2>&1 | tee "/tmp/ansible-${{ matrix.apps }}.log"
|
|
|
|
- name: 🚫 Fail on deprecation warnings
|
|
if: always()
|
|
shell: bash
|
|
run: ./scripts/tests/deploy/ci/assert_no_deprecation_warnings.sh "/tmp/ansible-${{ matrix.apps }}.log"
|
|
|
|
- name: 📊 Role runtimes
|
|
if: always()
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
python3 -m cli.meta.ci.roles.runtime "/tmp/ansible-${{ matrix.apps }}.log" \
|
|
--format csv --output "/tmp/role-runtimes-${{ matrix.apps }}.csv"
|
|
python3 -m cli.meta.ci.roles.runtime "/tmp/role-runtimes-${{ matrix.apps }}.csv" \
|
|
--format markdown >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
- name: ⬆️ Upload role runtimes CSV
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: role-runtimes-${{ matrix.apps }}
|
|
path: /tmp/role-runtimes-${{ matrix.apps }}.csv
|
|
if-no-files-found: ignore
|
|
|
|
- name: 🩺 Dump runner state (on failure)
|
|
if: failure()
|
|
timeout-minutes: 5
|
|
shell: bash
|
|
run: ./scripts/github/runner/dump_state.sh "post-deploy failure (${{ matrix.apps }})"
|
|
|
|
- name: ⬆️ Upload rescue diagnostics
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: rescue-diagnostics-compose-${{ matrix.apps }}${{ matrix.variant_slug && format('-{0}', matrix.variant_slug) || '' }}
|
|
path: ${{ env.INFINITO_RESCUE_DIAGNOSTICS_BASE }}/
|
|
if-no-files-found: ignore
|
|
|
|
- name: 🗜️ Zip generated inventory for debugging
|
|
if: always()
|
|
shell: bash
|
|
env:
|
|
APP_ID: ${{ matrix.apps }}
|
|
run: bash scripts/github/inventory/zip/compose_for_upload.sh
|
|
|
|
- name: ⬆️ Upload inventory artifact
|
|
if: ${{ always() && !env.ACT }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: inventory-compose-${{ matrix.apps }}
|
|
path: /tmp/inventory-compose-${{ matrix.apps }}.zip
|
|
if-no-files-found: ignore
|
|
|
|
- name: 📋 Playwright step summary
|
|
if: always()
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
python3 utils/github/playwright_summary.py \
|
|
/tmp/playwright-artifacts \
|
|
"${{ matrix.apps }}" \
|
|
>> "$GITHUB_STEP_SUMMARY"
|
|
|
|
- name: ⬆️ Upload Playwright artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@v7.0.1
|
|
with:
|
|
name: playwright-compose-${{ matrix.apps }}${{ matrix.variant_slug && format('-{0}', matrix.variant_slug) || '' }}
|
|
path: /tmp/playwright-artifacts/
|
|
if-no-files-found: ignore
|