-
Notifications
You must be signed in to change notification settings - Fork 23
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 async states #390
base: main
Are you sure you want to change the base?
Use async states #390
Conversation
This allows us to put merges under a progress group and is purely cosmetic. Signed-off-by: Brian Goff <[email protected]>
This wraps the signer in an async state so it can be lazily evaluated regardless of if the actual signer needs to unlazy the build. Signed-off-by: Brian Goff <[email protected]>
Before this was returning early when there are file-based errors, however it is still helpful to run the rest of the tests so we can see all errors in one go. Signed-off-by: Brian Goff <[email protected]>
This generally cleans up some things in the test runner a little bit and makes it so more checks are run in parallel and mostly avoids needing to unlazy the build while we are processing the spec. It also does a better job of collecting and returning errors related to failed tests rather than returning just a single error immediately on a single test failure. Before this change the for loops may block to solve states and prevent progress from happening. Signed-off-by: Brian Goff <[email protected]>
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 needs a rebase -- I'll give it a proper review once that's done.
@@ -247,6 +247,14 @@ func getSignConfigCtxName(client gwclient.Client) string { | |||
|
|||
type asyncStateFunc func(context.Context, llb.State, *llb.Constraints) (llb.State, error) | |||
|
|||
func withConstraints(in *llb.Constraints) dalec.ConstraintsOptFunc { |
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.
There's now a project-wide solution for this, dalec.WithConstraints
for k, st := range inputs { | ||
def, err := st.Marshal(ctx, withConstraints) | ||
def, err := st.Marshal(ctx, withConstraints(constraints)) |
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.
see above
if err != nil { | ||
return llb.Scratch(), err | ||
} | ||
m[k] = def.ToPB() | ||
} | ||
req.FrontendInputs = m | ||
|
||
stateDef, err := st.Marshal(ctx, withConstraints) | ||
stateDef, err := st.Marshal(ctx, withConstraints(constraints)) |
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.
see above
Make use of async states to help prevent unlazying builds until we are ready to solve things.
See individual commits for more details.