GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15.04k stars 1.62k forks source link

Grouping port forward events #4578

Closed matthewmichihara closed 4 years ago

matthewmichihara commented 4 years ago

In Cloud Code for IntelliJ, when we start a Skaffold dev session for one of the guestbook samples, we show events in the IntelliJ event log like this:

Screen Shot 2020-07-28 at 8 59 14 AM

The three highlighted event log items are generated from three individual Skaffold port forward events from the Skaffold gRPC API. These port forward event log items are likely some of the most important that we show because they contain URLs for users to click on to test out their application.

General UX feedback here has been that we should try to group these events into one event log item. In IntelliJ, it is hard for us to do this because each port forward event is received separately, and we don't know when we've received them all. We (IntelliJ) could try to count the number of services with port-forwarding set up and use that to implement our grouping logic, but that sounds very error-prone as custom port forwarding configurations in skaffold.yaml are possible.

Skaffold seems like it would be better suited to implement port forward event grouping than the IDEs. Is this something we could somehow expose via the API? Is this possible / desirable?

matthewmichihara commented 4 years ago

@briandealwis - related to some of our earlier chats. Filed this to consolidate the thinking behind what's possible here.

briandealwis commented 4 years ago

I don't think there's much Skaffold can do here:

All I can suggest is batching and rolling up events within some window of time. Can you remove or replace events from this view?

matthewmichihara commented 4 years ago

Thanks @briandealwis. That basically sounds like the current VSCode approach, where they batch port forward events within some time window. We've been hesitant to take this approach in IntelliJ as it feels error prone.

In IntelliJ, unfortunately we can't remove or replace events in the event logs, only append.

briandealwis commented 4 years ago

Ultimately Skaffold should be trying to push out its events in as close to real time as possible. You could use the devLoop event as an end event, especially when it is combined with the status-checks, which will wait until the system stabilizes.

matthewmichihara commented 4 years ago

Interesting idea, will play around with using the devLoop event as a grouping end event.

matthewmichihara commented 4 years ago

Did a little bit of experimenting with skaffold dev --port-forward --status-check, but it looks like the port-forwarding events come in after the completion devLoopEvent (see last few lines of this event log) --

{"result":{"timestamp":"2020-07-31T17:55:01.864053Z","event":{"metaEvent":{"entry":"Starting Skaffold: \u0026{Version:v1.12.1 ConfigVersion:skaffold/v2beta5 GitVersion: GitCommit:ccd40dcee12171c96fd96f9a959d549971c920c1 GitTreeState:clean BuildDate:2020-07-15T04:49:23Z GoVersion:go1.14.4 Compiler:gc Platform:darwin/amd64}","metadata":{"build":{"numberOfArtifacts":2,"builders":[{"type":"JIB","count":2}],"type":"LOCAL"},"deploy":{"deployers":[{"type":"KUBECTL","count":1}],"cluster":"OTHER"}}}}}}
{"result":{"timestamp":"2020-07-31T17:55:01.864088Z","event":{"devLoopEvent":{"status":"In Progress"}},"entry":"DevInit Iteration 0 in progress"}}
{"result":{"timestamp":"2020-07-31T17:55:06.580456Z","event":{"deployEvent":{"status":"In Progress"}},"entry":"Deploy started"}}
{"result":{"timestamp":"2020-07-31T17:55:07.106410Z","event":{"deployEvent":{"status":"Complete"}},"entry":"Deploy complete"}}
{"result":{"timestamp":"2020-07-31T17:55:07.106457Z","event":{"statusCheckEvent":{"status":"Started"}},"entry":"Status check started"}}
{"result":{"timestamp":"2020-07-31T17:55:08.107132Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-frontend-745d96b95f-2vnc9","status":"In Progress","message":"creating container frontend","statusCode":"STATUSCHECK_CONTAINER_CREATING","actionableErr":{"errCode":"STATUSCHECK_CONTAINER_CREATING","message":"creating container frontend"}}},"entry":"Resource pod/java-guestbook-frontend-745d96b95f-2vnc9 status updated to In Progress"}}
{"result":{"timestamp":"2020-07-31T17:55:08.108349Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-mongodb-7fc8d64d6b-dl6nt","status":"In Progress","message":"creating container mongo","statusCode":"STATUSCHECK_CONTAINER_CREATING","actionableErr":{"errCode":"STATUSCHECK_CONTAINER_CREATING","message":"creating container mongo"}}},"entry":"Resource pod/java-guestbook-mongodb-7fc8d64d6b-dl6nt status updated to In Progress"}}
{"result":{"timestamp":"2020-07-31T17:55:08.120780Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-backend-68747cd7dc-dmz74","status":"Failed","err":"container init-db-ready in error: ","statusCode":"STATUSCHECK_CONTAINER_WAITING_UNKNOWN","actionableErr":{"errCode":"STATUSCHECK_CONTAINER_WAITING_UNKNOWN","message":"container init-db-ready in error: "}}},"entry":"Resource pod/java-guestbook-backend-68747cd7dc-dmz74 status failed with container init-db-ready in error: "}}
{"result":{"timestamp":"2020-07-31T17:55:08.266772Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-backend","status":"In Progress","message":"waiting for rollout to finish: 0 of 1 updated replicas are available...\n","statusCode":"STATUSCHECK_DEPLOYMENT_ROLLOUT_PENDING","actionableErr":{"errCode":"STATUSCHECK_DEPLOYMENT_ROLLOUT_PENDING","message":"waiting for rollout to finish: 0 of 1 updated replicas are available...\n"}}},"entry":"Resource deployment/java-guestbook-backend status updated to In Progress"}}
{"result":{"timestamp":"2020-07-31T17:55:08.266882Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-frontend","status":"In Progress","message":"waiting for rollout to finish: 0 of 1 updated replicas are available...\n","statusCode":"STATUSCHECK_DEPLOYMENT_ROLLOUT_PENDING","actionableErr":{"errCode":"STATUSCHECK_DEPLOYMENT_ROLLOUT_PENDING","message":"waiting for rollout to finish: 0 of 1 updated replicas are available...\n"}}},"entry":"Resource deployment/java-guestbook-frontend status updated to In Progress"}}
{"result":{"timestamp":"2020-07-31T17:55:08.266889Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-mongodb","status":"In Progress","message":"waiting for rollout to finish: 0 of 1 updated replicas are available...\n","statusCode":"STATUSCHECK_DEPLOYMENT_ROLLOUT_PENDING","actionableErr":{"errCode":"STATUSCHECK_DEPLOYMENT_ROLLOUT_PENDING","message":"waiting for rollout to finish: 0 of 1 updated replicas are available...\n"}}},"entry":"Resource deployment/java-guestbook-mongodb status updated to In Progress"}}
{"result":{"timestamp":"2020-07-31T17:55:08.465633Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-mongodb-7fc8d64d6b-dl6nt","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource pod/java-guestbook-mongodb-7fc8d64d6b-dl6nt status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:08.468428Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-frontend-745d96b95f-2vnc9","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource pod/java-guestbook-frontend-745d96b95f-2vnc9 status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:08.549466Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-backend-68747cd7dc-dmz74","status":"Failed","err":"container init-db-ready terminated with exit code 0","statusCode":"STATUSCHECK_CONTAINER_TERMINATED","actionableErr":{"errCode":"STATUSCHECK_CONTAINER_TERMINATED","message":"container init-db-ready terminated with exit code 0","suggestions":[{"suggestionCode":"CHECK_CONTAINER_LOGS","action":"Try checking container logs"}]}}},"entry":"Resource pod/java-guestbook-backend-68747cd7dc-dmz74 status failed with container init-db-ready terminated with exit code 0"}}
{"result":{"timestamp":"2020-07-31T17:55:08.766983Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-backend","status":"In Progress","message":"waiting for rollout to finish: 0 of 1 updated replicas are available...\n","statusCode":"STATUSCHECK_DEPLOYMENT_ROLLOUT_PENDING","actionableErr":{"errCode":"STATUSCHECK_DEPLOYMENT_ROLLOUT_PENDING","message":"waiting for rollout to finish: 0 of 1 updated replicas are available...\n"}}},"entry":"Resource deployment/java-guestbook-backend status updated to In Progress"}}
{"result":{"timestamp":"2020-07-31T17:55:08.774823Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-mongodb","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-mongodb status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:08.781168Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-frontend","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-frontend status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:09.796353Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-backend","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-backend status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:09.796795Z","event":{"statusCheckEvent":{"status":"Succeeded"}},"entry":"Status check succeeded"}}
{"result":{"timestamp":"2020-07-31T17:55:09.805701Z","event":{"portEvent":{"localPort":8080,"remotePort":8080,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-backend","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 8080"}}
{"result":{"timestamp":"2020-07-31T17:55:09.806006Z","event":{"portEvent":{"localPort":4503,"remotePort":80,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-frontend","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 4503"}}
{"result":{"timestamp":"2020-07-31T17:55:09.807799Z","event":{"portEvent":{"localPort":27017,"remotePort":27017,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-mongodb","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 27017"}}
{"result":{"timestamp":"2020-07-31T17:55:09.809685Z","event":{"devLoopEvent":{"status":"Succeeded"}},"entry":"DevInit Iteration 0 successful"}}
{"result":{"timestamp":"2020-07-31T17:55:36.281449Z","event":{"devLoopEvent":{"status":"In Progress"}},"entry":"DevInit Iteration 0 in progress"}}
{"result":{"timestamp":"2020-07-31T17:55:36.283708Z","event":{"buildEvent":{"artifact":"java-guestbook-frontend","status":"In Progress"}},"entry":"Build started for artifact java-guestbook-frontend"}}
{"result":{"timestamp":"2020-07-31T17:55:43.553463Z","event":{"buildEvent":{"artifact":"java-guestbook-frontend","status":"Complete"}},"entry":"Build completed for artifact java-guestbook-frontend"}}
{"result":{"timestamp":"2020-07-31T17:55:43.571623Z","event":{"deployEvent":{"status":"In Progress"}},"entry":"Deploy started"}}
{"result":{"timestamp":"2020-07-31T17:55:43.760812Z","event":{"deployEvent":{"status":"Complete"}},"entry":"Deploy complete"}}
{"result":{"timestamp":"2020-07-31T17:55:43.760827Z","event":{"statusCheckEvent":{"status":"Started"}},"entry":"Status check started"}}
{"result":{"timestamp":"2020-07-31T17:55:44.144743Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-frontend","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-frontend status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:44.144731Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-frontend-745d96b95f-2vnc9","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource pod/java-guestbook-frontend-745d96b95f-2vnc9 status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:44.145912Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-mongodb","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-mongodb status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:44.145916Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-mongodb-7fc8d64d6b-dl6nt","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource pod/java-guestbook-mongodb-7fc8d64d6b-dl6nt status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:44.224225Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-backend-68747cd7dc-dmz74","status":"Failed","err":"container init-db-ready terminated with exit code 0","statusCode":"STATUSCHECK_CONTAINER_TERMINATED","actionableErr":{"errCode":"STATUSCHECK_CONTAINER_TERMINATED","message":"container init-db-ready terminated with exit code 0","suggestions":[{"suggestionCode":"CHECK_CONTAINER_LOGS","action":"Try checking container logs"}]}}},"entry":"Resource pod/java-guestbook-backend-68747cd7dc-dmz74 status failed with container init-db-ready terminated with exit code 0"}}
{"result":{"timestamp":"2020-07-31T17:55:44.224261Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-backend","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-backend status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:44.224326Z","event":{"statusCheckEvent":{"status":"Succeeded"}},"entry":"Status check succeeded"}}
{"result":{"timestamp":"2020-07-31T17:55:44.231779Z","event":{"devLoopEvent":{"status":"Succeeded"}},"entry":"DevInit Iteration 0 successful"}}
{"result":{"timestamp":"2020-07-31T17:55:44.232070Z","event":{"portEvent":{"localPort":8080,"remotePort":8080,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-backend","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 8080"}}
{"result":{"timestamp":"2020-07-31T17:55:44.232192Z","event":{"portEvent":{"localPort":4503,"remotePort":80,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-frontend","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 4503"}}
{"result":{"timestamp":"2020-07-31T17:55:44.232273Z","event":{"portEvent":{"localPort":27017,"remotePort":27017,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-mongodb","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 27017"}}
{"result":{"timestamp":"2020-07-31T17:55:44.241893Z","event":{"devLoopEvent":{"iteration":1,"status":"In Progress"}},"entry":"DevInit Iteration 1 in progress"}}
{"result":{"timestamp":"2020-07-31T17:55:44.245457Z","event":{"buildEvent":{"artifact":"java-guestbook-frontend","status":"In Progress"}},"entry":"Build started for artifact java-guestbook-frontend"}}
{"result":{"timestamp":"2020-07-31T17:55:52.437763Z","event":{"buildEvent":{"artifact":"java-guestbook-frontend","status":"Complete"}},"entry":"Build completed for artifact java-guestbook-frontend"}}
{"result":{"timestamp":"2020-07-31T17:55:52.460960Z","event":{"deployEvent":{"status":"In Progress"}},"entry":"Deploy started"}}
{"result":{"timestamp":"2020-07-31T17:55:52.784002Z","event":{"deployEvent":{"status":"Complete"}},"entry":"Deploy complete"}}
{"result":{"timestamp":"2020-07-31T17:55:52.784078Z","event":{"statusCheckEvent":{"status":"Started"}},"entry":"Status check started"}}
{"result":{"timestamp":"2020-07-31T17:55:53.160611Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-frontend-745d96b95f-2vnc9","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource pod/java-guestbook-frontend-745d96b95f-2vnc9 status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:53.160617Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-frontend-645cc58fdd-ct54n","status":"In Progress","message":"creating container frontend","statusCode":"STATUSCHECK_CONTAINER_CREATING","actionableErr":{"errCode":"STATUSCHECK_CONTAINER_CREATING","message":"creating container frontend"}}},"entry":"Resource pod/java-guestbook-frontend-645cc58fdd-ct54n status updated to In Progress"}}
{"result":{"timestamp":"2020-07-31T17:55:53.169427Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-mongodb","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-mongodb status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:53.169429Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-mongodb-7fc8d64d6b-dl6nt","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource pod/java-guestbook-mongodb-7fc8d64d6b-dl6nt status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:53.255219Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-backend-68747cd7dc-dmz74","status":"Failed","err":"container init-db-ready terminated with exit code 0","statusCode":"STATUSCHECK_CONTAINER_TERMINATED","actionableErr":{"errCode":"STATUSCHECK_CONTAINER_TERMINATED","message":"container init-db-ready terminated with exit code 0","suggestions":[{"suggestionCode":"CHECK_CONTAINER_LOGS","action":"Try checking container logs"}]}}},"entry":"Resource pod/java-guestbook-backend-68747cd7dc-dmz74 status failed with container init-db-ready terminated with exit code 0"}}
{"result":{"timestamp":"2020-07-31T17:55:53.255261Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-backend","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-backend status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:53.353700Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-frontend","status":"In Progress","message":"waiting for rollout to finish: 1 old replicas are pending termination...\n","statusCode":"STATUSCHECK_DEPLOYMENT_ROLLOUT_PENDING","actionableErr":{"errCode":"STATUSCHECK_DEPLOYMENT_ROLLOUT_PENDING","message":"waiting for rollout to finish: 1 old replicas are pending termination...\n"}}},"entry":"Resource deployment/java-guestbook-frontend status updated to In Progress"}}
{"result":{"timestamp":"2020-07-31T17:55:54.054658Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-frontend-645cc58fdd-ct54n","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource pod/java-guestbook-frontend-645cc58fdd-ct54n status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:54.359945Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-frontend","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-frontend status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:55:54.359974Z","event":{"statusCheckEvent":{"status":"Succeeded"}},"entry":"Status check succeeded"}}
{"result":{"timestamp":"2020-07-31T17:55:54.370769Z","event":{"devLoopEvent":{"iteration":1,"status":"Succeeded"}},"entry":"DevInit Iteration 1 successful"}}
{"result":{"timestamp":"2020-07-31T17:55:54.371047Z","event":{"portEvent":{"localPort":8080,"remotePort":8080,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-backend","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 8080"}}
{"result":{"timestamp":"2020-07-31T17:55:54.371195Z","event":{"portEvent":{"localPort":27017,"remotePort":27017,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-mongodb","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 27017"}}
{"result":{"timestamp":"2020-07-31T17:55:54.371209Z","event":{"portEvent":{"localPort":4503,"remotePort":80,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-frontend","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 4503"}}
{"result":{"timestamp":"2020-07-31T17:55:54.383223Z","event":{"devLoopEvent":{"iteration":2,"status":"In Progress"}},"entry":"DevInit Iteration 2 in progress"}}
{"result":{"timestamp":"2020-07-31T17:55:54.386067Z","event":{"buildEvent":{"artifact":"java-guestbook-frontend","status":"In Progress"}},"entry":"Build started for artifact java-guestbook-frontend"}}
{"result":{"timestamp":"2020-07-31T17:56:01.500167Z","event":{"buildEvent":{"artifact":"java-guestbook-frontend","status":"Complete"}},"entry":"Build completed for artifact java-guestbook-frontend"}}
{"result":{"timestamp":"2020-07-31T17:56:01.528441Z","event":{"deployEvent":{"status":"In Progress"}},"entry":"Deploy started"}}
{"result":{"timestamp":"2020-07-31T17:56:01.791363Z","event":{"deployEvent":{"status":"Complete"}},"entry":"Deploy complete"}}
{"result":{"timestamp":"2020-07-31T17:56:01.791388Z","event":{"statusCheckEvent":{"status":"Started"}},"entry":"Status check started"}}
{"result":{"timestamp":"2020-07-31T17:56:02.167575Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-mongodb-7fc8d64d6b-dl6nt","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource pod/java-guestbook-mongodb-7fc8d64d6b-dl6nt status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:56:02.167593Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-mongodb","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-mongodb status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:56:02.243955Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-backend-68747cd7dc-dmz74","status":"Failed","err":"container init-db-ready terminated with exit code 0","statusCode":"STATUSCHECK_CONTAINER_TERMINATED","actionableErr":{"errCode":"STATUSCHECK_CONTAINER_TERMINATED","message":"container init-db-ready terminated with exit code 0","suggestions":[{"suggestionCode":"CHECK_CONTAINER_LOGS","action":"Try checking container logs"}]}}},"entry":"Resource pod/java-guestbook-backend-68747cd7dc-dmz74 status failed with container init-db-ready terminated with exit code 0"}}
{"result":{"timestamp":"2020-07-31T17:56:02.243981Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-backend","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-backend status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:56:02.250256Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-frontend-645cc58fdd-ct54n","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource pod/java-guestbook-frontend-645cc58fdd-ct54n status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:56:02.250271Z","event":{"resourceStatusCheckEvent":{"resource":"pod/java-guestbook-frontend-745d96b95f-2vnc9","status":"Failed","err":"container frontend terminated with exit code 143","statusCode":"STATUSCHECK_CONTAINER_TERMINATED","actionableErr":{"errCode":"STATUSCHECK_CONTAINER_TERMINATED","message":"container frontend terminated with exit code 143","suggestions":[{"suggestionCode":"CHECK_CONTAINER_LOGS","action":"Try checking container logs"}]}}},"entry":"Resource pod/java-guestbook-frontend-745d96b95f-2vnc9 status failed with container frontend terminated with exit code 143"}}
{"result":{"timestamp":"2020-07-31T17:56:02.250282Z","event":{"resourceStatusCheckEvent":{"resource":"deployment/java-guestbook-frontend","status":"Succeeded","message":"Succeeded","statusCode":"STATUSCHECK_SUCCESS"}},"entry":"Resource deployment/java-guestbook-frontend status completed successfully"}}
{"result":{"timestamp":"2020-07-31T17:56:02.250391Z","event":{"statusCheckEvent":{"status":"Succeeded"}},"entry":"Status check succeeded"}}
{"result":{"timestamp":"2020-07-31T17:56:02.254413Z","event":{"devLoopEvent":{"iteration":2,"status":"Succeeded"}},"entry":"DevInit Iteration 2 successful"}}
{"result":{"timestamp":"2020-07-31T17:56:02.254785Z","event":{"portEvent":{"localPort":8080,"remotePort":8080,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-backend","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 8080"}}
{"result":{"timestamp":"2020-07-31T17:56:02.254875Z","event":{"portEvent":{"localPort":4503,"remotePort":80,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-frontend","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 4503"}}
{"result":{"timestamp":"2020-07-31T17:56:02.254946Z","event":{"portEvent":{"localPort":27017,"remotePort":27017,"namespace":"default","resourceType":"service","resourceName":"java-guestbook-mongodb","address":"127.0.0.1"}},"entry":"Forwarding container  to local port 27017"}}
gsquared94 commented 4 years ago

The state API /v1/state also has all the port forward info:

{
    "buildState": {
        "artifacts": {
            "leeroy-app": "Not Started",
            "leeroy-web": "Not Started"
        },
        "autoTrigger": true
    },
    "deployState": {
        "status": "Complete",
        "autoTrigger": true,
        "statusCode": "DEPLOY_SUCCESS"
    },
    "forwardedPorts": {
        "9000": {
            "localPort": 9000,
            "remotePort": 8080,
            "namespace": "default",
            "resourceType": "deployment",
            "resourceName": "leeroy-web",
            "address": "127.0.0.1"
        },
        "50053": {
            "localPort": 50053,
            "remotePort": 50051,
            "namespace": "default",
            "resourceType": "service",
            "resourceName": "leeroy-app",
            "address": "127.0.0.1"
        }
    },
    "statusCheckState": {
        "status": "Succeeded",
        "resources": {
            "deployment/leeroy-app": "Succeeded",
            "deployment/leeroy-web": "Succeeded",
            "pod/leeroy-app-66cbfbd5d4-pt7c8": "Succeeded",
            "pod/leeroy-web-c9cfd74d-mccw5": "Succeeded"
        },
        "statusCode": "STATUSCHECK_SUCCESS"
    },
...
}

Can this be used instead?

gsquared94 commented 4 years ago

Skaffold seems to be dispatching each event in its own goroutine which causes them to arrive out of order when time diff is small. We also are setting timestamp at the end instead of passing it along with the event request. Both of these combine to produce out of order events with incorrect timestamps.

matthewmichihara commented 4 years ago

Thanks @gsquared94. With #4644, it looks like I can either:

gsquared94 commented 4 years ago

Great, I'm closing this issue for now. If you face any other challenges than feel free to reopen.