Lambda Runtime
Lambda Role setup
Go to AWS IAM console and create a role for the lambda cache node (Lambda function).
AWS IAM console -> Roles -> Create Role -> Lambda ->
AWSLambdaFullAccess,
AWSLambdaVPCAccessExecutionRole,
AWSLambdaENIManagementAccess
Enable Lambda internet access under VPC
Plese refer to this article. (You could skip this step if you do not want to run InfiniStore under VPC).
Configuration
Lambda function create and config
Edit deploy/create_function.sh
and deploy/update_function.sh
DEPLOY_PREFIX="your lambda function prefix"
DEPLOY_CLUSTER=400 # The number of Lambda deployments used for window rotation.
DEPLOY_MEM=1024 # The memory of Lambda deployments.
S3="your bucket name"
Edit destination S3 bucket in lambda/config.go
, these buckets are for data collection and durable storage.
S3_BACKUP_BUCKET = "your COS bucket%s" // Leave %s at the end your COS bucket.
S3_COLLECTOR_BUCKET = "your data collection bucket" // Optional. Required for reproducibility experiments.
Edit lambda/migrator/client.go
, change AWS region if necessary.
AWSRegion = "us-east-1"
Edit the aws settings and the VPC configuration in deploy/deploy_function.go
. If you do not want to run InfiniStore under VPC, you do not need to modify the subnet
and securityGroup
settings.
ROLE = "arn:aws:iam::[aws account id]:role/[role name]"
REGION = "us-east-1"
...
...
subnet = []*string{
aws.String("your private subnet 1"),
aws.String("your private subnet 2"),
}
securityGroup = []*string{
aws.String("your security group")
}
Run script to create and deploy lambda functions (Also, if you do not want to run InfiniStore under VPC, you need to remove the --no-vpc
flag on executing deploy/create_function.sh
).
export GO111MODULE="on"
go get
deploy/create_function.sh --no-vpc 600
If lambda functions are deployed in VPC, create NAT gateway to give lambdas access to the proxy. You may use AWS console or create_nat.sh
. Besure to change the settings as described in the script before executing.
deploy/create_nat.sh
Proxy configuration
Edit proxy/config/config.go
, change the aws region, cluster size, and prefix of the Lambda functions.
const AWSRegion = "us-east-1"
const NumLambdaClusters = 1000
const LambdaPrefix = "Your Lambda Function Prefix"
const ServerPublicIp = "" // Leave it empty if using VPC.