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

buildsys: Add option to force upstream source usage for specific packages #3333

Merged

Conversation

foersleo
Copy link
Contributor

@foersleo foersleo commented Aug 9, 2023

Issue number: -

Description of changes:

When building packages and we do not find the appropriate source files in the look-aside cache
we do not check the upstream source by default. We can allow using upstream as a fallback through
setting BUILDSYS_UPSTREAM_SOURCE_FALLBACK=true in the environment.
However, for some packages (i.e. nvidia drivers) we will never vend a copy of the upstream sources
in the look-aside cache for licensing reasons. With the linux-firmware package (#3296) we will probably grow another package that falls into that category.
Add an optional setting for external-files to force the use of upstream sources to allow these packages
to not derail a build where we forget to set the appropriate environment variable. Select the always upstream
source lookup for all nvidia kmod packages.

Testing done:

Building the nvidia kmod packages without specifying -e BUILDSYS_UPSTREAM_SOURCE_FALLBACK=true works:

$ cargo make -e BUILDSYS_VARIANT=aws-k8s-1.26-nvidia -e PACKAGE=kmod-5_15-nvidia build-package
[...]
[cargo-make] INFO - Running Task: build-package
   Compiling kmod-5_15-nvidia v0.1.0 (/home/fedora/src/bottlerocket/packages/kmod-5.15-nvidia)
    Finished dev [optimized] target(s) in 1m 39s
[cargo-make] INFO - Build Done in 105.83 seconds.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@foersleo foersleo requested review from etungsten and yeazelm August 9, 2023 17:10
@foersleo
Copy link
Contributor Author

foersleo commented Aug 9, 2023

If we decide to do this we may want to simplify the special casing for nvidia variants in our github workflows.

For some packages we build in Bottlerocket we can not cache the external
files for licensing restrictions (i.e. nvidia drivers). These packages
will always fail to build without having the package downloaded
previously or setting `BUILDSYS_UPSTREAM_SOURCE_FALLBACK=true` in the
environment.

Add an optional setting for external files enabling forcing upstream
fallback. This can be added to those packages we never intend to upload
to the lookaside cache.

Signed-off-by: Leonard Foerster <foersleo@amazon.com>
We will not upload the nvidia driver sources to our lookaside cache. As
they always have to come from upstream, force getting the files from
there.

Signed-off-by: Leonard Foerster <foersleo@amazon.com>
@foersleo foersleo force-pushed the buildsys_per_package_upstream branch from 4c53f1c to aea18de Compare August 9, 2023 17:22
@foersleo
Copy link
Contributor Author

foersleo commented Aug 9, 2023

⬆️ Force push fixed the formatting issue I produced. First time rust contributor in Bottlerocket, so please be patient with me.

Copy link
Contributor

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

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

Nice!!

Copy link
Member

@markusboehme markusboehme left a comment

Choose a reason for hiding this comment

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

About time. Been falling into the trap a few times already. Thanks! 🙂

@foersleo foersleo merged commit 162ff22 into bottlerocket-os:develop Aug 10, 2023
@foersleo foersleo deleted the buildsys_per_package_upstream branch August 10, 2023 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants