Skip to content

Commit

Permalink
RPM/Packit: Fix wasm conditionals, cleanup rpm spec, update packit co…
Browse files Browse the repository at this point in the history
…nfig

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 <[email protected]>
  • Loading branch information
lsm5 committed Sep 2, 2024
1 parent 7501195 commit 03a827f
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 91 deletions.
27 changes: 20 additions & 7 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
trigger: pull_request
packages: [crun-centos]
notifications: *copr_build_failure_notification
targets:
targets: &centos_targets
# Need epel9 repos to fetch wasmedge build dependency
centos-stream-9-x86_64:
additional_repos:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
File renamed without changes.
22 changes: 5 additions & 17 deletions rpm/crun.spec
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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 <[email protected]>
- Placeholder changelog for envs that are not autochangelog-ready.
- Contact upstream if you need to report an issue with the build.
%endif
10 changes: 3 additions & 7 deletions tests/tmt/Makefile
Original file line number Diff line number Diff line change
@@ -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
17 changes: 4 additions & 13 deletions tests/tmt/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -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
50 changes: 3 additions & 47 deletions tests/tmt/podman-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 update
dnf -y install bats conmon podman podman-tests

cat /etc/redhat-release
rpm -q crun podman-tests
rpm -q conmon crun podman podman-tests

# Run crun specific podman tests
bats /usr/share/podman/test/system/030-run.bats

0 comments on commit 03a827f

Please sign in to comment.