Automate Deployments to GCP ☁️ Cloud Run 🏃 with GitHub Actions

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 7

  • @skyhappy
    @skyhappy Před 17 hodinami

    Beautiful video. I was following the official method through the gcp yt vid and the cloud run gh action but it was convoluted and didn't talk about how to set the permissions. I tried getting my gha ction authenticated through their recommended federated identity method but it didn't work. Your service account key method is much simpler to configure.
    I found your vid and after 3 hours, got my deployment working. Thank you sir! Btw at the very end, "--platform" is a nonexistent argument and the gh action throws an error about it.

    • @cmd_labs
      @cmd_labs  Před 16 hodinami

      @skyhappy Great to meet you! Can you share what line of code in the linked repo you are referring to?
      github.com/thaddavis/how-to-deploy-a-dockerized-fastapi-to-google-cloud-run/tree/part_4
      Hopefully I can fix it : )
      Also can you share the timestamp in this video where this error is mentioned

    • @cmd_labs
      @cmd_labs  Před 16 hodinami

      So happy you shared this
      Also @skyhappy, what version of the gcloud cli are you using?
      ie: gcloud --version
      Google Cloud SDK 470.0.0
      I see in this version does have a CLI argument option for `--platform`...
      gcloud run deploy [[SERVICE] --namespace=NAMESPACE] [--async]
      [--concurrency=CONCURRENCY] [--container=CONTAINER]
      [--ingress=INGRESS; default="all"] [--max-instances=MAX_INSTANCES]
      [--min-instances=MIN_INSTANCES]
      [--platform=PLATFORM; default="managed"]
      [--service-account=SERVICE_ACCOUNT] [--tag=TAG] [--timeout=TIMEOUT]
      [--no-traffic]
      [--args=[ARG,...] --command=[COMMAND,...] --cpu=CPU
      --depends-on=[CONTAINER,...]
      --memory=MEMORY --port=PORT --[no-]use-http2 --clear-env-vars
      | --env-vars-file=FILE_PATH | --set-env-vars=[KEY=VALUE,...]
      | --remove-env-vars=[KEY,...]
      --update-env-vars=[KEY=VALUE,...] --clear-secrets
      | --set-secrets=[KEY=VALUE,...] | --remove-secrets=[KEY,...]
      --update-secrets=[KEY=VALUE,...] --image=IMAGE | --source=SOURCE]
      [--clear-labels | --remove-labels=[KEY,...] --labels=[KEY=VALUE,...]
      | --update-labels=[KEY=VALUE,...]]
      [--connectivity=CONNECTIVITY --clear-config-maps
      | --set-config-maps=[KEY=VALUE,...] | --remove-config-maps=[KEY,...]
      --update-config-maps=[KEY=VALUE,...]]

    • @skyhappy
      @skyhappy Před 8 hodinami

      ​@@cmd_labs
      1 - timestamp is 2:52 I believe
      2 - I cant link the repo because of spam filter, the file path in that repo is how-to-deploy-a-dockerized-fastapi-to-google-cloud-run/.github/workflows
      /cicd.yaml, line 47. I'm not sure if the gcloud cli version is relevant as it runs in a github action runner, which should download the latest version? line 31 in the above file uses "'google-github-actions/setup-gcloud@v2'".

    • @skyhappy
      @skyhappy Před 2 hodinami

      ​@@cmd_labs Man, I replied to you but my comment got delted by spam filters. didnt even give a link.
      in that repo's github workflow folder, in cicd.yaml, line 47 is what I'm talkign about.
      the cli version is from whats downloaded from the github action step in line 31? the gcolud sdk library?
      I got a error in gh action saying that --platform argument wasnt valid so I removed it and the error was gone.

  • @rajivreddy8194
    @rajivreddy8194 Před měsícem +1

    thank you and have a doubt do we need to use docker or it just works without it ?

    • @cmd_labs
      @cmd_labs  Před měsícem

      I find this to be a vague question
      Can you provide more details?
      I would recommend you test what you are trying out and let us know how it goes
      Learn by doing
      If you want to share the link to your GitHub with your code please do ; )