From 568d10dc92576a106eb69da53bb1ec14163ce942 Mon Sep 17 00:00:00 2001 From: robojerk Date: Tue, 26 Aug 2025 11:49:49 -0700 Subject: [PATCH] Did stuff --- .gitignore | 1 + Containerfile | 52 +++++++++++++++++++++++++++++++++++++ debian-koji-osbuild.conf | 33 ++++++++++++++++++++++++ meson.build | 55 ++++++++++++++++++++-------------------- 4 files changed, 114 insertions(+), 27 deletions(-) create mode 100644 Containerfile create mode 100644 debian-koji-osbuild.conf diff --git a/.gitignore b/.gitignore index 646986d..c3ae160 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ build/ .coverage coverage.xml + diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..154935c --- /dev/null +++ b/Containerfile @@ -0,0 +1,52 @@ +# Koji-OSBuild Integration Container +# Optimized for integration performance between koji and osbuild + +FROM debian:trixie-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + python3-dev \ + python3-psycopg2 \ + ca-certificates \ + curl \ + postgresql-client \ + && rm -rf /var/lib/apt/lists/* + +# Install koji-osbuild from the local source +COPY . /tmp/koji-osbuild +RUN cd /tmp/koji-osbuild && \ + python3 -m pip install --no-cache-dir -e . && \ + rm -rf /tmp/koji-osbuild + +# Create non-root user for security +RUN useradd -r -s /bin/bash -u 1000 koji-osbuild + +# Set up directories +RUN mkdir -p /var/lib/koji-osbuild /var/log/koji-osbuild /etc/koji-osbuild && \ + chown -R koji-osbuild:koji-osbuild /var/lib/koji-osbuild /var/log/koji-osbuild /etc/koji-osbuild + +# Set working directory +WORKDIR /var/lib/koji-osbuild + +# Switch to non-root user +USER koji-osbuild + +# Expose koji-osbuild port +EXPOSE 8080 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ + CMD python3 -c "import koji_osbuild; print('Koji-OSBuild available')" || exit 1 + +# Default command - koji-osbuild integration service +CMD ["python3", "-m", "koji_osbuild", "--config", "/etc/koji-osbuild/koji-osbuild.conf"] + +# Labels for container management +LABEL org.opencontainers.image.title="Koji-OSBuild Integration" +LABEL org.opencontainers.image.description="Koji-OSBuild - Integration layer between koji and osbuild" +LABEL org.opencontainers.image.vendor="Debian Forge Team" +LABEL org.opencontainers.image.source="https://git.raines.xyz/particle-os/koji-osbuild" diff --git a/debian-koji-osbuild.conf b/debian-koji-osbuild.conf new file mode 100644 index 0000000..e6c73d9 --- /dev/null +++ b/debian-koji-osbuild.conf @@ -0,0 +1,33 @@ +[composer] +# Debian Forge Composer integration +server = https://debian-forge-composer.local:8080 + +# SSL configuration for secure communication +ssl_cert = /etc/debian-koji/ssl/debian-koji.crt +ssl_key = /etc/debian-koji/ssl/debian-koji.key +ssl_verify = /etc/debian-koji/ssl/debian-forge-ca.pem + +# Debian-specific composer settings +debian_archive = https://deb.debian.org/debian +debian_security = https://deb.debian.org/debian-security +debian_backports = https://deb.debian.org/debian-backports + +[koji] +# Debian Koji hub integration +server = https://debian-koji.local/kojihub + +# Debian-specific koji settings +debian_build_tags = [bookworm, sid, testing, backports] +debian_architectures = [amd64, arm64, riscv64] + +[debian] +# Debian package management settings +package_manager = apt +build_tools = sbuild,pbuilder +repository_format = deb +signing_key = /etc/debian-koji/keys/debian-koji.gpg + +# OSTree and atomic support +ostree_enabled = true +bootc_support = true +atomic_variants = [minimal, server, desktop, development] diff --git a/meson.build b/meson.build index deb6867..d43b72d 100644 --- a/meson.build +++ b/meson.build @@ -18,12 +18,11 @@ install_data( git = find_program('git') gitres = run_command( git, - ['--git-dir=@0@/.git'.format(srcdir), 'rev-parse', 'HEAD'], - check=True + ['--git-dir=' + srcdir + '/.git', 'rev-parse', 'HEAD'] ) commit = gitres.stdout().strip() -archive_name = meson.project_name() + '-' + gitrev +archive_name = meson.project_name() + '-' + commit full_archive_name = archive_name + '.tar.gz' archive = custom_target( 'tarball', @@ -52,31 +51,33 @@ rpmdirs_target = custom_target( rpmbuild = find_program('rpmbuild', required: false) -srpm_target = custom_target( - 'srpm', - command: [ - rpmbuild, '-bs', - spec_file, - '--define', '_sourcedir ' + meson.build_root(), - '--define', '_topdir ' + rpmdirs_target.full_path(), - '--define', 'commit ' + commit - ], - output: 'srpms', - depends: [archive] -) +if rpmbuild.found() + srpm_target = custom_target( + 'srpm', + command: [ + rpmbuild, '-bs', + 'koji-osbuild.spec', + '--define', '_sourcedir ' + meson.build_root(), + '--define', '_topdir ' + rpmdirs_target.full_path(), + '--define', 'commit ' + commit + ], + output: 'srpms', + depends: [archive] + ) -rpm_target = custom_target( - 'rpm', - command: [ - rpmbuild, '-ba', - spec_file, - '--define', '_sourcedir ' + meson.build_root(), - '--define', '_topdir ' + rpmdirs_target.full_path(), - '--define', 'commit ' + commit - ], - output: 'rpms', - depends: [archive] -) + rpm_target = custom_target( + 'rpm', + command: [ + rpmbuild, '-ba', + 'koji-osbuild.spec', + '--define', '_sourcedir ' + meson.build_root(), + '--define', '_topdir ' + rpmdirs_target.full_path(), + '--define', 'commit ' + commit + ], + output: 'rpms', + depends: [archive] + ) +endif msg = ['', 'hub plugins path: @0@'.format(hub_plugins_path),