Commit Graph
87 Commits
Author SHA1 Message Date
kevinveenbirkenbach 8a81630391 Added newline at file and POSIX compatible 2026-02-04 19:49:56 +01:00
kevinveenbirkenbach bc38347798 refactor(ci-deploy): split per-distro deploy, add two-pass async test and hard cleanup
- Replace legacy app.sh/distros.sh orchestration with explicit all_distros.sh + dedicated_distro.sh
- Deploy each app sequentially across distros against a fresh stack
- Run two deploy passes per distro:
  - Pass 1 with ASYNC_ENABLED=false
  - Pass 2 with ASYNC_ENABLED=true against the same stack
- Remove deprecated cli.deploy.development run orchestrator
- Extend init command with --vars to inject inventory overrides
- Enforce debug mode for CI deploys
- Add hard Docker cleanup after each distro (containers, networks, volumes, build cache; keep images)
- Emit disk and docker usage before and after deploy for observability

https://chatgpt.com/share/6981c7d4-642c-800f-8438-9e2349ac53fb
2026-02-03 11:02:51 +01:00
kevinveenbirkenbach 734f013179 ci: wire GHCR mirror envs into deploy workflows and inventory init
- Add required GHCR mirror environment variables to CI workflows
- Generate mirrors.yml during development inventory init on CI
- Introduce mirrors helper module with strict env validation
- Minor formatting cleanup in mirror providers
`

https://chatgpt.com/share/6980ff2e-8f18-800f-85e1-79d56a2027f5
2026-02-02 20:46:41 +01:00
kevinveenbirkenbach c86d9820f5 fix(dev-deploy): add missing when_down arg in restart
restart delegates to up.handler(), which expects args.when_down.
Add when_down=False to the restart -> up args shim to avoid AttributeError.

https://chatgpt.com/share/69752530-c570-800f-b82c-f4bc10231292
2026-01-24 21:01:45 +01:00
kevinveenbirkenbach d2694566e5 feat(runtime): add development runtime marker and unified runtime detection
- introduce env.development marker for local dev runtime
- add cli.meta.runtime module with library API and CLI entrypoint
- detect runtime via ACT/GitHub/marker with explicit RUNTIME override
- use env.development as docker-compose env override
- pass RUNTIME=dev into development inventory generation
- add make setup-development helper

https://chatgpt.com/share/69720fd6-a1c8-800f-b1e2-6909aa63643a
2026-01-22 12:53:42 +01:00
kevinveenbirkenbach 4b712c22cb feat(compose): load optional env.local as override for env.ci
https://chatgpt.com/share/697200be-e96c-800f-a8d3-b89b75b6e37c
2026-01-22 11:49:31 +01:00
kevinveenbirkenbach 6af034a0a0 feat(dev-deploy): stream compose/ansible output with CI-aware TTY and tail buffers
https://chatgpt.com/share/69712357-7548-800f-9b51-7fd4c4207bef
2026-01-21 20:04:48 +01:00
kevinveenbirkenbach bdd6587bcc fix(ci): show deploy stdout/stderr and pass inventory_dir in run orchestrator
- Capture and print deploy stdout/stderr on failure (development/deploy.py)
- Forward INVENTORY_DIR into init and deploy handlers (development/run.py)
- Add missing when_down flag for up handler
- Print full traceback on orchestrator failure for CI visibility

https://chatgpt.com/share/6970fcf5-5860-800f-89ae-0d601405489b
2026-01-21 17:21:02 +01:00
kevinveenbirkenbach 33ab4b61dc feat(dev-deploy): extract CoreDNS Corefile rendering into dedicated Python class
- Move Corefile rendering logic into CoreDNSCorefileRenderer
- Add atomic rendering via envsubst with validation and preview
- Enforce strict error handling for missing files, invalid paths and permissions
- Integrate renderer into development compose workflow
- Rename DNS make targets for consistency (dns-setup / dns-remove)
- Rename test-act target to test-act-all

https://chatgpt.com/share/6970e503-e818-800f-8724-d791a3abfb33
2026-01-21 15:38:54 +01:00
kevinveenbirkenbach a565344ed5 Solved shellcheck 2026-01-21 00:25:35 +01:00
kevinveenbirkenbach f08993049c feat(inventory): add dynamic inventory resolver and propagate INVENTORY_DIR everywhere
- add scripts/inventory/resolve.sh to compute INVENTORY_DIR based on runtime context (act/github/local)
- resolve INVENTORY_DIR dynamically in Makefile via resolve.sh
- enforce INVENTORY_DIR usage across all local deploy/test scripts
- propagate INVENTORY_DIR into container and development CLI commands
- remove hardcoded /etc/inventories paths

https://chatgpt.com/share/69700d69-b270-800f-ad50-d9ff486378b9
2026-01-21 00:18:57 +01:00
kevinveenbirkenbach 0a4040d14d Lint 2026-01-20 22:00:49 +01:00
kevinveenbirkenbach d22dc4748b **refactor(cli): switch development dispatcher to argparse subcommands**
* Replace runpy-based nested CLI dispatch with argparse subcommand hub
* Auto-register development commands via `add_parser()` and execute `_handler`
* Fix `python -m cli.deploy.development <cmd>` resolution (e.g. `up`, `down`, `run`)

https://chatgpt.com/share/696fdea6-b208-800f-8b55-c4205c567aa2
2026-01-20 20:59:24 +01:00
kevinveenbirkenbach 50816243ed Solved linting hints 2026-01-20 20:50:50 +01:00
kevinveenbirkenbach d35e932e0c refactor(cli): switch development CLI to dynamic dispatcher and fix test paths
- Replace static argparse-based CLI in cli.deploy.development with dynamic
  module dispatcher compatible with nested command discovery.
- Ensure cli.deploy.development is executable via python -m and root dispatcher.
- Fix unit test path resolution to work locally and in CI.
- Make docker-* Makefile targets depend on install.
- Simplify test runner script and keep Nix flake config compatibility.

This aligns the CLI architecture with integration test discovery
(cli/**/__main__.py) and removes the need for manual subcommand registration.

https://chatgpt.com/share/696fdbbc-b6d8-800f-a8b5-067aa7e38706
2026-01-20 20:46:20 +01:00
kevinveenbirkenbach 4e0d09e773 refactor(dev-orchestrator): centralize image build and add up --when-down SPOT
- Introduce cli.deploy.development build subcommand as single build SPOT
- Remove legacy compose.build_infinito implementation
- Make up use build-missing logic via build handler
- Add --when-down flag to up (skip startup if stack already running)
- Simplify restart/run to reuse up handler
- Ensure tests use up --when-down to avoid stack interference
- Make test targets depend on build-missing

https://chatgpt.com/share/696fd3c9-99f0-800f-a0ab-33a91058419a
2026-01-20 20:13:02 +01:00
kevinveenbirkenbach bbea43f669 refactor(ci,tests): migrate discovery and local deploy to development compose stack
- Replace legacy ci scripts with meta build-test-matrix and resolve-invokable-roles
- Switch log tailing to scripts/meta/log-tail.sh
- Rename local DNS helpers to scripts/dns/*
- Run ci-deploy-discover via development docker-up
- Replace deploy-local-full with development compose orchestrator
- Ensure INFINITO_DISTRO is passed explicitly for local full deploy

https://chatgpt.com/share/696f9ccd-e4d8-800f-9c67-9c071188ecd0
https://chatgpt.com/share/696facf5-b2fc-800f-8a33-3352dd193c54
2026-01-20 17:27:09 +01:00
kevinveenbirkenbach f52a012829 feat(cli): replace test deploy runner with development CLI (up/down/stop/restart/run)
https://chatgpt.com/share/696f9ccd-e4d8-800f-9c67-9c071188ecd0
2026-01-20 16:18:31 +01:00
kevinveenbirkenbach 811501d85f refactor(ci): move compose down logic into dedicated down module with safe /mnt/docker cleanup
https://chatgpt.com/share/696f4386-fbbc-800f-bdde-f1e6c4145c84
2026-01-20 12:54:54 +01:00
kevinveenbirkenbach daab131b71 ci: auto-detect storage constraints and enable aggressive docker cleanup
- add storage detection utility for CI (DockerRootDir free space check)
- automatically set STORAGE_CONSTRAINED in cli.deploy.test when disk < 100 GiB
- forward STORAGE_CONSTRAINED into generated CI inventory via --vars
- introduce global STORAGE_CONSTRAINED default in group_vars
- run aggressive docker prune handler only in storage constrained mode
- mark CI inventory environment as development

https://chatgpt.com/share/696d6a11-2d90-800f-83e8-a30f6229e2e0
2026-01-19 00:17:31 +01:00
kevinveenbirkenbach cf216014e3 refactor(cli): introduce combined role resolution and reorganize meta resolvers
- add cli.meta.applications.resolution.combined to resolve run_after + app-only dependencies
- add optional --tree output for combined resolution
- add cli.meta.applications.resolution.dependencies (app-only) resolver
- move run_after resolver to cli.meta.applications.resolution.run_after
- update test deploy dependency resolver to use combined module
- add unit tests for combined/dependencies/run_after resolvers
- minor cleanup: remove stray header comment, fix newline in vars, tidy YAML formatting

https://chatgpt.com/share/696ca531-9644-800f-98c0-bae58c0aff41
2026-01-18 10:17:26 +01:00
kevinveenbirkenbach fa422ed7fe cli: allow comma-separated application IDs for --id flag
- Support space-separated, comma-separated and mixed --id values
- Normalize and deduplicate application IDs before validation
- Fix Makefile to pass APP without quoting
- Add unittest coverage for ID normalization

https://chatgpt.com/share/696be0c2-816c-800f-8b07-3c5cd0304ac5
2026-01-17 20:19:13 +01:00
kevinveenbirkenbach fd983bc69c refactor(ci,network): make DNS, IP and domain configuration fully env-driven
- Introduce env.ci as single source of truth for CI networking
- Make docker-compose, CoreDNS and Docker daemon fully env-driven
- Render CoreDNS Corefile from template via envsubst
- Replace hardcoded IPs/domains with environment variables
- Integrate env-based networking into Ansible defaults
- Remove static Corefile and daemon.json

This makes DNS and networking deterministic and reproducible across
host, CoreDNS, infinito runner and Docker-in-Docker.

https://chatgpt.com/share/696a3dda-5c6c-800f-8a16-47c0c604e1e3
2026-01-16 14:30:14 +01:00
kevinveenbirkenbach a06f395640 Replaced -i with --id 2026-01-16 00:47:34 +01:00
kevinveenbirkenbach 505af3e2ad cli: make --log require explicit directory and create parents automatically
- Change --log flag to require explicit log directory (--log <LOG_DIR>)
- Automatically create log directory with parents=True
- Harden permissions best-effort (0700)
- Update CLI help text accordingly
- Adjust Makefile test targets to pass explicit log directory
- Ignore logs/ via .gitignore and .dockerignore
- Refactor flag parsing to correctly detect deploy with --log
- Add dedicated logging unit tests
- Update existing tests for new log semantics
- Remove deprecated -i alias for --id in deploy command

https://chatgpt.com/share/6969680a-dbf8-800f-aafb-3d32d6212ba0
2026-01-15 23:19:31 +01:00
kevinveenbirkenbach e782f41d8e cli(deploy): extend --help with ansible-playbook help and passthrough usage
Add a combined help output that includes:
- Wrapper CLI help
- Full `ansible-playbook --help`
- Explanation and examples for native Ansible flag passthrough

This makes it clear how to use --tags, --check, -e, --forks, and other
ansible-playbook options directly via the infinito deploy wrapper.

https://chatgpt.com/share/69694e02-de58-800f-a9ea-2fb788ff5077
2026-01-15 21:28:40 +01:00
kevinveenbirkenbach ea63818216 refactor(cli): simplify dedicated deploy wrapper and add ansible passthrough support
- Remove unused cli_root and logs handling from dedicated deploy wrapper
- Add parse_known_args() to forward native ansible-playbook flags
- Append passthrough args at the end for proper override behavior
- Clean up MODE_LOGS usage
- Update runner signature and cleanup phase logic
- Adapt unit tests to new wrapper contract
- Add unit test for ansible flag passthrough in command.main()

https://chatgpt.com/share/69694ad5-453c-800f-8047-cf210f60460f
2026-01-15 21:15:06 +01:00
kevinveenbirkenbach bab0bceb1d feat(local-dns): add dnsmasq-based infinito.example wildcard + set CI primary domain
https://chatgpt.com/share/6969261a-8d34-800f-9a61-725e90544dea
2026-01-15 18:38:15 +01:00
kevinveenbirkenbach 49df004a5f General py optimations 2026-01-15 05:02:55 +01:00
kevinveenbirkenbach ef4a6611d7 ci(deploy): log effective compose env without leaking secrets
Print selected INFINITO_* and GITHUB_SHA variables before starting the CI
compose stack and only indicate whether NIX_CONFIG is set, avoiding secret
exposure while making the effective image/tag visible in logs.

https://chatgpt.com/share/69684776-86c0-800f-b089-7e549a83e87f
2026-01-15 02:48:29 +01:00
kevinveenbirkenbach 334c4b70c7 fix: stabilize rapid deploy env, improve entry.sh debugging and harden contact config
- Fix Makefile rapid deploy target to properly export INFINITO_DISTRO
- Capture stdout/stderr from entry.sh init and raise explicit error on failure
- Add fallback contact addresses for demo environments (email, matrix, mastodon, etc.)
- Quote mailto URLs and identifiers to ensure valid YAML output
- Replace placeholder legal contact with demo user

This prevents YAML parser errors (e.g. `url: mailto:`), improves CI diagnostics,
and ensures desktop contact menu is always rendered with valid defaults.

https://chatgpt.com/share/69679c78-f338-800f-be86-54b3195d19b7
2026-01-14 14:38:42 +01:00
kevinveenbirkenbach 3f667aadda ci: switch CI images to latest tag and skip compose build in deploy
- Build CI images workflow now always publishes :latest instead of ci-<sha>
- Removed obsolete tag input and CI tag computation logic
- Deploy in real GitHub Actions now pulls ghcr.io/.../infinito-<distro>:latest
- Skip docker compose build when INFINITO_NO_BUILD=1
- Respect INFINITO_IMAGE for --missing image existence check

This ensures deploy jobs use the already published production image and never rebuild in CI.

https://chatgpt.com/share/69678e2c-7d7c-800f-b422-15e98c8e4b6e
2026-01-14 13:37:54 +01:00
kevinveenbirkenbach 4a008d8b97 ci: centralize INSTALL_LOCAL_BUILD handling across Makefile, compose and runner
- Control INSTALL_LOCAL_BUILD centrally via Makefile depending on CI context:
  - real GitHub Actions runner: disable local rebuild
  - act and local runs: enable local rebuild
- Pass INSTALL_LOCAL_BUILD through docker-compose using environment expansion
- Remove hardcoded INSTALL_LOCAL_BUILD=1 from CI container runner
- Keep Dockerfile local-build during image build for CI images

This ensures consistent local/CI behavior and avoids unnecessary rebuilds on real CI runners.

https://chatgpt.com/share/6967876f-e400-800f-90ec-fe870e565bf3
2026-01-14 13:09:13 +01:00
kevinveenbirkenbach 517ccf44c0 ci: replace rest deploy mode with universal and add universal stage
- Rename CI workflow and MODE from "rest" to "universal"
- Extend CLI and test runner to support universal deploy type
- Add tasks/stages/02_universal.yml for universal host type
- Update discover logic to use universal app selection
- Remove legacy rest->server mapping and obsolete select helper

https://chatgpt.com/share/6967625e-81c8-800f-8592-5d5b8edec1e2
2026-01-14 10:31:06 +01:00
kevinveenbirkenbach 638d9f2dfa Docker optimations 2026-01-14 00:37:48 +01:00
kevinveenbirkenbach 3cf7d20d86 feat(test-deploy): add debug toggle and rapid deploy target
- add --debug / --no-debug flag to deploy test CLI and runner
- make Ansible debug mode optional instead of always enabled
- extend deploy.sh with debug flag forwarding
- add make target test-deploy-rapid for fast single-app deploys

https://chatgpt.com/share/6966c80c-661c-800f-8fb9-769659da290d
2026-01-13 23:32:37 +01:00
kevinveenbirkenbach 6b7b67681e fix(ci): unblock systemd startup and stabilize Docker healthcheck
Ensure systemd is started immediately as PID 1 in the infinito container
to avoid blocking on pkgmgr during boot. Increase compose runner timeout
to match healthcheck window and make healthcheck script executable in the
image.

This fixes containers getting stuck in "starting" state and makes CI
startup deterministic.

https://chatgpt.com/share/696683a2-9350-800f-a0cf-587d4013cb29
2026-01-13 19:02:43 +01:00
kevinveenbirkenbach 8c82db3556 feat(ci): add Docker healthcheck and wait for healthy container in compose runner
Add a systemd-based Docker HEALTHCHECK that verifies:
- systemd readiness
- infinito CLI availability and executability
- infinito CLI smoke test (--help)

Update CI compose runner to wait for Docker health status instead of
manual systemd polling. The runner now:
- resolves the infinito container via docker compose
- waits for healthy state
- dumps journalctl and docker logs on timeout

This removes boot race conditions and makes container readiness deterministic.

https://chatgpt.com/share/696683a2-9350-800f-a0cf-587d4013cb29
2026-01-13 18:40:33 +01:00
kevinveenbirkenbach 75de900549 test(compose): dump last 200 log lines when systemd wait times out
Extend wait_for_systemd_ready() to automatically print the last 200 log
lines on timeout for easier CI debugging.

- Adds journalctl output (preferred for systemd containers)
- Adds docker logs fallback
- Improves timeout error diagnostics

https://chatgpt.com/share/69667eca-088c-800f-af12-5682d0038351
2026-01-13 18:19:37 +01:00
kevinveenbirkenbach 673dab59d2 ci(deploy): prevent docker compose builds in GitHub Actions
Switch CI detection to GITHUB_ACTIONS and disable compose builds via
INFINITO_NO_BUILD=1. The deploy workflows now rely on pulling the prebuilt
CI image instead of triggering local Docker builds.

- Remove legacy UP_BUILD handling
- Enable --no-build in compose when running in real CI
- Keep local/act builds working as before

https://chatgpt.com/share/69666e0b-f08c-800f-93fd-611eced4b100
2026-01-13 17:08:34 +01:00
kevinveenbirkenbach dac111ccb7 ci(deploy): simplify per-app deploy workflow and Makefile act targets
- Rename _deploy-matrix.yml -> _deploy-per-app.yml and drop unused inputs
  (tested_lifecycles, only_distro, final_exclude_re).
- Keep one runner per app (matrix.app) and run all distros inside that job.
- Makefile: run deploy tests through act workflow_dispatch (no serial script).
- Add scripts/ci/discover.sh and scripts/ci/deploy-one-app.sh as small SRP helpers.
- Update reusable workflow callers to use the renamed file.

https://chatgpt.com/share/69659ff3-1414-800f-8652-5298fcf55398
2026-01-13 03:41:25 +01:00
kevinveenbirkenbach 3329fbdfd5 ci(act): unify deploy matrix + force serial execution with max-parallel
- Add reusable _deploy-matrix workflow with discovery + per-app deploy across distros
- Enforce serial execution via strategy.max-parallel=1 and act --concurrent-jobs 1
- Support filters: mode (server|workstation|rest), only_app, only_distro, include/exclude regex
- Refactor test runner: remove discovery, require --app, deploy single app with deps only
- Generalize discover script to discover-apps.sh with INCLUDE_RE/EXCLUDE_RE + lifecycle gating
- Update Makefile targets to drive workflow_dispatch inputs for local act runs

https://chatgpt.com/share/69659ff3-1414-800f-8652-5298fcf55398
2026-01-13 03:06:56 +01:00
kevinveenbirkenbach e5f8067db2 fix(deploy-test): apply lifecycle gating to workstation and server deploy tests
Apply TESTED_LIFECYCLES filtering directly in the deploy test runner so roles
with unsupported lifecycles (e.g. pre-alpha) are excluded consistently for
both workstation and server workflows.

This prevents roles like desk-copyq (lifecycle: pre-alpha) from being deployed
in CI unless explicitly enabled via TESTED_LIFECYCLES.

https://chatgpt.com/share/6963e316-0a50-800f-a895-8828269a0ca3
2026-01-11 18:51:09 +01:00
kevinveenbirkenbach 2d7a904f2b ruff optimation 2026-01-10 20:06:53 +01:00
kevinveenbirkenbach c0b03bb95a refactor(up): route make up through python orchestrator and entry.sh init
- Replace direct docker compose up with python-based orchestrator (Compose.up)
- Centralize stack startup, systemd readiness wait, and init logic in Compose.up
- Run container init via scripts/docker/entry.sh instead of make target
- Remove duplicate systemd wait in deploy test runner
- Add cli.deploy.test.up entrypoint for make up integration

https://chatgpt.com/share/6962a2c8-0f50-800f-8bfb-2efd16adaf40
2026-01-10 20:04:33 +01:00
kevinveenbirkenbach 1ca0fd05b0 fix(deploy-test): capture run_after resolver output for dependency resolution
Ensure stdout is captured when calling run_after_resolution inside the infinito
container so declared galaxy_info.run_after deps (e.g. matomo, mailu) are
correctly detected and added to deploy_ids.

https://chatgpt.com/share/69617fbb-5af4-800f-848d-edeb2c1125a8
2026-01-09 23:22:41 +01:00
kevinveenbirkenbach 2d25928333 test(deploy): simplify runner by removing lifecycle gating and using include-based inventory
- remove TESTED_LIFECYCLES handling from runner
- build CI inventory via --include instead of large exclude lists
- deploy app together with its run_after dependencies

https://chatgpt.com/share/69616d7d-4af0-800f-8c68-c4ed78f0fbf7
2026-01-09 22:04:50 +01:00
kevinveenbirkenbach 38fcbbc451 fix(deploy-test): do not let lifecycle blacklist override explicit run_after deps
Ensure explicitly included applications (run_after dependencies) are not excluded
again by lifecycle blacklist filtering. Also log lifecycle hits for easier CI
debugging.

https://chatgpt.com/share/6960fe98-683c-800f-9419-0078dc67f195
2026-01-09 14:11:31 +01:00
kevinveenbirkenbach 4390e3e847 Changed to fail fast strategy for workstations to improve test time 2026-01-09 01:03:42 +01:00
kevinveenbirkenbach d7f13d30c6 fix(ci): wait for systemd readiness after compose up
Add a systemd readiness gate to the CI compose wrapper to avoid a race
where systemctl is called before DBus/systemd is fully ready.
This prevents sporadic failures like:
"System has not been booted with systemd as init system (PID 1)".

No Dockerfile or Ansible role changes required.

https://chatgpt.com/share/696045b5-bd08-800f-acd9-e3a4e2e23e52
2026-01-09 01:02:54 +01:00