Code Monkey home page Code Monkey logo

deepracer-templates's Introduction

deepracer-templates

Simple cloudformation template to assist in creating ec2 instances for deep racer learning.

Two stack, one for S3 storage bucket and EFS filesystem, a second one for an ec2 instance. The ec2 instance mounts the efs at /home/ubunty/efs - base-resources.yaml and instance.yaml

Supporting scripts: create-base-resources.sh and delete-base-resources.sh

create-base-resources.sh takes mandatory parameters: stack-name, ip address to add to ncls, ncl rule number The script also makes assumptions about account structure and figures out which VPC (defaul) to use, and randomly pics a subnet.

delete-base-resources.sh takes a single mandatory parameter, the stack-name, same value as above.

create-instance.sh - takes two mandatory parameters, the name of the base resources stack and the name of the stack used to create an ec2 instance. This script can be execute multiple times, with different instance stack names. All the different instances will share the base resources (efs and s3).

Single template creates storage bucket and ec2 instance - ec2-and-s3-for-learning.yaml

Example awscli provisioning of the template:

aws cloudformation deploy --stack-name MY_STACK_NAME --template ec2-and-s3-for-learning.yaml --parameter-overrides RuleNumber=ACL_RULE_NUMBER MyIPAddress=MY_IP NetworkAclId=NACL_ID --capabilities CAPABILITY_IAM

Where each of the following needs to have appropriate values assigned:

MY_STACK_NAME: This is used to name the cloudformation stack created, it is also used to tag the ec2 instance to easily find it, and will endup as a prefix of the name of the s3 bucket created.

ACL_RULE_NUMBER: This used in creating the NACL in-bound rules, pick a number that does not conflict with others.

MY_IP: used to configure access that allows your IP address to access the ec2 instance.

NACL_ID: used in the ACL_RULE_NUMBER, to configure the correct NACL

Other features:

The ec2 instance created will have deepracer software installed. The install process includes a reboot, meaning that after the template has been provisioned, the instance will be rebooted once.

By default this template uses spot pricing, you can adjust the spot price with the SpotPrice parameter, with value '' indicating that you want to use on-demand pricing.

Access to the ec2 instance is via ssm sessions, not ssh (no ssh key is needed).

This template creates an s3 bucket. When deleting the template, the bucket must be empty. The name of the created bucket is available as an environment variable (MY_BUCKET) within the ec2 instance.

'One-time' spot instances can not be stopped. This template allows updating the template with parameter 'DisableInstance=Yes', which terminates the instance. Subsequent update with 'DisableInstance='No' will recreate the instance. This will result in loss of locally stored files.

deepracer-templates's People

Contributors

pgdad avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.