Skip to content

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Apr 22, 2025

This is a backport of

to release-1.3 branch. Original description follows.


(from #4670)

High level overview:

  • bump shfmt and shellcheck;
  • get rid of some "shellcheck disable" annotations;
  • bump bats to v0.11.0 so we use the same version everywhere.

(from #4728)

We are seeing a ton on flakes on almalinux-8 CI job, all caused by criu inability to freeze a cgroup. This was worked around in criu (Freeze fixes and v1 kludges checkpoint-restore/criu#2545), but obviously we can't rely on a distro vendor to update the package.
Let's use a copr (thanks to @adrianreber!)

Fixes: #4273

ssh-keygen stopped working in AlmaLinux 8, fix this as well (see commit for details).

Fixes: #4731


(from #4736)

Package criu-4.1-1 has a known bug 1 which is fixed in criu-4.1-2 2,
which is currently only available in updates-testing. Add a kludge to
install newer criu if necessary to fix CI.

This will not be needed in ~2 weeks once the new package is promoted to
updates.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 6e5ffb7)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit b48dd65)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Those are no longer needed with shellcheck v0.10.0 (possibly with an
earlier version, too, but I am too lazy to check that).

While at it, fix a typo in the comment.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit af386d1)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1. There is no need to have -p option in mkdir here, since
   /home/rootless was already created by useradd above.

2. When there is no -p, there is no need to suppress the shellcheck
   warning (which looked like this):

> In script/setup_host_fedora.sh line 21:
> mkdir -m 0700 -p /home/rootless/.ssh
>       ^-- SC2174 (warning): When used with -p, -m only applies to the deepest directory.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit a76a136)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This makes the code more robust and allows to remove the
"shellcheck disable=SC2086" annotation.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 8e653e4)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This is the version available from Fedora 41.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit d31e6b8)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
We are seeing a ton on flakes on almalinux-8 CI job, all caused by criu
inability to freeze a cgroup. This was worked around in criu [1], but
obviously we can't rely on a distro vendor to update the package.

Let's use a copr (thanks to Adrian Reber!)

[1]: checkpoint-restore/criu#2545

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit b520f75)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
For some reason, ssh-keygen is unable to write to /root even as root on
AlmaLinux 8:

	# id
	uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:initrc_t:s0
	# id -Z
	ls -ld /root
	# ssh-keygen -t ecdsa -N "" -f /root/rootless.key || cat /var/log/audit/audit.log
	Saving key "/root/rootless.key" failed: Permission denied

The audit.log shows:

> type=AVC msg=audit(1744834995.352:546): avc:  denied  { dac_override } for  pid=13471 comm="ssh-keygen" capability=1  scontext=system_u:system_r:ssh_keygen_t:s0 tcontext=system_u:system_r:ssh_keygen_t:s0 tclass=capability permissive=0
> type=SYSCALL msg=audit(1744834995.352:546): arch=c000003e syscall=257 success=no exit=-13 a0=ffffff9c a1=5641c7587520 a2=241 a3=180 items=0 ppid=4978 pid=13471 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ssh-keygen" exe="/usr/bin/ssh-keygen" subj=system_u:system_r:ssh_keygen_t:s0 key=(null)␝ARCH=x86_64 SYSCALL=openat AUID="unset" UID="root" GID="root" EUID="root" SUID="root" FSUID="root" EGID="root" SGID="root" FSGID="root"

A workaround is to use /root/.ssh directory instead of just /root.

While at it, let's unify rootless user and key setup into a single place.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 87ae2f8)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin mentioned this pull request Apr 22, 2025
@kolyshkin kolyshkin requested review from AkihiroSuda and rata and removed request for AkihiroSuda April 22, 2025 07:46
@rata
Copy link
Member

rata commented Apr 22, 2025

Fedora is still failing related to CRIU: not ok 39 checkpoint and restore in external network namespace. I guess that's why it is still a draft?

@kolyshkin
Copy link
Contributor Author

Fedora is still failing related to CRIU: not ok 39 checkpoint and restore in external network namespace. I guess that's why it is still a draft?

Fedora is fixed separately in #4736 (which is also need to be backported, maybe I'll shove it in here).

@kolyshkin

This comment was marked as outdated.

Package criu-4.1-1 has a known bug [1] which is fixed in criu-4.1-2 [2],
which is currently only available in updates-testing. Add a kludge to
install newer criu if necessary to fix CI.

This will not be needed in ~2 weeks once the new package is promoted to
updates.

[1]: checkpoint-restore/criu#2650
[2]: https://bodhi.fedoraproject.org/updates/FEDORA-2025-d374d8ce17

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 3e3e048)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin changed the title [1.3] ci fixes (ssh-keygen and criu version bump for almalinux 8) [1.3] ci fixes (ssh-keygen and criu version bumps for almalinux 8 and fedora) Apr 23, 2025
@kolyshkin
Copy link
Contributor Author

Fedora is fixed separately in #4736 (which is also need to be backported, maybe I'll shove it in here).

Sorry for the confusion. I already did that :) just need to restart CI (hoping that Fedora mirrors are now updated)

I need more coffee but can't have any as it's almost 8pm here. Of course I haven't added it.

Added now, fingers crossed.

@kolyshkin

This comment was marked as outdated.

@kolyshkin kolyshkin marked this pull request as ready for review April 23, 2025 02:59
@kolyshkin
Copy link
Contributor Author

Fedora is fixed now.

@lifubang lifubang merged commit 9d70008 into opencontainers:release-1.3 Apr 23, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci backport/1.3-pr A backport PR to release-1.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants