GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bake: various fixes for composable attributes by jsternberg · Pull Request #2814 · docker/buildx

Conversation

@jsternberg

@jsternberg jsternberg commented Nov 22, 2024 •
edited by crazy-max
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

This changes how the composable attributes are implemented and provides
various fixes to the first iteration.

Cache-from and cache-to now no longer print sensitive values that are
automatically added. These automatically added attributes are added when
the protobuf is created rather than at the time of parsing so they will
no longer be printed. If they are part of the original configuration
file, they will still be printed.

Empty strings will now be skipped. This was the original behavior and
composable attributes removed this functionality accidentally. This
functionality is now restored.

This also expands the available syntax that works with each of the
composable attributes. It is now possible to interleave the csv syntax
with the object syntax without any problems. The canonical form is still
the object syntax and variables are resolved according to that syntax.

Fixes #2823.
Fixes #2822.
Fixes #2858

Replaces #2832.
Replaces #2833.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot added area/bake area/tests labels Nov 22, 2024
@jsternberg
jsternberg force-pushed the bake-composable-attributes-phase2 branch from 72a566c to 73f055d Compare November 25, 2024 18:29
@jsternberg
jsternberg force-pushed the bake-composable-attributes-phase2 branch from 73f055d to 70c1cad Compare December 6, 2024 21:05
@github-actions github-actions Bot added the area/bake/compose label Dec 6, 2024
@jsternberg
jsternberg force-pushed the bake-composable-attributes-phase2 branch 2 times, most recently from 8eafb54 to 753705d Compare December 9, 2024 16:04
@thompson-shaun
thompson-shaun requested a review from crazy-max December 9, 2024 17:03
@jsternberg
jsternberg force-pushed the bake-composable-attributes-phase2 branch 2 times, most recently from d03e42f to 4e32acc Compare December 9, 2024 21:57
@jsternberg jsternberg changed the title bake: implement composable attribute for attest bake: various fixes for composable attributes Dec 9, 2024
@jsternberg
jsternberg requested a review from tonistiigi December 9, 2024 21:59
@jsternberg
jsternberg force-pushed the bake-composable-attributes-phase2 branch from 4e32acc to 91f0596 Compare December 9, 2024 21:59
@jsternberg
jsternberg marked this pull request as ready for review December 9, 2024 22:00
@jsternberg jsternberg mentioned this pull request Dec 9, 2024
bake: cache-from/cache-to options no longer print sensitive values #2833
Closed
@jsternberg
jsternberg force-pushed the bake-composable-attributes-phase2 branch 2 times, most recently from e86f8b3 to e466b5b Compare December 9, 2024 22:08
@jsternberg jsternberg mentioned this pull request Dec 9, 2024
bake: implement composable attributes for attestations #2848
Merged
@crazy-max
crazy-max force-pushed the bake-composable-attributes-phase2 branch from e466b5b to d0212a9 Compare December 11, 2024 11:29
@crazy-max

crazy-max commented Dec 11, 2024

Copy link
Copy Markdown
Member

rebased to fix xx issue

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@crazy-max crazy-max added this to the v0.20.0 milestone Dec 11, 2024
crazy-max
crazy-max approved these changes Dec 11, 2024
View reviewed changes

@crazy-max crazy-max left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Tested on my side on various projects and looks great!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
crazy-max
crazy-max reviewed Dec 11, 2024
View reviewed changes
Comment thread tests/bake.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@crazy-max crazy-max mentioned this pull request Dec 16, 2024
[v0.19] bake: remove empty values set by --set #2861
Merged
tonistiigi
tonistiigi reviewed Dec 17, 2024
View reviewed changes
Comment thread util/buildflags/utils.go
Equal(other E) bool
}

func removeDupes[E comparable[E]](s []E) []E {

@tonistiigi tonistiigi Dec 17, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This seems to be duplicated. Additionally (not for this PR) there is also removeDupesStr but it uses map. I think this could also avoid N^2 complexity but not sure if worth it as the inputs are likely small.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jsternberg jsternberg Dec 18, 2024

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The purpose of this was it could utilize the Equal method that was added so it wasn't so dependent on strings. Due to the small number of inputs, the N^2 complexity isn't likely to be an issue. This might actually be faster than removeDupesStr just because maps have some issues when used for deduplicating small inputs due to overhead from memory allocation and hash key lookups.

This was duplicated and I've removed the duplicate from bake/bake.go. When I originally did this, it was in bake/bake.go and then I started moving stuff. It was easier to just copy it at the time. Since I missed the change to call Normalize() for t.SSH as pointed out in the other comment, the linter didn't catch that the original call was no longer needed since all calls had been moved to this file. I've changed that to use Normalize() and removed the duplicate.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bake/bake.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread bake/bake.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Dec 17, 2024
Regression in handling of empty lists on command line #2858
Closed
Add "bake: additional test for empty variable" from v0.19 branch #2825
Closed
@jsternberg
jsternberg force-pushed the bake-composable-attributes-phase2 branch 3 times, most recently from bb1f448 to 15d291c Compare December 18, 2024 16:19
@jsternberg
bake: various fixes for composable attributes
5dd4ae0
This changes how the composable attributes are implemented and provides
various fixes to the first iteration.

Cache-from and cache-to now no longer print sensitive values that are
automatically added. These automatically added attributes are added when
the protobuf is created rather than at the time of parsing so they will
no longer be printed. If they are part of the original configuration
file, they will still be printed.

Empty strings will now be skipped. This was the original behavior and
composable attributes removed this functionality accidentally. This
functionality is now restored.

This also expands the available syntax that works with each of the
composable attributes. It is now possible to interleave the csv syntax
with the object syntax without any problems. The canonical form is still
the object syntax and variables are resolved according to that syntax.

Signed-off-by: Jonathan A. Sternberg <[email protected]>
@jsternberg
jsternberg force-pushed the bake-composable-attributes-phase2 branch from 15d291c to 5dd4ae0 Compare December 18, 2024 16:26
@jsternberg
jsternberg requested a review from tonistiigi December 18, 2024 17:00
tonistiigi
tonistiigi approved these changes Dec 18, 2024
View reviewed changes
@tonistiigi
tonistiigi merged commit 3771fe2 into docker:master Dec 18, 2024
This was referenced Jan 21, 2025
[v5] mark buildx >= 0.20.0 as incompatible with docker/bake-action < v6 docker/bake-action#289
Closed
[v5] Bump @docker/actions-toolkit from 0.47.0 to 0.51.0 docker/bake-action#291
Merged
[v4] mark buildx >= 0.20.0 as incompatible with docker/bake-action < v5 docker/bake-action#290
Merged
@farvour farvour mentioned this pull request Jan 22, 2025
Action v6 using --cache-from isn't compatible with latest docker buildx 0.20.0 #2942
Closed
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@crazy-max crazy-max crazy-max approved these changes
@tonistiigi tonistiigi tonistiigi approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area/bake/compose area/bake area/tests

Projects

None yet

Milestone

v0.20.0

Development

Successfully merging this pull request may close these issues.

Regression in handling of empty lists on command line [v0.19.0] bake: cache-to/cache-from attributes output credentials with --print [v0.19.0] bake: Unsuitable value: EOF

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@jsternberg @crazy-max @tonistiigi
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.