3

I'm setting up some container build triggers, which, by default, have a 10 minutes timeout configuration. As sometimes my builds are just a bit longer than 10 minutes, I'm trying to change the timeout value on the yaml file to no avail.

Container builder documentation says there's a timeout value with this characteristics:

timeout
string (Duration format) [...] Default time is ten minutes. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

But I can't get it to work on the yaml definition file. Simplifying the yaml file I've tried:

steps:
- name: 'python:3-alpine'
  args: ['end']
  entrypoint: 'bin/notify.sh'
  env:
  - 'BRANCH=$BRANCH_NAME'
  - 'SHA=$COMMIT_SHA'
  id: 'notifyend'
timeout: '1200s'

And I get this error:

error loading template: yaml: unmarshal errors: line 9: cannot unmarshal !!str 1200s into duration.Duration

When I use timeout: '1200' I get:

error loading template: yaml: unmarshal errors: line 9: cannot unmarshal !!str 1200 into duration.Duration

And when I use, just for trying something else, timeout: duration.seconds(1200) I get:

error loading template: yaml: unmarshal errors: line 9: cannot unmarshal !!str duratio... into duration.Duration

Any clue on how should I fix this?

Andor
  • 591
  • 5
  • 16

3 Answers3

3

This is a known issue, and we have a fix for it going out soon. I'll update this answer when it's out.

This is now fixed. Use timeout: 1200s to specify a timeout.

Sorry about that!

Jason Hall
  • 146
  • 4
1

Try this:

steps:
- name: 'python:3-alpine'
  args: ['end']
  entrypoint: 'bin/notify.sh'
  env:
  - 'BRANCH=$BRANCH_NAME'
  - 'SHA=$COMMIT_SHA'
  id: 'notifyend'
timeout:
  seconds: 1200
Omer Zach
  • 111
  • 1
  • I have tried that. It will raise an error `error loading template: invalid syntax`. – Gambo Mar 22 '17 at 18:48
  • 1
    Previously this fixed the same issue for me but it seems they've updated it…. "timeout: '1200s'" works for me now. – Omer Zach Mar 23 '17 at 20:37
0

I recently ran into the same issue and the accepted answer didn't work.

I fixed it by configuring the project with the gloud command: gcloud config set app/cloud_build_timeout 1200

icarito
  • 101
  • 2
  • That property controls the build timeout for GAE deployments (i.e., `gcloud app deploy`) and not GCB builds (`gcloud builds submit`). – Jason Hall Mar 25 '19 at 13:57
  • It's confusing because both can use cloudbuild.yaml. For the case of `gcloud builds submit` there's `--timeout` parameter. – icarito Mar 27 '19 at 03:34