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

Debug/v0.1.x #4

Closed
wants to merge 6 commits into from
Closed

Debug/v0.1.x #4

wants to merge 6 commits into from

Conversation

JeromeJu
Copy link
Contributor

@JeromeJu JeromeJu commented May 1, 2024

This commit debugs the integration workflow platform failure.
Will be reverted once it resolves.

This commit inits the deploy-gke container action. It utlizes the gke-deploy
CLI image to deploy an existing image to a GKE cluster.

The integration test, documentation and CI setup are included within this
initial commit.
@JeromeJu JeromeJu requested a review from a team as a code owner May 1, 2024 15:46
    This commit debugs the integration workflow platform failure.
    Will be reverted once it resolves.
@sethvargo
Copy link
Member

exec /entrypoint.sh: exec format error

usually means we're trying to run the wrong binary (e.g. Mac binary on Linux or arm on amd).

@JeromeJu
Copy link
Contributor Author

JeromeJu commented May 1, 2024

exec /entrypoint.sh: exec format error

usually means we're trying to run the wrong binary (e.g. Mac binary on Linux or arm on amd).

Thanks for the eyes on this @sethvargo (and also for the help with merging the CI earlier)

I've been looking into this platform arch mismatch - from the output it seems to be building and running at the same platform (x86), which made me confused:

Building docker image
  Dockerfile for action: '/home/runner/work/deploy-gke/deploy-gke/./Dockerfile'.
  /usr/bin/docker build -t be981d:4647fbf3c4465d40fae45acdce04437b -f "/home/runner/work/deploy-gke/deploy-gke/./Dockerfile" "/home/runner/work/deploy-gke/deploy-gke"
  #0 building with "default" instance using docker driver
  
  #1 [internal] load .dockerignore
  #1 transferring context: 2B done
  #1 DONE 0.0s
  
  #2 [internal] load build definition from Dockerfile
  #2 transferring dockerfile: 840B done
  #2 DONE 0.0s
  
  #3 [internal] load metadata for us-docker.pkg.dev/gcb-catalog-release/preview/gke-deploy@sha256:a85701dedd45e7c3995a09cce83ec307a59[15](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:16)25b782038dcd5cf7c2811464cb7
  #3 DONE 0.8s
  
  #4 [internal] load build context
  #4 transferring context: 1.61kB done
  #4 DONE 0.0s
  
  #5 [1/2] FROM us-docker.pkg.dev/gcb-catalog-release/preview/gke-deploy@sha256:a85701dedd45e7c3995a09cce83ec307a591525b782038dcd5cf7c2811464cb7
  #5 resolve us-docker.pkg.dev/gcb-catalog-release/preview/gke-deploy@sha256:a85701dedd45e7c3995a09cce83ec307a591525b782038dcd5cf7c2811464cb7 done
  #5 sha256:a85701dedd45e7c3995a09cce83ec307a591525b782038dcd5cf7c2811464cb7 4.70kB / 4.70kB done
  #5 sha256:71103679292af15a78898d8b8f3e4b0e31f9d23fe918a92fba394422fc612a32 9.51kB / 9.51kB done
  #5 sha256:a8af074c67cb3400b28c83b05b39af6ce9f8c117d508650405965b9029a4f618 0B / 289B 0.1s
  #5 sha256:d66d6a6a368713979f9d00fad193991ae1af18b8efd3abf4d70ade192807c1bd 0B / 30.45MB 0.1s
  #5 sha256:d226e90aa8635923438d25a6add35682cb256a1927bfa84176f4f953e74ac009 0B / 712B 0.1s
  #5 sha256:a8af074c67cb3400b28c83b05b39af6ce9f8c117d508650405965b9029a4f618 289B / 289B 0.3s done
  #5 sha256:d226e90aa8635923438d25a6add35682cb256a1927bfa84176f4f953e74ac009 712B / 712B 0.3s done
  #5 sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 0B / 32B 0.3s
  #5 sha256:25f262dbe64b52d731b347b33249928cb17eed44942768f13ed1d43bbbdfbcf9 0B / 3.35MB 0.3s
  #5 sha256:d66d6a6a368713979f9d00fad193991ae1af18b8efd3abf4d70ade192807c1bd 8.39MB / 30.45MB 0.5s
  #5 sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 32B / 32B 0.5s done
  #5 sha256:b7e25f34ef4261b44976c0053e4b30a7784390f9b00d5dd02159e7296dfe1fc0 0B / 226B 0.5s
  #5 sha256:d66d6a6a368713979f9d00fad193991ae1af18b8efd3abf4d70ade192807c1bd 25.17MB / 30.45MB 0.7s
  #5 sha256:25f262dbe64b52d731b347b33249928cb17eed44942768f13ed1d43bbbdfbcf9 3.35MB / 3.35MB 0.6s done
  #5 sha256:a94ce693e0c312ffa96d13b188f3f4b9f541a339789ce638e5103d3c1ffcd59a 0B / 222.94kB 0.7s
  #5 sha256:d66d6a6a368713979f9d00fad193991ae1af18b8efd3abf4d70ade192807c1bd 30.45MB / 30.45MB 0.8s
  #5 sha256:b7e25f34ef4261b44976c0053e4b30a7784390f9b00d5dd02159e7296dfe1fc0 226B / 226B 0.8s done
  #5 sha256:e1026b31a86ca6f88482c45185c523e92a3c29cd9fc399d7a332d6037fb97937 0B / 5.60MB 0.8s
  #5 extracting sha256:d66d6a6a368713979f9d00fad193991ae1af18b8efd3abf4d70ade192807c1bd
  #5 sha256:d66d6a6a368713979f9d00fad193991ae1af18b8efd3abf4d70ade192807c1bd 30.45MB / 30.45MB 0.8s done
  #5 sha256:575feef66763fc8ec5bd645b741a4623ba8d03e4eafd0dd4098df15085673802 0B / 281.27kB 0.9s
  #5 sha256:a94ce693e0c312ffa96d13b188f3f4b9f541a339789ce638e5103d3c1ffcd59a 222.94kB / 222.94kB 1.0s done
  #5 sha256:e131fed07c77f3868ee9552e807aaf1f0a4ba2f9c3ca336465401ba63effa725 0B / 3.48kB 1.0s
  #5 sha256:e1026b31a86ca6f88482c45185c523e92a3c29cd9fc399d7a332d6037fb97937 5.60MB / 5.60MB 1.2s done
  #5 sha256:575feef66763fc8ec5bd645b741a4623ba8d03e4eafd0dd4098df15085673802 281.27kB / 281.27kB 1.1s done
  #5 sha256:017276f4b2514ce17a4ede4bd389836a746f817ee99a97efd2883ac2f9b17de5 0B / 387B 1.2s
  #5 sha256:389a149e1ce80831e3306c49a926d8da70892d71e6d1ee6bb0448848aa26ef34 0B / 1.44kB 1.2s
  #5 sha256:e131fed07c77f3868ee9552e807aaf1f0a4ba2f9c3ca336465401ba63effa725 3.48kB / 3.48kB 1.2s done
  #5 sha256:7690f990df2d12d4cfeff61d024d5f400a27291c3ec8f15927e832849c73e733 0B / 269B 1.3s
  #5 sha256:017276f4b2514ce17a4ede4bd389836a746f817ee99a97efd2883ac2f9b17de5 387B / 387B 1.4s done
  #5 sha256:7690f990df2d12d4cfeff61d024d5f400a27291c3ec8f15927e832849c73e733 269B / 269B 1.5s done
  #5 sha256:7eb822f0531c632175e60deb7620dbb252214f964b0e88af37cb6fda2d0875af 0B / 2.12kB 1.5s
  #5 sha256:62c7cf07c239e68b4e1821dedaa32c97bcfbcbf3b837dec53a103857f5467675 0B / 266B 1.5s
  #5 sha256:389a149e1ce80831e3306c49a926d8da70892d71e6d1ee6bb0448848aa26ef34 1.44kB / 1.44kB 1.5s done
  #5 sha256:8c55878d26444cc3f6e1c72b7525dfee23[16](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:17)1c5ea98f0393ca9fea97ee6effef 0B / 82.74MB 1.6s
  #5 sha256:62c7cf07c239e68b4e1821dedaa32c97bcfbcbf3b837dec53a103857f5467675 266B / 266B 1.7s done
  #5 sha256:3336f5cacc38af4089320d385e59b54fa3c0aee08607018e95377f9e242c5d2e 0B / 21.20MB 1.7s
  #5 extracting sha256:d66d6a6a368713979f9d00fad193991ae1af18b8efd3abf4d70ade192807c1bd 1.0s done
  #5 sha256:7eb822f0531c632[17](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:18)5e60deb7620dbb252214f964b0e88af37cb6fda2d0875af 2.12kB / 2.12kB 1.7s done
  #5 sha256:c2468fc35f100036eac9e44e3e4ab056bd827a59a38823e80671558bbbeca44a 0B / 23.90kB 1.8s
  #5 extracting sha256:a8af074c67cb3400b28c83b05b39af6ce9f8c117d508650405965b9029a4f6[18](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:19)
  #5 sha256:8c55878d26444cc3f6e1c72b7525dfee23161c5ea98f0393ca9fea97ee6effef 4.[19](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:20)MB / 82.74MB 2.0s
  #5 extracting sha256:a8af074c67cb3400b28c83b05b39af6ce9f8c117d508650405965b9029a4f618 done
  #5 sha256:3336f5cacc38af40893[20](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:21)d385e59b54fa3c0aee08607018e95377f9e242c5d2e 4.19MB / [21](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:22).20MB 2.1s
  #5 sha256:c2468fc35f100036eac9e44e3e4ab056bd827a59a38823e80671558bbbeca44a 23.90kB / 23.90kB 2.0s done
  #5 extracting sha256:d[22](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:23)6e90aa86359[23](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:24)438d25a6add35682cb256a1927bfa84176f4f953e74ac009 done
  #5 extracting sha256:25f262dbe64b52d731b347b33[24](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:25)9928cb17eed44942768f13ed1d43bbbdfbcf9 0.1s done
  #5 sha[25](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:26)6:a60f15549122824aab256218157f85b92dc27725af1981[26](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:27)8c5e07ebed03fc93 0B / 2.84MB 2.1s
  #5 sha256:8c55878d26444cc3f6e1c72b7525dfee23161c5ea98f0393ca9fea97ee6effef 8.39MB / 82.74MB 2.2s
  #5 extracting sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 done
  #5 extracting sha256:b7e25f34ef4261b44976c0053e4b30a7784390f9b00d5dd02159e7296dfe1fc0 done
  #5 extracting sha256:a94ce693e0c312ffa96d13b188f3f4b9f541a339789ce638e5103d3c1ffcd59a 0.0s done
  #5 extracting sha256:e1026b31a86ca6f88482c45185c523e92a3c29cd9fc399d7a332d6037fb97937
  #5 sha256:8c55878d26444cc3f6e1c72b7525dfee23161c5ea98f0393ca9fea97ee6effef 22.02MB / 82.74MB 2.3s
  #5 sha256:3336f5cacc38af4089320d385e59b54fa3c0aee08607018e95377f9e242c5d2e 8.39MB / 21.20MB 2.3s
  #5 sha256:a60f15549122824aab256218157f85b92dc[27](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:28)725af1981268c5e07ebed03fc93 1.05MB / 2.84MB 2.3s
  #5 sha256:8c55878d26444cc3f6e1c72b7525dfee23161c5ea98f0393ca9fea97ee6effef 40.89MB / 82.74MB 2.4s
  #5 sha256:3336f5cacc38af4089320d385e59b54fa3c0aee08607018e95377f9e242c5d2e 17.83MB / 21.20MB 2.4s
  #5 sha256:a60f1554912[28](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:29)24aab256218157f85b92dc27725af1981268c5e07ebed03fc93 2.84MB / 2.84MB 2.3s done
  #5 sha256:fbd630f9791ddb2c3fd321a9fed69066f155525d635abc70e3dc72c0fa2e6990 0B / 5.33kB 2.4s
  #5 sha256:8c55878d26444cc3f6e1c72b7525dfee23161c5ea98f0393ca9fea97ee6effef 58.72MB / 82.74MB 2.6s
  #5 sha256:3336f5cacc38af4089320d385e59b54fa3c0aee08607018e95377f9e242c5d2e 21.20MB / 21.20MB 2.4s done
  #5 extracting sha256:e1026b31a86ca6f88482c45185c523e92a3c[29](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:30)cd9fc399d7a332d6037fb97937 0.2s done
  #5 sha256:8c55878d26444cc3f6e1c72b7525dfee23161c5ea98f0393ca9fea97ee6effef 79.69MB / 82.74MB 2.7s
  #5 sha256:fbd6[30](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:31)f9791ddb2c3fd321a9fed69066f155525d635abc70e3dc72c0fa2e6990 5.33kB / 5.33kB 2.6s done
  #5 extracting sha256:575feef66763fc8ec5bd645b741a4623ba8d03e4eafd0dd4098df15085673802 0.0s done
  #5 sha256:8c55878d26444cc3f6e1c72b7525dfee2[31](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:32)61c5ea98f0393ca9fea97ee6effef 82.74MB / 82.74MB 2.7s done
  #5 extracting sha256:e131fed07c77f3868ee9552e807aaf1f0a4ba2f9c3ca336465401ba63effa725 done
  #5 extracting sha256:017276f4b2514ce17a4ede4bd389836a746f817ee99a97efd2883ac2f9b17de5 done
  #5 extracting sha256:389a149e1ce80831e3306c49a926d8da70892d71e6d1ee6bb0448848aa26ef34 done
  #5 extracting sha256:7690f990df2d12d4cfeff61d024d5f400a27291c3ec8f15927e8[32](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:33)849c73e733 done
  #5 extracting sha256:7eb822f0531c632175e60deb7620dbb252214f964b0e88af37cb6fda2d0875af done
  #5 extracting sha256:62c7cf07c239e68b4e1821dedaa32c97bcfbcbf3b837dec53a103857f5467675 done
  #5 extracting sha256:8c55878d26444cc3f6e1c72b7525dfee23161c5ea98f0393ca9fea97ee6effef
  #5 extracting sha256:8c55878d26444cc3f6e1c72b7525dfee23161c5ea98f0393ca9fea97ee6effef 1.4s done
  #5 extracting sha256:[33](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:34)36f5cacc38af4089320d385e59b54fa3c0aee08607018e95377f9e242c5d2e
  #5 extracting sha256:3336f5cacc38af4089320d385e59b54fa3c0aee08607018e95377f9e242c5d2e 0.3s done
  #5 extracting sha256:c2468fc35f100036eac9e44e3e4ab056bd827a59a38823e80671558bbbeca44a
  #5 extracting sha256:c2468fc35f100036eac9e44e3e4ab056bd827a59a38823e80671558bbbeca44a done
  #5 extracting sha256:a60f15549122824aab256218157f85b92dc27725af1981268c5e07ebed03fc93 0.0s done
  #5 extracting sha256:fbd630f9791ddb2c3fd321a9fed69066f155525d635abc70e3dc72c0fa2e6990 done
  #5 DONE 5.1s
  
  #6 [2/2] COPY entrypoint.sh /entrypoint.sh
  #6 DONE 0.0s
  
  #7 exporting to image
  #7 exporting layers
  #7 exporting layers 0.9s done
  #7 writing image sha256:73191ac56ea1bc8abfd99885842be[34](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:35)2727820c6cfaef3d1cc589a3c4851478b done
  #7 naming to docker.io/library/be981d:4647fbf3c4465d40fae45acdce04437b done
  #7 DONE 0.9s
/usr/bin/docker run --name be981d4647fbf3c4465d40fae45acdce04437b_9978b9 --label be981d --workdir /github/workspace --rm -e "CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE" -e "GOOGLE_APPLICATION_CREDENTIALS" -e "GOOGLE_GHA_CREDS_PATH" -e "INPUT_IMAGE" -e "INPUT_APP_NAME" -e "INPUT_REGION" -e "INPUT_CLUSTER_NAME" -e "INPUT_PROJECT_ID" -e "INPUT_NAMESPACE" -e "INPUT_EXPOSE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_ID_TOKEN_REQUEST_URL" -e "ACTIONS_ID_TOKEN_REQUEST_TOKEN" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/deploy-gke/deploy-gke":"/github/workspace" be981d:4647fbf3c4465d40fae45acdce044[37](https://github.com/google-github-actions/deploy-gke/actions/runs/8911552319/job/24473123000#step:5:38)b  "nginx:latest" "deploy-gke-app" "us-central1" "deploy-gke-cluster" "graphite-test-github-it" "deploy-gke-ns" "80"
exec /entrypoint.sh: exec format error

And when I tried to tag the GHA and use it as a released version i.e. https://github.com/JeromeJu/gar-upload-container as the POC which is used as https://github.com/JeromeJu/deploy-gke-container v0.x it worked fine in the workflow.

May I ask what's the point that I should look at? - my suspicion is it relates with runs: './' but not sure how to debug docker runner arch within the step, shall I look into the docker runner source code?

entrypoint.sh Show resolved Hide resolved
entrypoint.sh Outdated Show resolved Hide resolved

USER root

COPY entrypoint.sh /entrypoint.sh
Copy link
Member

Choose a reason for hiding this comment

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

You might need to mark this file as executable, especially since you're running as root.

@JeromeJu
Copy link
Contributor Author

JeromeJu commented May 3, 2024

Thanks @sethvargo for the PR for granting the WIF access - Now the authentication works but the deploy process failed with the service not being able to expose its external IP with the specified port. I've been taking some time looking into this (a network issue IIUC) and tried to debug.

The failed workflow has the following logs:

###  The following line is created if `expose` input is specified: 
Creating suggested Service configuration file "deploy-gke-app-service"
...
Still waiting on 1 object(s) to be ready: [{kind: Service, name: deploy-gke-app-service}]
...
[172](https://github.com/google-github-actions/deploy-gke/actions/runs/8913818807/job/24524649882#step:5:174)NAMESPACE        KIND                       NAME                      READY    
...
[175](https://github.com/google-github-actions/deploy-gke/actions/runs/8913818807/job/24524649882#step:5:177)deploy-gke-ns    Service                    deploy-gke-app-service    No       

Related source code of the image:

Some attempts I've tried but didn't work:

  • I've tried to follow what ssh-compute does (test-infra#69)- but it doesn't seem to apply to my use case since we are not using IAP to connect to VMs or GCEs IIUC.
  • I've also looked into a successful deployment - it seems to create the LoadBalancer type of kubernetes Service:
    image
  • I've tried changing the range of subnetwork - but it doesn't seem to work with extra bits I've added using cidrsubnet - may I ask if this is the correct path to take?

@sethvargo
Copy link
Member

Hi @JeromeJu - this is likely an organizational policy constraint. We do not allow services to allow arbitrary public ingress from the Internet in our test environment. Is exposing via a public IP required for testing?

@JeromeJu
Copy link
Contributor Author

JeromeJu commented May 6, 2024

Thanks for the pointer, I removed the expose port given this org policy and also as it is really just a feature dependency on the upstream.

@JeromeJu
Copy link
Contributor Author

JeromeJu commented May 6, 2024

Closing in light of #5

@JeromeJu JeromeJu closed this May 6, 2024
@sethvargo sethvargo deleted the debug/v0.1.x branch May 6, 2024 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants