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

Emit TaskEvent messages for DevLoop, Build, and Deploy phases #5637

Merged
merged 5 commits into from
Apr 9, 2021

Conversation

MarlonGamez
Copy link
Contributor

@MarlonGamez MarlonGamez commented Apr 6, 2021

Merge After: #5641
Related: #5368 #5422
Description
Makes calls to eventV2 package to send out TaskEvent Protos. Also fixes what I believe to be an issue with the SkaffoldRunner.devIteration field not being updated after the first iteration

User facing changes (remove if N/A)
User can access v2 events endpoint and see TaskEvent messages being emitted.

Example:

{"result":{"timestamp":"2021-04-07T17:50:08.970854Z","taskEvent":{"id":"DevLoop-0","task":"DevLoop","iteration":0,"status":"InProgress","actionableErr":null}}}
{"result":{"timestamp":"2021-04-07T17:50:08.981571Z","taskEvent":{"id":"Build-0","task":"Build","iteration":0,"status":"InProgress","actionableErr":null}}}
{"result":{"timestamp":"2021-04-07T17:50:17.115852Z","taskEvent":{"id":"Build-0","task":"Build","iteration":0,"status":"Succeeded","actionableErr":null}}}
{"result":{"timestamp":"2021-04-07T17:50:17.990693Z","taskEvent":{"id":"Deploy-0","task":"Deploy","iteration":0,"status":"InProgress","actionableErr":null}}}
{"result":{"timestamp":"2021-04-07T17:50:22.981573Z","taskEvent":{"id":"Deploy-0","task":"Deploy","iteration":0,"status":"Succeeded","actionableErr":null}}}
{"result":{"timestamp":"2021-04-07T17:50:29.014458Z","taskEvent":{"id":"DevLoop-0","task":"DevLoop","iteration":0,"status":"Succeeded","actionableErr":null}}}
{"result":{"timestamp":"2021-04-07T17:53:33.602731Z","taskEvent":{"id":"DevLoop-1","task":"DevLoop","iteration":1,"status":"InProgress","actionableErr":null}}}
{"result":{"timestamp":"2021-04-07T17:53:33.604211Z","taskEvent":{"id":"Build-1","task":"Build","iteration":1,"status":"InProgress","actionableErr":null}}}
{"result":{"timestamp":"2021-04-07T17:53:48.021111Z","taskEvent":{"id":"Build-1","task":"Build","iteration":1,"status":"Succeeded","actionableErr":null}}}
{"result":{"timestamp":"2021-04-07T17:53:48.797537Z","taskEvent":{"id":"Deploy-1","task":"Deploy","iteration":1,"status":"InProgress","actionableErr":null}}}
{"result":{"timestamp":"2021-04-07T17:53:50.213166Z","taskEvent":{"id":"Deploy-1","task":"Deploy","iteration":1,"status":"Succeeded","actionableErr":null}}}
{"result":{"timestamp":"2021-04-07T17:53:54.512376Z","taskEvent":{"id":"DevLoop-1","task":"DevLoop","iteration":1,"status":"Succeeded","actionableErr":null}}}

Follow-up Work (remove if N/A)
Emit these messages for other phases of skaffold such as Test and StatusCheck

@MarlonGamez MarlonGamez requested a review from a team as a code owner April 6, 2021 23:06
@google-cla google-cla bot added the cla: yes label Apr 6, 2021
@codecov
Copy link

codecov bot commented Apr 6, 2021

Codecov Report

Merging #5637 (fa2491d) into master (f280aa8) will increase coverage by 0.06%.
The diff coverage is 68.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5637      +/-   ##
==========================================
+ Coverage   70.54%   70.61%   +0.06%     
==========================================
  Files         410      410              
  Lines       15640    15668      +28     
==========================================
+ Hits        11034    11064      +30     
+ Misses       3793     3790       -3     
- Partials      813      814       +1     
Impacted Files Coverage Δ
pkg/skaffold/runner/dev.go 72.22% <62.50%> (-0.95%) ⬇️
pkg/skaffold/runner/build_deploy.go 68.68% <66.66%> (-0.21%) ⬇️
pkg/skaffold/runner/deploy.go 51.35% <100.00%> (+2.05%) ⬆️
pkg/skaffold/server/server.go 41.96% <100.00%> (ø)
pkg/skaffold/util/tar.go 50.66% <0.00%> (-5.34%) ⬇️
pkg/skaffold/docker/parse.go 85.40% <0.00%> (+1.08%) ⬆️
pkg/skaffold/errors/errors.go 94.54% <0.00%> (+1.81%) ⬆️
pkg/skaffold/event/v2/event.go 67.55% <0.00%> (+6.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f280aa8...fa2491d. Read the comment docs.

Copy link
Contributor

@tejal29 tejal29 left a comment

Choose a reason for hiding this comment

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

This is great!
Can you add an example event stream ?

@tejal29
Copy link
Contributor

tejal29 commented Apr 7, 2021

/cc @etanshaul

@@ -190,7 +190,7 @@ func newGRPCServer(preferredPort int, usedPorts *util.PortSet) (func() error, in
}

func newHTTPServer(preferredPort, proxyPort int, usedPorts *util.PortSet) (func() error, error) {
mux := runtime.NewServeMux(runtime.WithProtoErrorHandler(errorHandler))
mux := runtime.NewServeMux(runtime.WithProtoErrorHandler(errorHandler), runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{OrigName: true, EmitDefaults: true}))
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!!!

@MarlonGamez MarlonGamez merged commit 15d0d05 into GoogleContainerTools:master Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants