feat: implement automatic, atomic, and push-based repository synchronization

- Switched from systemd path monitoring to a custom wrapper script `mxos-trigger-dist-repo.sh` spawned by the Koji signing spooler.
- Wrapper script runs Koji `dist-repo` synchronously and triggers the `mxos-repo-sync.sh` script to perform an atomic rsync of packages to the Caddy server.
- Excluded reposerver from distro-sync to work around VM disk space constraints.
- Configured Koji tag `mxos0` to cancel older pending/running `distRepo` tasks when a new one is triggered.
- Verified successful repository generation, synchronization, and DNF resolution.

Co-developed-by: Gemini AI <renich+gemini@woralelandia.com>
Signed-off-by: Rénich Bon Ćirić <renich@woralelandia.com>
This commit is contained in:
Rénich Bon Ćirić 2026-06-16 23:57:02 -06:00
commit 38a0669db8
Signed by: renich
GPG key ID: AB2A9F49384FE324
11 changed files with 191 additions and 54 deletions

View file

@ -244,6 +244,22 @@ def process_queue():
try:
kojihub.context.cnx.commit()
logger.info(f"All signatures committed for build {build_id} ({build_nvr}).")
# Check tags and trigger dist-repo if tagged in mxos0
try:
tags = list(kojihub.list_tags(build=build_id))
tag_names = [t['name'] for t in tags]
logger.info(f"Build {build_nvr} is tagged in: {tag_names}")
if 'mxos0' in tag_names:
short_key_id = sig_key_id[-8:].lower()
logger.info(f"Triggering dist-repo for tag mxos0 with key {short_key_id}")
dist_cmd = [
'/usr/local/bin/mxos-trigger-dist-repo.sh', short_key_id
]
subprocess.Popen(dist_cmd)
except Exception as e:
logger.error(f"Failed to check tags/trigger dist-repo: {e}")
os.remove(file_path)
except Exception as e:
logger.error(f"Failed to commit signatures to database: {e}")