Merge pull request #28 from rstudio/chore-staging

add staging env
This commit is contained in:
Steve Nolen 2019-08-16 12:08:35 -04:00 committed by GitHub
commit 52e3795f27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 2598 additions and 488 deletions

2
Jenkinsfile vendored
View file

@ -35,7 +35,7 @@ pipeline {
branch 'master'
}
steps {
sh 'make serverless-deploy'
sh 'make serverless-deploy.production'
}
}
}

View file

@ -33,7 +33,7 @@ fetch-serverless-custom-file:
rebuild-all: deps fetch-serverless-custom-file
$(SLS_BINARY) invoke stepf -n rBuilds -d '{"force": true}'
serverless-deploy: deps fetch-serverless-custom-file
$(SLS_BINARY) deploy --stage dev
serverless-deploy.%: deps fetch-serverless-custom-file
$(SLS_BINARY) deploy --stage $*
.PHONY: deps docker-build docker-push docker-down docker-build-package docker-shell-package-env ecr-login fetch-serverless-custom-file serverless-deploy

3057
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -4,6 +4,7 @@
"version": "0.1.0",
"dependencies": {},
"devDependencies": {
"serverless": "^1.42.3",
"serverless-pseudo-parameters": "^2.2.0",
"serverless-python-requirements": "^4.2.5",
"serverless-step-functions": "^1.8.0"

View file

@ -71,8 +71,19 @@ rBuildsEcsTaskIamRole:
Action:
- s3:*
Resource:
- arn:aws:s3:::${self:custom.s3Bucket}
- arn:aws:s3:::${self:custom.s3Bucket}/*
- arn:aws:s3:::${self:custom.${self:provider.stage}.s3Bucket}
- arn:aws:s3:::${self:custom.${self:provider.stage}.s3Bucket}/*
rBuildsEcsLaunchTemplate:
Type: AWS::EC2::LaunchTemplate
Properties:
LaunchTemplateName: r-builds-${self:provider.stage}-batch-managed-ecs-larger-volume
LaunchTemplateData:
BlockDeviceMappings:
- DeviceName: /dev/xvdcz
Ebs:
VolumeType: gp2
VolumeSize: 64
rBuildsBatchComputeEnvironment:
Type: AWS::Batch::ComputeEnvironment
@ -82,12 +93,15 @@ rBuildsBatchComputeEnvironment:
ServiceRole:
"Fn::GetAtt": [ rBuildsBatchIamRole, Arn ]
ComputeResources:
LaunchTemplate:
LaunchTemplateId:
Ref: rBuildsEcsLaunchTemplate
SpotIamFleetRole:
"Fn::GetAtt": [ rBuildsSpotFleetIamRole, Arn ]
SecurityGroupIds: ${self:custom.securityGroupIds}
Subnets: ${self:custom.subnets}
Type: SPOT
BidPercentage: 40
BidPercentage: 60
InstanceRole:
"Fn::GetAtt": [ rBuildsIamInstanceProfile, Arn ]
InstanceTypes:
@ -231,6 +245,7 @@ rBuildsEventRule:
Properties:
Description: Check for New R Versions
ScheduleExpression: rate(1 hour)
State: ${self:custom.${self:provider.stage}.eventRuleState}
Targets:
- Id: rbuilds
Input: '{}'

View file

@ -1,6 +1,7 @@
rBuilds:
Comment: "R Builds"
id: RBuildsStepFunction
name: r-builds-${self:provider.stage}
definition:
StartAt: QueueBuilds
States:

View file

@ -7,17 +7,19 @@ plugins:
custom: ${file(./serverless-custom.yml)}
package:
exclude:
- integration/**
- builder/**
- docs/**
exclude:
- integration/**
- builder/**
- docs/**
- node_modules/**
provider:
name: aws
runtime: python3.6
stage: ${opt:stage, self:custom.defaultStage}
deploymentBucket:
name: ${self:custom.deploymentBucket}
stackTags: ${self:custom.stackTags}
stackTags: ${self:custom.${self:provider.stage}.stackTags}
iamRoleStatements:
- Effect: Allow
Action:
@ -27,10 +29,10 @@ provider:
Action:
- "s3:*"
Resource:
- arn:aws:s3:::${self:custom.s3Bucket}
- arn:aws:s3:::${self:custom.s3Bucket}/*
- arn:aws:s3:::${self:custom.${self:provider.stage}.s3Bucket}
- arn:aws:s3:::${self:custom.${self:provider.stage}.s3Bucket}/*
environment:
S3_BUCKET: ${self:custom.s3Bucket}
S3_BUCKET: ${self:custom.${self:provider.stage}.s3Bucket}
JOB_QUEUE_ARN:
Ref: rBuildsBatchJobQueue
JOB_DEFINITION_ARN_ubuntu_1604: