Is cron.yaml supported with custom runtimes?

212 views
Skip to first unread message

Ben Rometsch

unread,
Mar 4, 2017, 9:19:23 AM3/4/17
to Google App Engine
Hi,

I'm running a custom Docker runtime on flexible VMs. I have an cron.yaml file in my root dir that looks like:

cron:
- description: daily summary job
  url: /tasks/test
  schedule: every 1 minutes

It's not being run. Is cron.yaml supported in custom Docker runtimes? The documentation doesn't make any reference. 

Thanks


Nickolas Daskalou

unread,
Mar 4, 2017, 9:46:41 AM3/4/17
to Google App Engine

Have you updated your crons with something like this?

> appcfg.py update_cron dir_with_cron_file?

See here for more info:

https://cloud.google.com/appengine/docs/standard/python/tools/appcfg-arguments#update_cron

You'll also need to ensure the /tasks/test URL is routed to your Flex environment service, either as the "default" service or via routing rules in dispatch.yaml (which you can upload with appcfg.py also).

Nick

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/fb9f299d-0f96-45d7-864f-513cffc4f70d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Rometsch

unread,
Mar 4, 2017, 2:55:11 PM3/4/17
to Google App Engine
Its a Java/Docker/FlexVM app not a standard Python appengine app...?


On Saturday, 4 March 2017 14:46:41 UTC, Nickolas Daskalou wrote:

Have you updated your crons with something like this?

> appcfg.py update_cron dir_with_cron_file?

See here for more info:

https://cloud.google.com/appengine/docs/standard/python/tools/appcfg-arguments#update_cron

You'll also need to ensure the /tasks/test URL is routed to your Flex environment service, either as the "default" service or via routing rules in dispatch.yaml (which you can upload with appcfg.py also).

Nick

On 05/03/2017 1:19 AM, "Ben Rometsch" <b...@solidstategroup.com> wrote:
Hi,

I'm running a custom Docker runtime on flexible VMs. I have an cron.yaml file in my root dir that looks like:

cron:
- description: daily summary job
  url: /tasks/test
  schedule: every 1 minutes

It's not being run. Is cron.yaml supported in custom Docker runtimes? The documentation doesn't make any reference. 

Thanks


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.

Adam (Cloud Platform Support)

unread,
Mar 4, 2017, 5:27:01 PM3/4/17
to Google App Engine
Are you using a base image in your Dockerfile that is an App Engine runtime? If you use a non-App Engine base image, the App Engine Cron Service will not be available.

Ben Rometsch

unread,
Mar 5, 2017, 4:03:23 AM3/5/17
to Google App Engine
Hmm I tried extending FROM gcr.io/google_appengine/openjdk but it's still not working. Any ideas? How does the cron.yaml get processed included into the Appengine backend?

Adam (Cloud Platform Support)

unread,
Mar 6, 2017, 5:44:08 PM3/6/17
to Google App Engine
The docs do suggest that cron.yaml should work on the OpenJDK runtime. I'll investigate this more and update the thread once I've finished testing. 

Adam (Cloud Platform Support)

unread,
Mar 7, 2017, 6:47:15 PM3/7/17
to Google App Engine
I've tested this on an openjdk test app and it works fine, using a cron.yaml similar to yours (hitting an endpoint on the default version/service every 1 minute).

Make sure that you're actually deploying your cron configuration with 'gcloud app deploy /path/to/cron.yaml'. Also make sure that you're targeting the correct version / service. If your endpoint exists on a different version / service that the default you'll need to specify the 'target: ' definition in your cron.yaml.

Ben Rometsch

unread,
Mar 8, 2017, 6:30:22 AM3/8/17
to Google App Engine

Ah thats what I needed - that works now. Thanks. Feels like the custom/flex VM documentation could do with being fleshed out a bit? 

Adam (Cloud Platform Support)

unread,
Mar 10, 2017, 1:01:37 PM3/10/17
to Google App Engine
There's another doc which goes into more detail about these steps for the flexible runtime, Scheduling Jobs with cron.yaml.
Reply all
Reply to author
Forward
0 new messages