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

Fix Erroneous "No BuildArchitecture specified in Layer" Warning #6508

Merged
merged 12 commits into from
Jan 8, 2024

Conversation

bentvelj
Copy link
Contributor

@bentvelj bentvelj commented Jan 3, 2024

Which issue(s) does this change fix?

#6444

Why is this change necessary?

Customers were reporting the warning of No BuildArchitecture specified in Layer when building Lambda Functions which referenced existing Lambda Layers. The error message also incorrectly appears while building Lambda Layers without a BuildMethod at all.

How does it address the issue?

Moved the logic which checks for missing BuildArchitecture from the LayerVersion constructor to the app builder build_layer function, so that warnings are not printed for layers that are not built.

What side effects does this change have?

N/A

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added area/build sam build command pr/internal labels Jan 3, 2024
Jared Bentvelsen added 2 commits January 3, 2024 15:49
@bentvelj bentvelj marked this pull request as ready for review January 4, 2024 01:21
@bentvelj bentvelj requested a review from a team as a code owner January 4, 2024 01:21
@bentvelj bentvelj requested review from lucashuy, sidhujus and mndeveci and removed request for lucashuy January 4, 2024 01:21
Copy link
Contributor

@sidhujus sidhujus left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines 507 to 510
LOG.warning(
"WARNING: No BuildArchitecture specified in Layer `%s`" + " Metadata. Defaulting to x86_64.",
layer_name,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want to print this warning message if layer has arm64 architecture as CompatibleArchitectures but it doesn't have BuildArchitecture property

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is another warning in the LayerVersion constructor that should take care of this.

It would output

WARNING: Layer `Layer` has BuildArchitecture `x86_64`, which is not listed in CompatibleArchitectures. 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This may be slightly confusing if the customer doesn't know that x86 is the default? Maybe we can adjust the messaging here

Copy link
Contributor

Choose a reason for hiding this comment

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

My concern with this one is; if I have a layer which is supposed to be built with x86 I will keep getting these warning messages all the time, which can be annoying.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. As discussed, going to restructure according to these rules:

There are two cases where we'd like to warn the customer

  1. Compatible Architectures is only x86 (or not present) but Build Architecture is arm64
  2. Build Architecture is x86 (or not present) but Compatible Architectures is only arm64

@bentvelj bentvelj requested a review from mndeveci January 8, 2024 17:30
@bentvelj bentvelj added this pull request to the merge queue Jan 8, 2024
Merged via the queue into aws:develop with commit f51e020 Jan 8, 2024
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build sam build command pr/internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants