skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

Verify Events V2 API is up to date for render + deploy phase changes AND create docs page detailing the v1 -> v2 transition

Open aaron-prindle opened this issue 2 years ago • 4 comments

Tracking bug for updating the Events V2 API to support Skaffold V2 render + deploy changes.

  • go through Cloud Code CUJs/samples and identify any differences between Skaffold v1 and Skaffold v2 events
    • this can be done by running the desired skaffold command with --rpc-port=8080 and --event-log-file=logs.json and then looking at the generated logs.json.v2 file

Work items:

  • [x] verify/fix render + deploy phase for skaffold submit appropriate Events V2 state information (when compared to v1)
  • [ ] document the necessary changes in a skaffold docs page on if a user watch watching Skaffold Deploy state X in v1, what they would have to watch in v2, etc. to allow any tools that looked at Skaffold's v1 eventing (via the Events v2 API) to know how to migrate

aaron-prindle avatar Aug 08 '22 18:08 aaron-prindle

Hey @aaron-prindle could you elaborate the ask of this issue? I tested v2 events api with getting_started example by running skaffold dev --rpc-port=8080 --event-log-file=logs.json --rpc-http-port=9090 then run command to send request to v2/events api..curl localhost:9090/v2/events the output already contains render change and deploy change, example log

{"result":{"timestamp":"2022-08-10T02:44:03.039658Z","metaEvent":{"entry":"Starting Skaffold: \u0026{Version:v1.38.0-198-ge0e084fd3-dirty ConfigVersion:skaffold/v3alpha1 GitVersion: GitCommit:e0e084fd32a268130ca90064e5bc27595f7c421a BuildDate:2022-08-09T22:16:09Z GoVersion:go1.17.9 Compiler:gc Platform:darwin/amd64 User:}","metadata":{"build":{"artifacts":[{"type":"DOCKER","name":"skaffold-example","context":".","dockerfile":"Dockerfile"}],"type":"LOCAL","additional":{}},"deploy":{"deployers":[{"type":"KUBECTL","count":1}],"cluster":"MINIKUBE"},"test":null,"runID":"0078c08a-9bb2-463f-a23b-df692226572f","render":{"Renderers":[]},"additional":{}}}}}
{"result":{"timestamp":"2022-08-10T02:44:03.058238Z","taskEvent":{"id":"DevLoop-1","task":"DevLoop","description":"","iteration":1,"status":"InProgress","actionableErr":null}}}
{"result":{"timestamp":"2022-08-10T02:44:03.058494Z","metaEvent":{"entry":"Starting Skaffold: \u0026{Version:v1.38.0-198-ge0e084fd3-dirty ConfigVersion:skaffold/v3alpha1 GitVersion: GitCommit:e0e084fd32a268130ca90064e5bc27595f7c421a BuildDate:2022-08-09T22:16:09Z GoVersion:go1.17.9 Compiler:gc Platform:darwin/amd64 User:}","metadata":{"build":{"artifacts":[{"type":"DOCKER","name":"skaffold-example","context":".","dockerfile":"Dockerfile"}],"type":"LOCAL","additional":{}},"deploy":{"deployers":[{"type":"KUBECTL","count":1}],"cluster":"MINIKUBE"},"test":null,"runID":"0078c08a-9bb2-463f-a23b-df692226572f","render":{"Renderers":[]},"additional":{}}}}}
{"result":{"timestamp":"2022-08-10T02:44:03.058898Z","skaffoldLogEvent":{"task_id":"DevLoop-1","subtask_id":"-1","level":"STANDARD","message":"\u001b[34mListing files to watch...\u001b[0m\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.059180Z","skaffoldLogEvent":{"task_id":"DevLoop-1","subtask_id":"-1","level":"STANDARD","message":"\u001b[34m - skaffold-example\n\u001b[0m"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.782282Z","taskEvent":{"id":"Build-1","task":"Build","description":"Build containers","iteration":1,"status":"InProgress","actionableErr":null}}}
{"result":{"timestamp":"2022-08-10T02:44:03.782347Z","skaffoldLogEvent":{"task_id":"Build-1","subtask_id":"-1","level":"STANDARD","message":"\u001b[34mGenerating tags...\u001b[0m\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.783276Z","skaffoldLogEvent":{"task_id":"Build-1","subtask_id":"skaffold-example","level":"STANDARD","message":"\u001b[34m - skaffold-example -\u003e \u001b[0m"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.847147Z","skaffoldLogEvent":{"task_id":"Build-1","subtask_id":"skaffold-example","level":"STANDARD","message":"skaffold-example:v1.38.0-198-ge0e084fd3-dirty\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.847480Z","skaffoldLogEvent":{"task_id":"Build-1","subtask_id":"-1","level":"STANDARD","message":"\u001b[34mChecking cache...\u001b[0m\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.856892Z","buildSubtaskEvent":{"id":"skaffold-example","task_id":"Build-1","artifact":"skaffold-example","step":"Cache","status":"InProgress","actionableErr":null,"hostPlatform":"darwin/amd64","targetPlatforms":"linux/arm64"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.856911Z","skaffoldLogEvent":{"task_id":"Build-1","subtask_id":"skaffold-example","level":"STANDARD","message":"\u001b[34m - skaffold-example: \u001b[0m"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.857202Z","buildSubtaskEvent":{"id":"skaffold-example","task_id":"Build-1","artifact":"skaffold-example","step":"Cache","status":"Succeeded","actionableErr":null,"hostPlatform":"darwin/amd64","targetPlatforms":"linux/arm64"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.857240Z","skaffoldLogEvent":{"task_id":"Build-1","subtask_id":"skaffold-example","level":"STANDARD","message":"\u001b[32mFound Locally\u001b[0m\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.871722Z","taskEvent":{"id":"Build-1","task":"Build","description":"","iteration":1,"status":"Succeeded","actionableErr":null}}}
{"result":{"timestamp":"2022-08-10T02:44:03.872083Z","renderEvent":{"id":"0","task_id":"Render-1","status":"InProgress","actionableErr":null}}}
{"result":{"timestamp":"2022-08-10T02:44:03.875277Z","renderEvent":{"id":"0","task_id":"Render-1","status":"Succeeded","actionableErr":null}}}
{"result":{"timestamp":"2022-08-10T02:44:03.875819Z","skaffoldLogEvent":{"task_id":"Deploy-1","subtask_id":"-1","level":"STANDARD","message":"\u001b[34mTags used in deployment:\u001b[0m\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.876042Z","skaffoldLogEvent":{"task_id":"Deploy-1","subtask_id":"-1","level":"STANDARD","message":"\u001b[34m - skaffold-example -\u003e \u001b[0m"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.876081Z","skaffoldLogEvent":{"task_id":"Deploy-1","subtask_id":"-1","level":"STANDARD","message":"skaffold-example:93d1a29621ca00fed8e1f0196763152a9546bd07b89ec11d06bfc21ab744d935\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.876549Z","taskEvent":{"id":"Deploy-1","task":"Deploy","description":"Deploy to cluster","iteration":1,"status":"InProgress","actionableErr":null}}}
{"result":{"timestamp":"2022-08-10T02:44:03.876567Z","skaffoldLogEvent":{"task_id":"Deploy-1","subtask_id":"-1","level":"STANDARD","message":"\u001b[34mStarting deploy...\u001b[0m\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:03.876846Z","deploySubtaskEvent":{"id":"0","task_id":"Deploy-1","status":"InProgress","actionableErr":null}}}
{"result":{"timestamp":"2022-08-10T02:44:04.045389Z","skaffoldLogEvent":{"task_id":"Deploy-1","subtask_id":"0","level":"STANDARD","message":" - "}}}
{"result":{"timestamp":"2022-08-10T02:44:04.045828Z","skaffoldLogEvent":{"task_id":"Deploy-1","subtask_id":"0","level":"STANDARD","message":"pod/getting-started created\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:04.046865Z","deploySubtaskEvent":{"id":"0","task_id":"Deploy-1","status":"Succeeded","actionableErr":null}}}
{"result":{"timestamp":"2022-08-10T02:44:04.047420Z","skaffoldLogEvent":{"task_id":"Deploy-1","subtask_id":"-1","level":"STANDARD","message":"\u001b[34mWaiting for deployments to stabilize...\u001b[0m\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:05.102971Z","statusCheckSubtaskEvent":{"id":"pod/getting-started","task_id":"Deploy-1","resource":"pod/getting-started","status":"InProgress","message":"creating container getting-started","statusCode":"STATUSCHECK_CONTAINER_CREATING","actionableErr":{"errCode":"STATUSCHECK_CONTAINER_CREATING","message":"creating container getting-started","suggestions":[]}}}}
{"result":{"timestamp":"2022-08-10T02:44:05.102977Z","skaffoldLogEvent":{"task_id":"Deploy-1","subtask_id":"pod/getting-started","level":"STANDARD","message":" - pod/getting-started: creating container getting-started\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:07.189125Z","statusCheckSubtaskEvent":{"id":"pod/getting-started","task_id":"Deploy-1","resource":"pod/getting-started","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS","actionableErr":null}}}
{"result":{"timestamp":"2022-08-10T02:44:07.189141Z","skaffoldLogEvent":{"task_id":"Deploy-1","subtask_id":"pod/getting-started","level":"STANDARD","message":" - pod/getting-started: running.\n"}}}
{"result":{"timestamp":"2022-08-10T02:44:07.189598Z","statusCheckSubtaskEvent":{"id":"pods","task_id":"Deploy-1","resource":"pods","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS","actionableErr":null}}}

Do you mean when we run skaffold render/skaffold deploye, for each command we should be able to get some event logs by adding --rpc-port=xxx --event-log-file=xxx flags?

ericzzzzzzz avatar Aug 10 '22 17:08 ericzzzzzzz

@ericzzzzzzz the idea here is to verify that all of the necessary Events v2 API changes were made in the skaffold v2 binary (@ HEAD). In the case of any missing events, etc. - submit PRs to add those event/sub-event gaps into the v2 code. After the above (perhaps a no-op if everything is verified to be correct) the next step is to create a doc page with a v1 -> v2 migration/mapping guide for any tools that were watching Skaffold events in v1 and what events they should now watch that might be equivalent. One such tool is Cloud Code which will definitely need a guide like this to migrate from v1 -> v2.

I've added two items above with the two AIs mentioned in this comment. If you have verified that the render + deploy events for v2 are configured properly feel free to mark the first item done here.

aaron-prindle avatar Aug 15 '22 20:08 aaron-prindle

ohhh I see! Thank you!

ericzzzzzzz avatar Aug 15 '22 23:08 ericzzzzzzz

created a doc for events migrations https://docs.google.com/document/d/1X1bbanxm9AFTt08-8q2I4jqmgeiIicZqVSiNqixZj5s/edit?resourcekey=0-3eEKWqjN8HB9Wtx1whCNWQ#

ericzzzzzzz avatar Aug 31 '22 13:08 ericzzzzzzz

Closing, fixed now with the doc @ericzzzzzzz created

aaron-prindle avatar Sep 21 '22 18:09 aaron-prindle