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

Cloud Run jobs support #364

Closed
vh opened this issue Jun 30, 2022 · 15 comments · Fixed by #506
Closed

Cloud Run jobs support #364

vh opened this issue Jun 30, 2022 · 15 comments · Fixed by #506
Labels
enhancement New feature or request

Comments

@vh
Copy link

vh commented Jun 30, 2022

TL;DR

Allow to deploy Cloud Run jobs.

Detailed design

No response

Additional information

No response

@vh vh added the enhancement New feature or request label Jun 30, 2022
@steveoh
Copy link

steveoh commented Jul 29, 2022

I would really enjoy this feature!

@misha130
Copy link

Anyone doing this? I am thinking of forking

@cloudmatt
Copy link

I'm assuming this hasn't/isn't being picked up? This would be super helpful for my workflows as well.

@spencercorwin
Copy link

spencercorwin commented Jan 2, 2023

Just made a PR for this as I really wanted it for my own workflow: #422

Note that it probably won't be merged though since "Job"s in Cloud Run appears to be in beta. But if you want to use it right away you can fork my fork or just reference my fork in your workflows by doing this:

- name: Deploy to Cloud Run
  id: deploy
  uses: 'spencercorwin/deploy-cloudrun@enable-jobs'
  with:
    job: ${{ env.JOB }}
    gcloud_component: beta
    region: ${{ env.REGION }}
    # NOTE: If using a pre-built image, update the image name here
    image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REGISTRY_REPO }}/${{ env.SERVICE }}:${{ github.sha }}

@steveoh
Copy link

steveoh commented May 11, 2023

Any update on your thoughts @sethvargo?

@misha130
Copy link

Anyone doing this? I am thinking of forking

I simply ended up using cli to do this instead of this github action

        run: |-
          gcloud --quiet beta run jobs update ${{ env.SERVICE }} \
          --image ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }} \
          --max-retries	3 \
          --add-cloudsql-instances=.... \
          --vpc-connector=my-vpc-connector \
          --region some-region \
          --set-env-vars="...."

@steveoh
Copy link

steveoh commented May 12, 2023

@misha130 That will fail on the first run no? And don't you need to switch between --set and --update-env-vars based on if you are creating or updating?

@misha130
Copy link

@misha130 That will fail on the first run no? And don't you need to switch between --set and --update-env-vars based on if you are creating or updating?

It's true, I create the job manually before deploying with a random image

@steveoh
Copy link

steveoh commented May 12, 2023

@misha130 Here's some code that will work for both. It'd be nice to have it all wrapped and managed by google's actions though.

https://github.com/agrc/dhhs-cooling-towers/blob/dev/.github/workflows/release.yml#L88-L112

@JorritSalverda
Copy link

It seems the gcloud command to deploy a job is no longer in beta: https://cloud.google.com/sdk/gcloud/reference/run/jobs/create. So if that's what's holding things back it should get some traction again :)

@TheodorRene
Copy link

Got stumped on this today. Hoping for support one day 👍

@GusPrice
Copy link

Would love to see this get implemented, the work around in our pipelines is nasty :/

@archydeberker
Copy link

Just submitted a GCP support request along these lines.

A workaround for us would be to point the Cloud Run Job at a Cloud Run Service container, to basically entrain the two... but I can't find a good way to do this either.

@atrauzzi
Copy link

Where is this at? Would like to be able to deploy jobs from GH easily.

@atrauzzi
Copy link

atrauzzi commented Apr 16, 2024

Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

10 participants