ForeverConfused
ForeverConfused

Reputation: 1777

How can I schedule applications to be run in Google Cloud?

On AWS I can run cloud formation scripts to do things like shutdown my computers on weekends, or run EMR jobs.

How would I schedule tasks on google without creating a tiny instance as a task manager?

Upvotes: 1

Views: 682

Answers (3)

Xiaobing Mi
Xiaobing Mi

Reputation: 130

method 1:

how to schedule machines to run only at certain time periods pls refer to gcloud compute command start and stop

then crontab -e add following tasks as you expect to be ,for example :

00 06 * * * /usr/bin/gcloud compute instances start instance-1
00 07 * * * /usr/bin/gcloud compute instances stop instance-1

method 2:

suggest you use google container engine

then crontab -e add following tasks as you expect to be ,for example :

00 06 * * * /usr/bin/gcloud compute instance-groups managed resize instance-group-1 --size=1
00 07 * * * /usr/bin/gcloud compute instance-groups managed resize instance-group-1 --size=0

you need to place your task into your vm instance , and create a template instance from the instance you just created, then create an instance group based on that instance template

Upvotes: 2

ivamax9
ivamax9

Reputation: 2629

If I understand you right, App Engine allows you to use Cron Service, which basically can be configured for your purpose. But it requires some knowledge of programming languages like Go, PHP, Java or Python.

Upvotes: 1

Hakro
Hakro

Reputation: 2774

The alternative to CloudFormation is the Google Cloud Deployment Manager. They are quite similar.

More info here

For the record, you can find a mapping of AWS services and GCP services here.

Upvotes: 1

Related Questions