Code Monkey home page Code Monkey logo

hyperflow-awsfargate-executor's Introduction

AWS Fargate executor for Hyperflow

https://github.com/hyperflow-wms/hyperflow

Dockerizing application

Requirements: git, nodejs, docker

git clone https://github.com/burkat/hyperflow-awsfargate-executor.git

cd hyperflow-awsfargate-executor

npm install

docker build -t handler .

Deploying docker image on AWS Fargate

Requirements: AWS CLI

Create ECR repository for docker image: aws ecr create-repository --repository-name handler

If everything is ok you'll get something like this: "repository": { "repositoryArn": "arn:aws:ecr:eu-west-1:123456789:repository/handler", "registryId": "123456789", "repositoryName": "fargate-news-aggregator", "repositoryUri": "123456789.dkr.ecr.eu-west-1.amazonaws.com/handler", "createdAt": 1551957524.0 }

Now you need to push docker image onto ECR repository. Log in to the AWS website and navigate to the Repositories tab under the Elastic Container Service. You should able to see the repository you have just created. Next, click on the repository and click on View Push Commands to get a list of commands that you need to run to be able to push your image to ECR. Follow the steps as they are given.

Example steps:

aws ecr get-login --no-include-email --region eu-west-1

sudo docker login -u AWS -p string https://123456789.dkr.ecr.eu-west-1.amazonaws.com

sudo docker tag handler:latest 123456789.dkr.ecr.eu-west-1.amazonaws.com/handler:latest

sudo docker push 123456789.dkr.ecr.eu-west-1.amazonaws.com/handler:latest

Create Fargate application

First, go to think link https://eu-west-1.console.aws.amazon.com/ecs/home?region=eu-west-1#/getStarted to get started with creating a new Fargate Application.

Click get started, then select custom container and configure it. Give it some name, image URI can be found in ECR repository, for example:

123456789.dkr.ecr.eu-west-1.amazonaws.com/handler:latest

Add port mapping for 8080 tcp then click update.

Click edit on Task definition - set some task definition name, and create proper task execution role which enables using S3. 2GB / 1 vCPU is recommended for Task memory and CPU. Click save and next.

Again next (we don't define load balancer here).

Set cluster name and next and create.

On the next page, you should be able to see the status of the service you have just created. Wait for the steps to complete and then click on View Service.

Running Hyperflow with AWS Fargate

Once on the services page, click on the Tasks tab to see the different tasks running for your application. Click on the task id. In the Task Details page, you should be able to see the Public IP under the network section. Copy this IP address.

Update your workflow so it uses RESTServiceCommand function.

Running Hyperflow with AWS Fargate is identical like AWS Lambda, you just need to switch SERVICE_URL in RESTServiceCommand.config.js from lambda URL to fargate application endpoint which is copied IP address (above) plus 8080 port, for example:

http://63.32.93.119:8080

Also, remember to set storage (S3) and bucket & prefix. S3 service is mandatory for this executor.

For more details check hyperflow page: https://github.com/hyperflow-wms/hyperflow.

hyperflow-awsfargate-executor's People

Contributors

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