Skip to content

Error creating job with max-retries set #563

@wyardley

Description

@wyardley

TL;DR

I'm seeing an issue with deploying a job (see definition below) where it seems like the action is trying to run gcloud run deploy update vs gcloud run jobs create? It's also running gcloud run deploy update on an image, where I have multiple jobs defined using the same image, so it seems like that would also create an issue?

Also, I'm not sure if this will work in the case where the job is being created for the first time? Ideally, the workflow would be idempotent and deploy whether the workflow already exists or not (not sure if this is the case, but this is one reason that I tried using this workflow vs. using a shell script directly).

Feel free to also consider this a feature request to implement max-retries as a top level parameter as well.

Expected behavior

The job to be deployed (if it exists) or updated (if it doesn't).

Observed behavior

Error: google-github-actions/deploy-cloudrun failed with: failed to execute gcloud command `gcloud run deploy  --image us-docker.pkg.dev/xxxx/yyy/zzz:0e3fa3155 --update-env-vars ^,^FOO="bar" --update-secrets ^,^FOO2=foo2:latest,BAR_SECRET=bar-secret:latest --timeout 40m --update-labels ^,^managed-by=github-actions,commit-sha=0e3fa3155d1355c9035653febf7196a653b6a705 --format json --region us-central1 --command python3 --args models/uw_model/scoring.py --max-retries 2 --parallelism 1 --service-account foo@${GOOGLE_CLOUD_PROJECT}.iam.gserviceaccount.com`: ERROR: (gcloud.run.deploy) unrecognized arguments:
  --max-retries (did you mean '--max-instances'?)
  2
  --parallelism
  1
  To search the help text of gcloud commands, run:
  gcloud help -- SEARCH_TERMS

Action YAML

- id: deploy
        uses: google-github-actions/deploy-cloudrun@v2
        with:
          job: ${{ steps.generate_name.outputs.job-name }}
          image: ${{ inputs.image }}
          env_vars: |-
            FOO="bar"
          flags: >
            --command=python3
            --args=${{ matrix.job }}
            --max-retries=2
            --parallelism=1
            --service-account="foo@${GOOGLE_CLOUD_PROJECT}.iam.gserviceaccount.com"
          gcloud_version: 511.0.0 # Tried updating this in case that was why `--max-retries` wasn't working, but I think it's just that it's using a different command
          secrets: |-
            BAR_SECRET=bar-secret:latest
            FOO2=foo2:latest
          timeout: 40m

Log output


Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions