Code Monkey home page Code Monkey logo

dask-lambda-example's Introduction

What is this?

Example AWS Stack written in Python using CDK, to demonstrate using AWS Lambda as a Dask client to coordinate and offload work to an existing cluster.


What is in the stack?

The core example is files landing in S3, which then trigger a Lambda function. This function connects to an existing Dask cluster to submit the file for processing.

To complete the example, the stack deploys the S3 bucket along with an example 'producer' to mimick a data vendor which deposits files every minute. From there the example compute uses the input from the file to do some arbitrary computations on the cluster.


How to try?

Build

$ python -m venv .env
$ source .env/bin/activate
$ pip install -r requirements-dev.txt
$ pip install -r requirements.txt

This will install the necessary CDK, then this example's dependencies, and then build your Python files and your CloudFormation template.

Install the latest version of the AWS CDK CLI:

$ npm i -g aws-cdk

Run

cdk deploy \
  --toolkit-stack-name <<bootstrap CDK stack name, if not the default>> \
  --parameters CoiledToken=<<your coiled token>> \
  --parameters CoiledAccount=<<your coiled account name>> \
  --parameters CoiledUser=<<your coiled user>>

From there, you can go to Lambda functions run the StartStop Lambda function with input of {"action": "start"}, (or wait for the scheduled CRON event). Then go to SecretsManager or your Coiled account to view the new cluster and should see new computations taking place every minute.

You can also manually initiate new files by going to the Producer Lambda function and running it (input doesn't matter).

dask-lambda-example's People

Contributors

milesgranger avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.