Git Product home page Git Product logo

aws-batch-python-sample's Introduction

AWS Batch Python sample template

A simple python quick start template to use with AWS Batch that helps you build a docker image through CI / CD .

This demo batch downloads a sample json and uploads to s3 destination.

Prerequistes

  1. Install Python 3.6
  2. Optional: Install virtual environment https://virtualenv.pypa.io/en/latest/installation/ or conda https://conda.io/docs/installation.html

Set up

  1. Install python dependencies
pip install -r source/requirements.txt

Run Sample locally

export PYTHONPATH=./source

# To get help
python ./source/main.py -h 

# Sample download data to current directory
python ./source/main.py .

# Sample download data to s3 path s3://mybucket/mydir/
python ./source/main.py . --s3 s3://mybucket/mydir/

Run on AWS batch

  1. Create an repository in ECR registry called "aws-batch-sample-python", as detailed here https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-create.html

  2. Setup AWS codebuild to build a docker container as detailed using cloudformation stack codebuild_cloudformation.json. This uses the buildspec.yaml. For more details on codebuild see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html.
    Note The ecr repositoryname to use is specified in the buildspec.yaml file

  3. Start a build in codebuild to push a new image into the ECS Repository "aws-batch-sample-python". When the build succeds, you will see a image in the repository

  4. Register a job with AWS batch as detailed in aws_batch/README.md

License

This library is licensed under the MIT-0 License. See the LICENSE file.

aws-batch-python-sample's People

Contributors

amazon-auto avatar elangovana avatar prasunanand avatar

Stargazers

 avatar

Watchers

 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.