-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Initial support for Knative Build #851
Conversation
pkg/skaffold/build/knative/build.go
Outdated
} | ||
|
||
func waitForCompletion(builds build_v1alpha1.BuildInterface, build *v1alpha1.Build) error { | ||
for { |
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.
why busy wait?
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.
@AkihiroSuda I'm not sure I understand your comment
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.
Does not this loop consume CPU too much?
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.
No, it's done just after the logs are done tailing so it usually succeeds i getting the status the first time. But since there's a few ms between the logs being done and the status being updated, it sometimes requires a retry.
pkg/skaffold/build/knative/build.go
Outdated
Custom: &v1.Container{ | ||
Image: "gcr.io/cloud-builders/gsutil", // TODO(dgageot) way too big | ||
Command: []string{"sh", "-c"}, | ||
Args: []string{fmt.Sprintf("gsutil cp gs://%s/%s - | tar xvz", cfg.GCSBucket, tarName)}, |
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.
Are these escaped?
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 piece needs fixing.
2fd02c4
to
78a16f7
Compare
04d0bbd
to
1639bf6
Compare
Codecov Report
@@ Coverage Diff @@
## master #851 +/- ##
=========================================
- Coverage 43.55% 43.5% -0.05%
=========================================
Files 63 63
Lines 2645 2648 +3
=========================================
Hits 1152 1152
- Misses 1373 1376 +3
Partials 120 120
Continue to review full report at Codecov.
|
very cool @dgageot ! How would you feel about including some docs in this PR that explain how to use it? (makes reviewing easier too) |
pkg/skaffold/build/knative.go
Outdated
var builds []Artifact | ||
|
||
for _, artifact := range artifacts { | ||
fmt.Fprintf(out, "Building [%s]...\n", artifact.ImageName) |
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.
what do you think about outputting this in color (blue?)?
e17d117
to
eeef9c2
Compare
568fd6c
to
a4a1a3b
Compare
6cdd90a
to
d0de097
Compare
Is this ready for a look yet? |
Currently focused on supporting Docker build artifacts Signed-off-by: David Gageot <david@gageot.net>
Ping, what's left here? |
I think this is the right approach to use for using skaffold in a kubernetes-hosted CI job. Have other folks tried this PR yet? |
I need to rebase this code, sync it with recent knative build and fix the TODOs. Might have time to do that this week |
ping @dgageot are you okay with me to fork this and continue where you left it? |
This is a pretty tight integration. It would be neat if skaffold had the capability to use pre-existing Build and BuildTemplate resources rather than create fixed implementations with gcs/kaniko. |
I can take a look at this as well now. I'll pull this code down and see if i can help take it forward. |
@dgageot so i'm thinking about adding support for knative build resources. Tricky part is generating the input from the local build context. This current implementation uses an object store as a drop-off. So the sequence would be something like:
Thoughts? |
@bkuschel Hi! I just heard that Knative Build is going to evolve a LOT in the upcoming weeks. You might want to hold on any effort and see how it turns out |
@dgageot Is there some doc or example on how to use it with knative? |
This PR brings initial support for https://github.com/knative/build. It currently focused on supporting Docker build artifacts. Bazel artifacts should be easy to add.
Signed-off-by: David Gageot david@gageot.net