Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to Fedora 40 #3785

Merged
merged 2 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# When rebasing to new Fedora, also update openshift/release:
# https://github.com/openshift/release/tree/master/ci-operator/config/coreos/coreos-assembler/coreos-coreos-assembler-main.yaml
FROM quay.io/fedora/fedora:39
FROM quay.io/fedora/fedora:40
WORKDIR /root/containerbuild

# Keep this Dockerfile idempotent for local development rebuild use cases.
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ install_rpms() {
frozendeps=""

# We freeze the version for now since we're carrying patches.
frozendeps+=" $(echo osbuild{,-ostree,-selinux,-tools}-114-1.fc39.noarch)"
frozendeps+=" $(echo osbuild{,-ostree,-selinux,-tools}-114-1.fc40.noarch)"

# First, a general update; this is best practice. We also hit an issue recently
# where qemu implicitly depended on an updated libusbx but didn't have a versioned
Expand Down
16 changes: 11 additions & 5 deletions src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,9 @@ runvm() {
# and include all GPG keys
find /etc/pki/rpm-gpg/ -type f >> "${vmpreparedir}/hostfiles"

local cmdoutput
cmdoutput=${tmp_builddir}/cmd-output.txt

# the reason we do a heredoc here is so that the var substition takes
# place immediately instead of having to proxy them through to the VM
cat > "${vmpreparedir}/init" <<EOF
Expand All @@ -752,7 +755,7 @@ rc=0
# - Use a subshell because otherwise init will use workdir as its cwd and we won't
# be able to unmount the virtiofs mount cleanly. This leads to consistency issues.
if [ -z "${RUNVM_SHELL:-}" ]; then
(cd ${workdir}; bash ${tmp_builddir}/cmd.sh |& tee /dev/virtio-ports/cosa-cmdout) || rc=\$?
(cd ${workdir}; bash ${tmp_builddir}/cmd.sh |& tee ${cmdoutput}) || rc=\$?
else
(cd ${workdir}; bash)
fi
Expand Down Expand Up @@ -786,7 +789,9 @@ EOF
printf '%q ' "$arg" >> "${tmp_builddir}"/cmd.sh
done

touch "${runvm_console}"
touch "${runvm_console}" "${cmdoutput}"
setpriv --pdeathsig SIGTERM -- tail -qF "${cmdoutput}" --pid $$ &
local tail_pid=$!

# There seems to be some false positives in shellcheck
# https://github.com/koalaman/shellcheck/issues/2217
Expand Down Expand Up @@ -821,9 +826,7 @@ EOF

if [ -z "${RUNVM_SHELL:-}" ]; then
if ! "${kola_args[@]}" -- "${base_qemu_args[@]}" \
-device virtserialport,chardev=virtioserial0,name=cosa-cmdout \
-chardev stdio,id=virtioserial0 \
"${qemu_args[@]}" <&-; then # the <&- here closes stdin otherwise qemu waits forever
"${qemu_args[@]}"; then
cat "${runvm_console}"
fatal "Failed to run 'kola qemuexec'"
fi
Expand All @@ -842,6 +845,9 @@ EOF
fi
rc="$(cat "${rc_file}")"

# cleanup tail before nuking dir containing file it's following
kill "$tail_pid"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a potential race here where tail could be killed before it finished actually printing all the output, even though qemu already exited. A simple fix is to just e.g. sleep 1 or whatever but ughhh. Really wish we could go back to the virtio-serial approach.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


if [ -n "${cleanup_tmpdir:-}" ]; then
rm -rf "${tmp_builddir}"
unset tmp_builddir
Expand Down
4 changes: 2 additions & 2 deletions tests/containers/tang/Containerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM registry.fedoraproject.org/fedora-minimal:39
FROM registry.fedoraproject.org/fedora-minimal:40

RUN microdnf -y install tang && microdnf clean all && rm -rf /var/cache/yum
EXPOSE 80

RUN systemctl enable tangd.socket

CMD ["/sbin/init"]
CMD ["/sbin/init"]
Loading