Did stuff
Some checks failed
Tests / 🐍 Lint (push) Failing after 58s
Tests / Unit tests (push) Failing after 2s
Tests / Shellcheck (push) Failing after 2s
Trigger GitLab CI / pr-info (push) Failing after 1s
Trigger GitLab CI / trigger-gitlab (push) Has been skipped

This commit is contained in:
robojerk 2025-08-26 11:49:49 -07:00
parent 650663be78
commit 568d10dc92
4 changed files with 114 additions and 27 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ build/
.coverage .coverage
coverage.xml coverage.xml

52
Containerfile Normal file
View file

@ -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"

33
debian-koji-osbuild.conf Normal file
View file

@ -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]

View file

@ -18,12 +18,11 @@ install_data(
git = find_program('git') git = find_program('git')
gitres = run_command( gitres = run_command(
git, git,
['--git-dir=@0@/.git'.format(srcdir), 'rev-parse', 'HEAD'], ['--git-dir=' + srcdir + '/.git', 'rev-parse', 'HEAD']
check=True
) )
commit = gitres.stdout().strip() commit = gitres.stdout().strip()
archive_name = meson.project_name() + '-' + gitrev archive_name = meson.project_name() + '-' + commit
full_archive_name = archive_name + '.tar.gz' full_archive_name = archive_name + '.tar.gz'
archive = custom_target( archive = custom_target(
'tarball', 'tarball',
@ -52,31 +51,33 @@ rpmdirs_target = custom_target(
rpmbuild = find_program('rpmbuild', required: false) rpmbuild = find_program('rpmbuild', required: false)
srpm_target = custom_target( if rpmbuild.found()
srpm_target = custom_target(
'srpm', 'srpm',
command: [ command: [
rpmbuild, '-bs', rpmbuild, '-bs',
spec_file, 'koji-osbuild.spec',
'--define', '_sourcedir ' + meson.build_root(), '--define', '_sourcedir ' + meson.build_root(),
'--define', '_topdir ' + rpmdirs_target.full_path(), '--define', '_topdir ' + rpmdirs_target.full_path(),
'--define', 'commit ' + commit '--define', 'commit ' + commit
], ],
output: 'srpms', output: 'srpms',
depends: [archive] depends: [archive]
) )
rpm_target = custom_target( rpm_target = custom_target(
'rpm', 'rpm',
command: [ command: [
rpmbuild, '-ba', rpmbuild, '-ba',
spec_file, 'koji-osbuild.spec',
'--define', '_sourcedir ' + meson.build_root(), '--define', '_sourcedir ' + meson.build_root(),
'--define', '_topdir ' + rpmdirs_target.full_path(), '--define', '_topdir ' + rpmdirs_target.full_path(),
'--define', 'commit ' + commit '--define', 'commit ' + commit
], ],
output: 'rpms', output: 'rpms',
depends: [archive] depends: [archive]
) )
endif
msg = ['', msg = ['',
'hub plugins path: @0@'.format(hub_plugins_path), 'hub plugins path: @0@'.format(hub_plugins_path),