From b8258f83e633f77a8416287420620714a8c76c7e Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Thu, 5 Sep 2024 15:43:55 +0530 Subject: [PATCH] RPM/Packit: Fix wasm conditionals, cleanup rpm spec, update packit config 1. Wrongly mentioned conditionals were causing crun-wasm package creation on CentOS Stream 10 and ELN environments which don't have wasm support yet. 2. All environments that end up consuming rpm/crun.spec have rpmautospec enabled so we don't need these conditionals anymore. CentOS Stream 9 should soon get rpmautospec support as well, and the current lack of it is not really a blocker to removal of these conditionals. 3. Simplify TMT tests Signed-off-by: Lokesh Mandvekar --- .packit.yaml | 27 ++++++++++++++------ plans/{all.fmf => main.fmf} | 0 rpm/crun.spec | 22 ++++------------ tests/tmt/Makefile | 10 +++----- tests/tmt/main.fmf | 17 +++---------- tests/tmt/podman-tests.sh | 50 +++---------------------------------- 6 files changed, 35 insertions(+), 91 deletions(-) rename plans/{all.fmf => main.fmf} (100%) diff --git a/.packit.yaml b/.packit.yaml index 425f5dff18..25da438a66 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -56,7 +56,7 @@ jobs: trigger: pull_request packages: [crun-centos] notifications: *copr_build_failure_notification - targets: + targets: ¢os_targets # Need epel9 repos to fetch wasmedge build dependency centos-stream-9-x86_64: additional_repos: @@ -97,17 +97,23 @@ jobs: targets: - fedora-all-x86_64 - fedora-all-aarch64 + 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-stream-9-x86_64 - - centos-stream-9-aarch64 - - centos-stream-10-x86_64 - - centos-stream-10-aarch64 + 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 @@ -120,7 +126,14 @@ jobs: 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 + #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 diff --git a/plans/all.fmf b/plans/main.fmf similarity index 100% rename from plans/all.fmf rename to plans/main.fmf diff --git a/rpm/crun.spec b/rpm/crun.spec index e90bc19f50..3464bbb76c 100644 --- a/rpm/crun.spec +++ b/rpm/crun.spec @@ -1,17 +1,17 @@ %global krun_opts %{nil} %global wasmedge_opts %{nil} -# krun and wasm[edge,time] support only on aarch64 and x86_64 -%ifarch aarch64 || x86_64 -%global wasm_support 1 - %if %{defined copr_username} %define copr_build 1 %endif +# krun and wasm support only on aarch64 and x86_64 +%ifarch aarch64 || x86_64 + # 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) +%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 @@ -112,10 +112,6 @@ Recommends: wasmedge %make_install prefix=%{_prefix} rm -rf %{buildroot}%{_prefix}/lib* -%if %{defined wasm_support} -ln -s %{name} %{buildroot}%{_bindir}/%{name}-wasm -%endif - %files %license COPYING %{_bindir}/%{name} @@ -135,12 +131,4 @@ ln -s %{name} %{buildroot}%{_bindir}/%{name}-wasm %endif %changelog -%if %{defined autochangelog} %autochangelog -%else -# NOTE: This changelog will be visible on CentOS 8 Stream builds -# Other envs are capable of handling autochangelog -* Tue Jun 13 2023 RH Container Bot -- Placeholder changelog for envs that are not autochangelog-ready. -- Contact upstream if you need to report an issue with the build. -%endif diff --git a/tests/tmt/Makefile b/tests/tmt/Makefile index 792828045a..b57ba2cebd 100644 --- a/tests/tmt/Makefile +++ b/tests/tmt/Makefile @@ -1,7 +1,3 @@ -.PHONY: podman_system_test_upstream -podman_system_test_upstream: - bash ./podman-tests.sh upstream - -.PHONY: podman_system_test_downstream -podman_system_test_downstream: - bash ./podman-tests.sh downstream +.PHONY: podman_system_test +podman_system_test: + bash ./podman-tests.sh diff --git a/tests/tmt/main.fmf b/tests/tmt/main.fmf index b830698bfb..b0db6173c4 100644 --- a/tests/tmt/main.fmf +++ b/tests/tmt/main.fmf @@ -7,16 +7,7 @@ adjust: duration: 10m when: arch == aarch64 -/upstream: - tag: upstream - summary: Run crun specific Podman tests on upstream PRs - - /podman_system_test: - test: make podman_system_test_upstream - -/downstream: - tag: downstream - summary: Run crun specific Podman tests on downstream bodhi / errata and dist-git PRs - - /podman_system_test: - test: make podman_system_test_downstream +/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 index 30be5a0cf6..78eeaff0bd 100644 --- a/tests/tmt/podman-tests.sh +++ b/tests/tmt/podman-tests.sh @@ -7,60 +7,16 @@ if [[ "$(id -u)" -ne 0 ]];then exit 1 fi -if [[ $1 == '' ]]; then - echo -e "Usage: podman-tests.sh STREAM\nSTREAM can be upstream or downstream" - exit 1 -fi - -STREAM=$1 - -CENTOS_VERSION=$(rpm --eval '%{?centos}') -RHEL_VERSION=$(rpm --eval '%{?rhel}') - -# For upstream tests, we need to test with podman and other packages from the -# podman-next copr. For downstream tests (bodhi, errata), we don't need any -# additional setup -if [[ "$STREAM" == "upstream" ]]; then - # Use CentOS Stream 10 copr target for RHEL-10 until EPEL 10 becomes - # available - # `rhel` macro exists on RHEL, CentOS Stream, and Fedora ELN - # `centos` macro exists only on CentOS Stream - if [[ -n $CENTOS_VERSION || $RHEL_VERSION -ge 10 ]]; then - dnf -y copr enable rhcontainerbot/podman-next centos-stream-"$CENTOS_VERSION" - else - dnf -y copr enable rhcontainerbot/podman-next - fi - echo "priority=5" >> /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:rhcontainerbot:podman-next.repo -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 -# Enable EPEL on RHEL to fetch bats, currently on RHEL 9 -# TODO: Switch to EPEL10 for RHEL10 once it's available -if [[ -n $RHEL_VERSION && "$RHEL_VERSION" -eq 9 ]]; then - dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-"$RHEL_VERSION".noarch.rpm -fi - -# Install test dependencies: bats and podman-tests -# Install bats from source on CentOS Stream 10 until EPEL 10 is -# available -if [[ -n $CENTOS_VERSION && $CENTOS_VERSION -eq 10 ]]; then - BATS_VERSION=1.11.0 - curl -sLO https://github.com/bats-core/bats-core/archive/refs/tags/v$BATS_VERSION.tar.gz - tar zxf v$BATS_VERSION.tar.gz - pushd bats-core-$BATS_VERSION - ./install.sh /usr - popd - dnf -y install podman-tests -else - dnf -y install bats podman-tests -fi +dnf -y install bats conmon podman podman-tests +dnf -y update cat /etc/redhat-release -rpm -q crun podman-tests +rpm -q conmon containers-common crun podman podman-tests # Run crun specific podman tests bats /usr/share/podman/test/system/030-run.bats