diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index 46feeb9..2aecac4 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,21 @@ crun-0.1.1.tar.gz /crun-1.8.4.tar.xz /crun-1.8.5.tar.xz /crun-1.8.6.tar.xz +/crun-1.8.7.tar.xz +/crun-1.9.tar.xz +/crun-1.9.1.tar.xz +/crun-1.9.2.tar.xz +/crun-1.10.tar.xz +/crun-1.11.tar.xz +/crun-1.11.1.tar.xz +/crun-1.11.2.tar.xz +/crun-1.12.tar.xz +/crun-1.13.tar.xz +/crun-1.14.tar.xz +/crun-1.14.1.tar.xz +/crun-1.14.2.tar.xz +/crun-1.14.3.tar.xz +/crun-1.14.4.tar.xz +/crun-1.15.tar.zst +/crun-1.17.tar.zst +/crun-1.18.tar.zst diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..363614f --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,168 @@ +--- +# See the documentation for more information: +# https://packit.dev/docs/configuration/ + +downstream_package_name: crun + +# Ref: https://packit.dev/docs/configuration#files_to_sync +files_to_sync: + - src: rpm/gating.yaml + dest: gating.yaml + - src: plans/ + dest: plans/ + delete: true + mkpath: true + - src: tests/tmt/ + dest: tests/tmt/ + delete: true + mkpath: true + - src: .fmf/ + dest: .fmf/ + delete: true + mkpath: true + - .packit.yaml + +packages: + crun-fedora: + pkg_tool: fedpkg + specfile_path: rpm/crun.spec + crun-centos: + pkg_tool: centpkg + specfile_path: rpm/crun.spec + crun-rhel: + specfile_path: rpm/crun.spec + crun-eln: + specfile_path: rpm/crun.spec + +srpm_build_deps: + - git-archive-all + - make + +actions: + # This action runs only on copr build jobs + create-archive: + - "git-archive-all -v --force-submodules rpm/crun-HEAD.tar.xz" + - bash -c "ls -1 rpm/crun-HEAD.tar.xz" + +jobs: + - job: copr_build + trigger: pull_request + packages: [crun-fedora] + notifications: &copr_build_failure_notification + failure_comment: + message: "Ephemeral COPR build failed. @containers/packit-build please check." + targets: &fedora_copr_targets + - fedora-all-x86_64 + - fedora-all-aarch64 + + - job: copr_build + trigger: pull_request + packages: [crun-eln] + notifications: *copr_build_failure_notification + targets: + - fedora-eln-x86_64 + - fedora-eln-aarch64 + + - job: copr_build + trigger: pull_request + packages: [crun-centos] + notifications: *copr_build_failure_notification + targets: ¢os_targets + # Need epel9 repos to fetch wasmedge build dependency + centos-stream-9-x86_64: + additional_repos: + - https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/ + centos-stream-9-aarch64: + additional_repos: + - https://dl.fedoraproject.org/pub/epel/9/Everything/aarch64/ + # TODO: build on CS10 with wasmedge once epel-10 is available + centos-stream-10-x86_64: {} + centos-stream-10-aarch64: {} + + - job: copr_build + trigger: pull_request + packages: [crun-rhel] + notifications: *copr_build_failure_notification + targets: + - epel-9-x86_64 + - epel-9-aarch64 + + # Run on commit to main branch + - job: copr_build + trigger: commit + packages: [crun-fedora] + notifications: + failure_comment: + message: "podman-next COPR build failed. @containers/packit-build please check." + branch: main + owner: rhcontainerbot + project: podman-next + + # Podman system tests for Fedora and CentOS Stream + - job: tests + trigger: pull_request + packages: [crun-fedora] + notifications: &podman_system_test_fail_notification + failure_comment: + message: "podman system tests failed. @containers/packit-build please check." + targets: *fedora_copr_targets + tf_extra_params: + environments: + - artifacts: + - type: repository-file + id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo + + # Podman system tests for CentOS Stream + - job: tests + trigger: pull_request + packages: [crun-centos] + notifications: *podman_system_test_fail_notification + targets: *centos_targets + tf_extra_params: + environments: + - artifacts: + - type: repository-file + id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo + + # Podman system tests for RHEL + - job: tests + trigger: pull_request + packages: [crun-rhel] + use_internal_tf: true + notifications: *podman_system_test_fail_notification + targets: + epel-9-x86_64: + distros: [RHEL-9.4.0-Nightly,RHEL-9-Nightly] + epel-9-aarch64: + distros: [RHEL-9.4.0-Nightly,RHEL-9-Nightly] + #TODO: Enable RHEL10 targets once epel-10 copr target is available + tf_extra_params: + environments: + - artifacts: + - type: repository-file + id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/epel-$releasever/rhcontainerbot-podman-next-epel-$releasever.repo + - type: repository-file + id: https://src.fedoraproject.org/rpms/epel-release/raw/epel9/f/epel.repo + + - job: propose_downstream + trigger: release + packages: [crun-fedora] + dist_git_branches: &fedora_targets + - fedora-all + + - job: propose_downstream + trigger: release + packages: [crun-centos] + dist_git_branches: + - c10s + + - job: koji_build + trigger: commit + packages: [crun-fedora] + dist_git_branches: *fedora_targets + + - job: bodhi_update + trigger: commit + packages: [crun-fedora] + dist_git_branches: + - fedora-branched # rawhide updates are created automatically diff --git a/README.packit b/README.packit new file mode 100644 index 0000000..2bd3f40 --- /dev/null +++ b/README.packit @@ -0,0 +1,3 @@ +This repository is maintained by packit. +https://packit.dev/ +The file was generated using packit 0.102.1.post1.dev6+g64f7460b. diff --git a/crun.spec b/crun.spec index 492a68d..1e315b8 100644 --- a/crun.spec +++ b/crun.spec @@ -1,114 +1,141 @@ %global krun_opts %{nil} +%global wasmedge_opts %{nil} +%global yajl_opts %{nil} -%if 0%{?fedora} >= 37 +%if %{defined copr_username} +%define copr_build 1 +%endif + +# krun and wasm support only on aarch64 and x86_64 %ifarch aarch64 || x86_64 -%global krun_support enabled + +# Disable wasmedge on rhel 10 until EPEL10 is in place, otherwise it causes +# build issues on copr +%if %{defined fedora} || (%{defined copr_build} && %{defined rhel} && 0%{?rhel} < 10) +%global wasm_support 1 +%global wasmedge_support 1 +%global wasmedge_opts --with-wasmedge +%endif + +# krun only exists on fedora +%if %{defined fedora} +%global krun_support 1 %global krun_opts --with-libkrun %endif + %endif -%if 0%{?fedora} -# wasmedge built only for aarch64 and x86_64 -%ifarch aarch64 || x86_64 -%global wasm_support enabled -%global wasm_opts --with-wasmedge +%if %{defined fedora} || (%{defined rhel} && 0%{?rhel} < 10) +%global system_yajl 1 +%else +%global yajl_opts --enable-embedded-yajl %endif -%endif - -%global built_tag 1.8.6 -%global gen_version %(b=%{built_tag}; echo ${b/-/"~"}) Summary: OCI runtime written in C Name: crun -Version: %{gen_version} -URL: https://github.com/containers/%{name} -# Fetched from upstream -Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.xz -License: GPL-2.0-only +%if %{defined copr_build} +Epoch: 102 +%endif +# DO NOT TOUCH the Version string! +# The TRUE source of this specfile is: +# https://github.com/containers/crun/blob/main/rpm/crun.spec +# If that's what you're reading, Version must be 0, and will be updated by Packit for +# copr and koji builds. +# If you're reading this on dist-git, the version is automatically filled in by Packit. +Version: 1.18 Release: %autorelease +URL: https://github.com/containers/%{name} +Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.zst +License: GPL-2.0-only +%if %{defined golang_arches_future} ExclusiveArch: %{golang_arches_future} +%else +ExclusiveArch: aarch64 ppc64le riscv64 s390x x86_64 +%endif BuildRequires: autoconf BuildRequires: automake -BuildRequires: go-md2man -BuildRequires: libtool BuildRequires: gcc BuildRequires: git-core -BuildRequires: python3 +BuildRequires: gperf BuildRequires: libcap-devel -BuildRequires: systemd-devel -BuildRequires: yajl-devel -BuildRequires: libgcrypt-devel -%if "%{krun_support}" == "enabled" +%if %{defined krun_support} BuildRequires: libkrun-devel %endif -%if "%{wasm_support}" == "enabled" -BuildRequires: wasmedge-devel +BuildRequires: systemd-devel +%if %{defined system_yajl} +BuildRequires: yajl-devel %endif BuildRequires: libseccomp-devel -BuildRequires: libselinux-devel BuildRequires: python3-libmount -BuildRequires: make -BuildRequires: glibc-static +BuildRequires: libtool BuildRequires: protobuf-c-devel -%ifnarch %ix86 +%ifnarch riscv64 BuildRequires: criu-devel >= 3.17.1-2 -%endif Recommends: criu >= 3.17.1 Recommends: criu-libs +%endif +%if %{defined wasmedge_support} +BuildRequires: wasmedge-devel +%endif +BuildRequires: python Provides: oci-runtime %description -%{name} is a runtime for running OCI containers +%{name} is a OCI runtime + +%if %{defined krun_support} +%package krun +Summary: %{name} with libkrun support +Requires: libkrun +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Provides: krun = %{?epoch:%{epoch}:}%{version}-%{release} + +%description krun +krun is a symlink to the %{name} binary, with libkrun as an additional dependency. +%endif + +%if %{defined wasm_support} +%package wasm +Summary: %{name} with wasm support +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +# wasm packages are not present on RHEL yet and are currently a PITA to test +# Best to only include wasmedge as weak dep on rhel +%if %{defined fedora} +Requires: wasm-library +%endif +Recommends: wasmedge + +%description wasm +%{name}-wasm is a symlink to the %{name} binary, with wasm as an additional dependency. +%endif %prep -%autosetup -Sgit %{name}-%{built_tag} +%autosetup -Sgit -n %{name}-%{version} %build ./autogen.sh -%configure --disable-silent-rules %{krun_opts} %{wasm_opts} +./configure --disable-silent-rules %{krun_opts} %{wasmedge_opts} %{yajl_opts} %make_build %install -%make_install +%make_install prefix=%{_prefix} rm -rf %{buildroot}%{_prefix}/lib* -%if "%{krun_support}" == "enabled" -ln -s ../bin/%{name} %{buildroot}%{_bindir}/krun -%endif - -%if "%{wasm_support}" == "enabled" -ln -s ../bin/%{name} %{buildroot}%{_bindir}/%{name}-wasm -%endif %files %license COPYING %{_bindir}/%{name} -%{_mandir}/man1/* - -%if "%{krun_support}" == "enabled" -%package krun -Summary: OCI Runtime providing Virtualization-based process isolation capabilities. -Provides: krun -Requires: %{name} = %{version}-%{release} -Requires: libkrun - -%description krun -%{name}-krun OCI Runtime providing Virtualization-based process isolation capabilities. +%{_mandir}/man1/%{name}.1.gz +%if %{defined krun_support} %files krun +%license COPYING %{_bindir}/krun +%{_mandir}/man1/krun.1.gz %endif -%if "%{wasm_support}" == "enabled" -%package wasm -Summary: wasm support for %{name} -Requires: wasm-library -Recommends: wasmedge -Requires: %{name} = %{version}-%{release} - -%description wasm -%{name}-wasm provides %{name} built with wasm support - +%if %{defined wasm_support} %files wasm +%license COPYING %{_bindir}/%{name}-wasm %endif diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..dbb1d91 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,12 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + +--- !Policy +product_versions: + - rhel-* +decision_context: osci_compose_gate +rules: [] diff --git a/plans/main.fmf b/plans/main.fmf new file mode 100644 index 0000000..b56d319 --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,20 @@ +discover: + how: fmf +execute: + how: tmt + +/upstream: + summary: Run crun specific Podman system tests on upstream PRs + discover+: + filter: tag:upstream + adjust+: + enabled: false + when: initiator is not defined or initiator != packit + +/downstream: + summary: Run crun specific Podman system tests on bodhi / errata and dist-git PRs + discover+: + filter: tag:downstream + adjust+: + enabled: false + when: initiator == packit diff --git a/sources b/sources index 13f3791..285c15f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (crun-1.8.6.tar.xz) = d527b58ce4d5a7937260cc1336e10997595fed774e0faf4fed90e783de1ff4e3f036d800c7b92173f7fcad8bb1c0d6ee01989534d9b43eb0b937eef46a335f7d +SHA512 (crun-1.18.tar.zst) = a1a77a74163bcad18541c688e8006449c86ff490c98485c1294bdbf892840d1add1d5a25de75950a21255185aebdb6136490512d4c7562a53ac4052669924fad diff --git a/tests/tmt/Makefile b/tests/tmt/Makefile new file mode 100644 index 0000000..b57ba2c --- /dev/null +++ b/tests/tmt/Makefile @@ -0,0 +1,3 @@ +.PHONY: podman_system_test +podman_system_test: + bash ./podman-tests.sh diff --git a/tests/tmt/main.fmf b/tests/tmt/main.fmf new file mode 100644 index 0000000..b0db617 --- /dev/null +++ b/tests/tmt/main.fmf @@ -0,0 +1,13 @@ +# Only common dependencies that are NOT required to run podman-tests.sh are +# specified here. Everything else is in podman-tests.sh. +require: + - make + +adjust: + duration: 10m + when: arch == aarch64 + +/podman_system_test: + tag: [ upstream, downstream ] + summary: Run crun specific Podman tests + test: make podman_system_test diff --git a/tests/tmt/podman-tests.sh b/tests/tmt/podman-tests.sh new file mode 100644 index 0000000..9d091c7 --- /dev/null +++ b/tests/tmt/podman-tests.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -exo pipefail + +if [[ "$(id -u)" -ne 0 ]];then + echo "Please run this script as superuser" + exit 1 +fi + +# Remove testing-farm repos if they exist because they interfere with the +# podman-next copr. The default distro repos will not be removed and can be +# used wherever relevant. +rm -f /etc/yum.repos.d/tag-repository.repo + +dnf -y install bats conmon podman podman-tests +dnf -y update --allowerasing + +cat /etc/redhat-release +rpm -q conmon containers-common crun podman podman-tests + +# Run crun specific podman tests +bats /usr/share/podman/test/system/030-run.bats