deploy-cloudrun icon indicating copy to clipboard operation
deploy-cloudrun copied to clipboard

Cloud Run jobs support

Open vh opened this issue 3 years ago • 13 comments

TL;DR

Allow to deploy Cloud Run jobs.

Detailed design

No response

Additional information

No response

vh avatar Jun 30 '22 14:06 vh

I would really enjoy this feature!

steveoh avatar Jul 29 '22 01:07 steveoh

Anyone doing this? I am thinking of forking

misha130 avatar Nov 27 '22 01:11 misha130

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

cloudmatt avatar Jan 02 '23 01:01 cloudmatt

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 }}

spencercorwin avatar Jan 02 '23 04:01 spencercorwin

Any update on your thoughts @sethvargo?

steveoh avatar May 11 '23 20:05 steveoh

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="...."

misha130 avatar May 11 '23 22:05 misha130

@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?

steveoh avatar May 12 '23 00:05 steveoh

@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

misha130 avatar May 12 '23 01:05 misha130

@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

steveoh avatar May 12 '23 01:05 steveoh

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 :)

JorritSalverda avatar May 16 '23 11:05 JorritSalverda

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

TheodorRene avatar Jul 11 '23 08:07 TheodorRene

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

GusPrice avatar Jul 27 '23 18:07 GusPrice

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.

archydeberker avatar Jul 31 '23 13:07 archydeberker

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

atrauzzi avatar Mar 23 '24 05:03 atrauzzi

Yay!

atrauzzi avatar Apr 16 '24 23:04 atrauzzi