Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextflow ECS Service and ALB #48

Merged
merged 15 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ name = "pypi"
sceptre = "2.5.0"
sceptre-cmd-resolver = "1.1.2"
pre-commit = "*"
sceptre-resolver-aws-secrets-manager = {file = "https://github.com/iAnomaly/sceptre-resolver-aws-secrets-manager/archive/v1.0.0.tar.gz"}
sceptre-ssm-resolver = "1.2.1"

[requires]
python_version = "3.9"

[packages]
sceptre-resolver-aws-secrets-manager = {file = "https://github.com/iAnomaly/sceptre-resolver-aws-secrets-manager/archive/v1.0.0.tar.gz"}
sceptre-ssm-resolver = "*"
102 changes: 49 additions & 53 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions config/develop/nextflow-aurora-mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ template_path: nextflow-aurora-mysql.yaml
stack_name: nextflow-aurora-mysql
dependencies:
- develop/nextflow-vpc.yaml
- develop/nextflow-ecs-security-group.yaml
parameters:
VpcID: !stack_output_external nextflow-vpc::VPCId
SubnetIDs:
- !stack_output_external nextflow-vpc::PrivateSubnet1
- !stack_output_external nextflow-vpc::PrivateSubnet2
EcsSecurityGroupId: !stack_output_external nextflow-ecs-security-group::SecurityGroupId
TemplateRootUrl: 'https://{{stack_group_config.admincentral_cf_bucket}}.s3.amazonaws.com'
stack_tags:
Department: IBC
Expand Down
15 changes: 0 additions & 15 deletions config/develop/nextflow-ecs-capacity.yaml

This file was deleted.

13 changes: 9 additions & 4 deletions config/develop/nextflow-ecs-cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
template_path: nextflow-ecs-cluster.yaml
template_path: nextflow-ecs-cluster.j2
stack_name: nextflow-ecs-cluster
dependencies:
- develop/nextflow-vpc.yaml
parameters:
VpcId: !stack_output_external nextflow-vpc::VPCId
EcsSecurityGroupId: !stack_output_external nextflow-ecs-security-group::SecurityGroupId
SubnetIds:
- !stack_output_external nextflow-vpc::PublicSubnet
SecurityIngressFromPort: '80'
SecurityIngressToPort: '8080'
sceptre_user_data:
TowerConfigFileContents: |
tower:
auth:
github:
allow-list:
- tess.thyer@gmail.com
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list will be built out more later -- this configuration does not appear to be taking hold. Waiting to hear back from support about this.

stack_tags:
Department: IBC
Project: Infrastructure
Expand Down
10 changes: 10 additions & 0 deletions config/develop/nextflow-ecs-security-group.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
template_path: nextflow-ecs-security-group.yaml
stack_name: nextflow-ecs-security-group
dependencies:
- develop/nextflow-vpc.yaml
parameters:
VpcId: !stack_output_external nextflow-vpc::VPCId
stack_tags:
Department: IBC
Project: Infrastructure
OwnerEmail: nextflow-admins@sagebase.org
19 changes: 19 additions & 0 deletions config/develop/nextflow-ecs-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
template_path: nextflow-ecs-service.yaml
stack_name: nextflow-ecs-service
dependencies:
- develop/nextflow-ecs-cluster.yaml
- develop/nextflow-ecs-task-definition.yaml
parameters:
ClusterName: !stack_output_external nextflow-ecs-cluster::EcsClusterName
TaskDefinitionArn: !stack_output_external nextflow-ecs-task-definition::TaskDefinitionArn
TowerUIContainerName: !stack_output_external nextflow-ecs-task-definition::FrontendContainerName
TowerUIContainerPort: !stack_output_external nextflow-ecs-task-definition::FrontendContainerPort
VpcId: !stack_output_external nextflow-vpc::VPCId
SubnetIds:
- !stack_output_external nextflow-vpc::PublicSubnet
- !stack_output_external nextflow-vpc::PublicSubnet1
SSLCertificateArn: !stack_output_external tower-dev-certificate::CertificateArn
stack_tags:
Department: IBC
Project: Infrastructure
OwnerEmail: nextflow-admins@sagebase.org
12 changes: 7 additions & 5 deletions config/develop/nextflow-ecs-task-definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@ template_path: nextflow-ecs-task-definition.yaml
stack_name: nextflow-ecs-task-definition
dependencies:
- develop/nextflow-aurora-mysql.yaml
- develop/nextflow-ecs-cluster.yaml
parameters:
ClusterName: !stack_output_external nextflow-ecs-cluster::EcsClusterName
TowerSmtpHost: 'email-smtp.us-east-1.amazonaws.com'
TowerSmtpPort: '587'
TowerSmtpUser: !ssm 'smtp-username'
TowerSmtpPassword: !ssm 'smtp-password'
TowerContactEmail: nextflow-admins@sagebase.org
TowerServerUrl: !rcmd >-
aws ec2 describe-instances --filter Name=tag:aws:cloudformation:stack-name,Values=nextflow-ecs-cluster
| jq -r '.Reservations[0].Instances[0].PublicIpAddress'
TowerServerUrl: https://tower-dev.sagebionetworks.org/
TowerJwtSecret: !aws_secrets_manager nextflow-tower-secret/jwt::SecretString::secret
TowerCryptoSecretkey: !aws_secrets_manager nextflow-tower-secret/crypto::SecretString::secret
TowerLicense: !aws_secrets_manager nextflow/license::SecretString::license_key
TowerDbUrl: !stack_output_external nextflow-aurora-mysql::DBUrl
TowerDbUser: !aws_secrets_manager nextflow-aurora-mysql-NextflowTowerDatabaseUserSecret::SecretString::username
TowerDbPassword: !aws_secrets_manager nextflow-aurora-mysql-NextflowTowerDatabaseUserSecret::SecretString::password
TowerGithubClientId: !aws_secrets_manager nextflow/github_oauth_app::SecretString::client
TowerGithubSecret: !aws_secrets_manager nextflow/github_oauth_app::SecretString::secret
RedisContainerImage: 'redis:5.0.8'
CronContainerImage: '195996028523.dkr.ecr.eu-west-1.amazonaws.com/nf-tower-enterprise/backend:v21.06.0'
FrontendContainerImage: '195996028523.dkr.ecr.eu-west-1.amazonaws.com/nf-tower-enterprise/frontend:v21.06.0'
BackendContainerImage: '195996028523.dkr.ecr.eu-west-1.amazonaws.com/nf-tower-enterprise/backend:v21.06.0'
stack_tags:
Department: IBC
Project: Infrastructure
Expand Down
13 changes: 13 additions & 0 deletions config/develop/nextflow-r53-alias-record.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
template_path: nextflow-r53-alias-record.yaml
stack_name: nextflow-r53-alias-record
dependencies:
- develop/nextflow-r53-hostedzone.yaml
- develop/nextflow-ecs-service.yaml
parameters:
HostedZoneId: !stack_output_external nextflow-r53-hostedzone::HostedZoneId
LoadBalancerDnsName: !stack_output_external nextflow-ecs-service::LoadBalancerDnsName
LoadBalancerCanonicalHostedZoneId: !stack_output_external nextflow-ecs-service::LoadBalancerCanonicalHostedZoneID
stack_tags:
Department: IBC
Project: Infrastructure
OwnerEmail: nextflow-admins@sagebase.org
4 changes: 4 additions & 0 deletions config/develop/nextflow-r53-hostedzone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ parameters:
hooks:
before_launch:
- !cmd "wget {{stack_group_config.aws_infra_templates_root_url}}/v0.2.20/templates/R53-hostedzone.yaml -O templates/remote/R53-hostedzone.yaml"
stack_tags:
Department: IBC
Project: Infrastructure
OwnerEmail: nextflow-admins@sagebase.org
15 changes: 0 additions & 15 deletions config/prod/nextflow-ecs-capacity.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions templates/nextflow-aurora-mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ Parameters:
Type: String
Default: ''

EcsSecurityGroupId:
Type: AWS::EC2::SecurityGroup::Id
Description: Security group ID for ECS cluster to grant database access

TemplateRootUrl:
Type: String
Description: URL of S3 bucket where templates are deployed
Expand Down Expand Up @@ -166,6 +170,12 @@ Resources:
Properties:
VpcId: !Ref VpcID
GroupDescription: Aurora Cluster Security Group
SecurityGroupIngress:
- Description: Inbound rule to allow database access to ECS cluster
SourceSecurityGroupId: !Ref EcsSecurityGroupId
IpProtocol: tcp
FromPort: 3306
ToPort: 3306

CloudWatchDBClusterAuditLogGroup:
Type: AWS::Logs::LogGroup
Expand Down
Loading