这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Conversation

@sachin-101
Copy link
Contributor

@sachin-101 sachin-101 commented Aug 24, 2020

Description

Initial serverless deployment of Node on AWS.
Fixes #642

  • Initial deployment of Node as Lambda Function
  • Add Lambda layer with PyGridNode dependencies
  • Host packaged dependencies on S3
  • Deploy AWS EFS (Elasitc File System) with Syft and it's dependencies installed
  • Mount EFS on Lambda function to import syft (along with dependencies such as torch)
  • Deploy AWS RDS database
  • Create tables in database upon initial deployment
  • Connect to database using Flask SQL Alchemy
  • Move all the infrastructure to new VPC with Private subnets for Lambda and Database

Affected Dependencies

  • Added flask-lambda-python36==0.1.0
  • Added sqlalchemy-aurora-data-api

How has this been tested?

  • Existing tests.

Checklist

@sachin-101 sachin-101 requested a review from AmrMKayid August 24, 2020 06:02
@sachin-101 sachin-101 added Status: In Progress 🌟 This is actively being worked on Type: Epic 🤙 Describes a large amount of functionality that will likely be broken down into smaller issues labels Aug 24, 2020
Changed runtime to py3.6
- Returns an instance of FlaskLambda
- FlaskLambda can handle events passed by triggers to the lambda
function
@sachin-101 sachin-101 changed the title [WIP] Serverless deployment of Node on AWS [WIP] Serverless deployment of Node on AWS (HTTP) Aug 29, 2020
* Added EFS, Access points, and mount targets
* Would be used to store syft and dependencies
* Lambda is added to same VPC as EFS
* Lambda can access the EFS via provided access point
* Lambda can import dependencies stored in EFS
* Can import syft and it's dependencies including torch from numpy
* Syft and dependencies are hosted on efs
* efs is mounted on aws lambda
* ec2 instance is used to install syft on efs
* Added sqlalchemy-aurora-data-api as a dependency in requirements.txt
* Private subnets would host the lambda function
* NAT & Internet gateway would allow lambda to access AWS RDS via Data API
* subnets in multiple availability zones allow high availability & fault tolerance
* Associated lambda to private subnets
* Assosiated database to private subnets
* Added EFS file system to private subnets
* [Fix]: Lambda can access database
* [Broken]: Lambda can't mount the EFS
* Initialize and seed the remote database
@sachin-101 sachin-101 added the dependencies Pull requests that update a dependency file label Sep 26, 2020
@sachin-101 sachin-101 changed the title [WIP] Serverless deployment of Node on AWS (HTTP) Serverless deployment of Node on AWS (HTTP) Sep 27, 2020
@cereallarceny cereallarceny merged commit fe655e5 into dev Sep 29, 2020
@cereallarceny cereallarceny deleted the serverless/aws branch September 29, 2020 11:33
AmrMKayid pushed a commit that referenced this pull request Dec 15, 2020
* Initial template

* Add more params to modules

* Organize files into folders

* Separate resources into files

* Add AWS Lambda layers

Layers contain all dependencies for the Node

* Solved Numpy import issue

Changed runtime to py3.6

* Added Lambda compatible create_app() function

- Returns an instance of FlaskLambda
- FlaskLambda can handle events passed by triggers to the lambda
function

* Host packaged dependencies on s3

* Added Elastic File system

* Added EFS, Access points, and mount targets
* Would be used to store syft and dependencies

* Integrated AWS Lambda with AWS EFS

* Lambda is added to same VPC as EFS
* Lambda can access the EFS via provided access point
* Lambda can import dependencies stored in EFS

* Successful import of syft and dependencies on AWS lambda

* Can import syft and it's dependencies including torch from numpy
* Syft and dependencies are hosted on efs
* efs is mounted on aws lambda
* ec2 instance is used to install syft on efs

* Integrated database with Lambda

* Added support for AWS secret manager

* Added IAM policies to access database from lambda

* Added bash script to create lambda layer zip file

* Added sqlalchemy-aurora-data-api as a dependency in requirements.txt

* Added VPC, Public & Private Subnets, NAT & Internet gateway

* Private subnets would host the lambda function
* NAT & Internet gateway would allow lambda to access AWS RDS via Data API
* subnets in multiple availability zones allow high availability & fault tolerance

* Lambda can access Database via Data API

* Associated lambda to private subnets
* Assosiated database to private subnets
* Added EFS file system to private subnets
* [Fix]: Lambda can access database
* [Broken]: Lambda can't mount the EFS

* Moved EC2 to a new folder

* Added permissions to EFS access point

* Added database to create_lambda_app() function

* Initialize and seed the remote database

* Fix: Register dialects before connecting to database

* Tidy up .gitignore

* Added flask-lambda-python36 & sqlalchemy-aurora-data-api as dependency

* Merged back ec2 instance

* Updated lambda layer dependencies

* Clean and refactor IAM policies

* Remove redundant permissions

* Replace torch-gpu with torch-cpu

*Fix: secretmanager:GetSecretValue permission

* Added functionality to pull latest AMI id

Co-authored-by: Patrick Cason <me@patrickcason.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dependencies Pull requests that update a dependency file Status: In Progress 🌟 This is actively being worked on Type: Epic 🤙 Describes a large amount of functionality that will likely be broken down into smaller issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deploy Node to serverfull environment on AWS (HTTP and Websockets)

3 participants