Nick
Nick

Reputation: 3134

Switching off AWS instance automatically once a job is done

I have a Linux desktop. I would like to be able to run on it a job that does the following:

  1. switches on an AWS instance
  2. deploys and runs a Docker script on it
  3. once the script finished it switches off the AWS instance

Basically, my Linux desktop would be a sort of master which switches on on demand slave work nodes. And then switches them off once the job is done.

Is there a framework/tool that does this? I'm looking for an analogy of SGE/LSF in which the master node is non-aws while the slave nodes are aws instances. And the scripts which are deployed are docker-ised.

P.S. While typing this it occurred to me that this might be what a Docker machine is supposed to do. I haven't used it yet so would welcome comments on such an option.

Upvotes: 1

Views: 347

Answers (2)

Michael Closson
Michael Closson

Reputation: 932

AWS Batch can run a Docker job. It could be just what you need. See the docs here.

Upvotes: 1

Putnik
Putnik

Reputation: 6854

On desktop you can run aws ec2 stop-instances. Try aws ec2 stop-instances help for details.

How to set up - official guide

Upvotes: 0

Related Questions