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

use fedora:36 for RPM builds #2910

Conversation

knackaron
Copy link

@knackaron knackaron commented Feb 14, 2023

This addresses the file digest algorithm changing to SHA256 in RPM 4.14, which
was first included in Fedora 27 [1]. A few different sources outline the
details, see [2] and [3]. These digests must be included in the RPMs to be
installed on FIPS-enabled systems, as typically required by US government
organizations.

The Kubernetes RPMs are still being built with a Fedora 24 image, which doesn't
support the SHA256 algorithm. It's a pretty trivial change to swap the container
image used for building the RPMs, since the RPMs are just consuming the already
published binary artifacts from elsewhere.

Note, this does not have anything to do with package signatures or trying to
make the code FIPS-compliant. This is solely addressing the issue of
installing the binary RPMs onto FIPS-enabled systems without having to alter
anything at the system-level. This includes just the kubectl RPM on client
systems.

I also noted that there was effort to modernize the RPM package building
process in #1027, but that effort
seems to have stalled?

built with fedora:24

$ rpm -Kv /tmp/release/packages/rpm/output/x86_64/kubectl-1.19.0-0.x86_64.rpm
/tmp/release/packages/rpm/output/x86_64/kubectl-1.19.0-0.x86_64.rpm:
    Header SHA1 digest: OK
    MD5 digest: OK

built with fedora:36

$ rpm -Kv /tmp/release/packages/rpm/output/x86_64/kubectl-1.19.0-0.x86_64.rpm
/tmp/release/packages/rpm/output/x86_64/kubectl-1.19.0-0.x86_64.rpm:
    Header SHA256 digest: OK
    Header SHA1 digest: OK
    Payload SHA256 digest: OK
    MD5 digest: OK

[1] - https://fedoraproject.org/wiki/Changes/RPM-4.14
[2] - https://www.starlab.io/blog/adding-sha256-digests-to-rpms
[3] - https://bugzilla.cendio.com/show_bug.cgi?id=7809#c2

/kind bug

fixes the RPM digest algorithm to allow installation on
FIPS-enabled operating systems

Signed-off-by: Aron Parsons <[email protected]>
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority labels Feb 14, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @knackaron!

It looks like this is your first PR to kubernetes/release 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/release has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 14, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @knackaron. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the area/release-eng Issues or PRs related to the Release Engineering subproject label Feb 14, 2023
@k8s-ci-robot k8s-ci-robot requested a review from spiffxp February 14, 2023 22:29
@k8s-ci-robot k8s-ci-robot added sig/release Categorizes an issue or PR as relevant to SIG Release. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 14, 2023
@knackaron
Copy link
Author

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 14, 2023
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

@kubernetes/release-managers PTAL

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 15, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 15, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: knackaron, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 15, 2023
@saschagrunert
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 15, 2023
@@ -42,7 +42,7 @@ for ARCH in ${ARCHS[@]}; do
sed -i "s/\%global ARCH.*/\%global ARCH ${GOARCH}/" ${SRC_PATH}/kubelet.spec
# Download sources if not already available
cd ${SRC_PATH} && spectool -gf kubelet.spec
/usr/bin/rpmbuild --target ${RPMARCH} --define "_sourcedir ${SRC_PATH}" -bb ${SRC_PATH}/kubelet.spec
/usr/bin/rpmbuild --target ${RPMARCH} --define "_sourcedir ${SRC_PATH}" --define "_smp_build_ncpus 1" --define "__os_install_post %{nil}" -bb ${SRC_PATH}/kubelet.spec
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these extra defines? The commit message doesn't clarify.

Copy link
Author

Choose a reason for hiding this comment

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

They were the most pragmatic solution to issues encountered with some of the cross-compilation targets.

Disabling __os_install_post is to stop the standard macros rpmbuild uses from stripping the binaries. Stripping is fine on x86_64, but not on ARM targets (since their cross-compilation tools aren't installed):

+ /usr/lib/rpm/brp-strip /usr/bin/strip
/usr/bin/strip: Unable to recognise the format of the input file `/root/rpmbuild/BUILDROOT/kubelet-1.19.0-0.%{_arch}/usr/bin/crictl'
/usr/bin/strip: Unable to recognise the format of the input file `/root/rpmbuild/BUILDROOT/kubelet-1.19.0-0.%{_arch}/opt/cni/bin/bridge'

If deemed important, I can work in the logic to install the correct cross-compiler binutils packages per arch and override per build target. The patch gets a little larger at that point.

Setting _smp_build_ncpus is to work around a dependency issue. This macro is defined by build-constraints-rpm-macros, which has a conflict with redhat-rpm-macros:

Error: Transaction test error:
  file /usr/lib/rpm/macros.d/macros.build-constraints from install of build-constraints-rpm-macros-1-2.fc36.noarch conflicts with file from package redhat-rpm-config-222-1.fc36.noarch

Not defining _smp_build_ncpus results in:

+ /usr/lib/rpm/check-rpaths
xargs: invalid number "%{_smp_build_ncpus}" for -P option
Try 'xargs --help' for more information.
error: Bad exit status from /var/tmp/rpm-tmp.jLaICn (%install)

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 11, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 11, 2023
@k8s-ci-robot k8s-ci-robot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jul 11, 2023
@saschagrunert
Copy link
Member

Obsolete with #3265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-priority ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/release Categorizes an issue or PR as relevant to SIG Release. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants