Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ analysis/
test.sh
tests/data/
data/*
.scratch
.scratch
aws-batch-arch-for-protein-folding.code-workspace
328 changes: 328 additions & 0 deletions AWS_Batch_Architecture.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# Package infrastructure for deployment
aws cloudformation package --template-file infrastructure/cloudformation/batch-protein-folding-cfn-root.yaml --s3-bucket archon-iac --s3-prefix main --output-template-file ../protein-folding.cfn.yaml --profile archon

# Update stack
aws cloudformation update-stack --stack-name archon-iac-galaxy --template-body file://../protein-folding.cfn.yaml --capabilities CAPABILITY_NAMED_IAM --profile archon --disable-rollback --output json --profile archon
776 changes: 523 additions & 253 deletions README.md

Large diffs are not rendered by default.

Binary file added imgs/archon_batch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/archon_ec2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/archon_ecr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/archon_fsx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/archon_superfold_ecr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/archon_vpc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 50 additions & 10 deletions infrastructure/cloudformation/batch-protein-folding-cfn-batch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Parameters:
CreateAWSServiceRoleForEC2Spot:
Description: Create the AWSServiceRoleForEC2Spot service-linked role
Type: String
Default: "N"
Default: "Y"
CreateAWSServiceRoleForEC2SpotFleet:
Description: Create the AWSServiceRoleForEC2SpotFleet service-linked role
Type: String
Default: "N"
Default: "Y"
CreateP4dComputeEnvironment:
Description: Create a compute environment for p4d.24xlarge instance types? Note that availabilty is region-specific
Type: String
Expand Down Expand Up @@ -136,8 +136,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref AWS::StackId
- Key: SolutionId
Value: SO9164
UserData:
Fn::Base64:
Fn::Join:
Expand Down Expand Up @@ -189,8 +187,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref AWS::StackId
- Key: SolutionId
Value: SO9164

AWSServiceRoleForEC2SpotServiceLinkedRole:
Type: AWS::IAM::ServiceLinkedRole
Expand Down Expand Up @@ -302,6 +298,38 @@ Resources:
StackId: !Ref "AWS::StackId"
SolutionId: SO9164

G4dnSpotComputeEnvironment:
Type: AWS::Batch::ComputeEnvironment
Properties:
ComputeResources:
AllocationStrategy: SPOT_CAPACITY_OPTIMIZED
BidPercentage: 100
InstanceRole: !Ref InstanceProfile
InstanceTypes:
- g4dn
LaunchTemplate:
LaunchTemplateId:
Ref: InstanceLaunchTemplate
Version: $Latest
MaxvCpus: 256
MinvCpus: 0
SecurityGroupIds:
- Ref: DefaultSecurityGroupID
SpotIamFleetRole:
"Fn::GetAtt": AmazonEC2SpotFleetTaggingRole.Arn
Subnets: !Ref Subnets
Type: SPOT
Tags:
Application: !Ref ApplicationName
StackId: !Ref "AWS::StackId"
SolutionId: SO9164
State: ENABLED
Type: MANAGED
Tags:
Application: !Ref ApplicationName
StackId: !Ref "AWS::StackId"
SolutionId: SO9164

G5ComputeEnvironment:
Type: AWS::Batch::ComputeEnvironment
Condition: CreateG5ComputeEnvironment
Expand Down Expand Up @@ -387,7 +415,6 @@ Resources:
Tags:
Application: !Ref ApplicationName
StackId: !Ref "AWS::StackId"
SolutionId: SO9164

G4dnJobQueue:
Type: AWS::Batch::JobQueue
Expand All @@ -400,7 +427,18 @@ Resources:
Tags:
Application: !Ref ApplicationName
StackId: !Ref "AWS::StackId"
SolutionId: SO9164

G4dnSpotJobQueue:
Type: AWS::Batch::JobQueue
Properties:
ComputeEnvironmentOrder:
- ComputeEnvironment: !Ref G4dnSpotComputeEnvironment
Order: 1
Priority: 10
State: ENABLED
Tags:
Application: !Ref ApplicationName
StackId: !Ref "AWS::StackId"

G5JobQueue:
Type: AWS::Batch::JobQueue
Expand All @@ -414,7 +452,6 @@ Resources:
Tags:
Application: !Ref ApplicationName
StackId: !Ref "AWS::StackId"
SolutionId: SO9164

P4dJobQueue:
Type: AWS::Batch::JobQueue
Expand Down Expand Up @@ -460,7 +497,6 @@ Resources:
Tags:
Application: !Ref ApplicationName
StackId: !Ref "AWS::StackId"
SolutionId: SO9164
Type: container

Outputs:
Expand All @@ -480,6 +516,10 @@ Outputs:
Description: Job queue for on-demand GPU instances.
Value:
Ref: G4dnJobQueue
G4dnSpotJobQueue:
Description: Job queue for on-demand GPU instances.
Value:
Ref: G4dnSpotJobQueue
G5JobQueue:
Condition: CreateG5ComputeEnvironment
Description: Job queue for on-demand G5 instances.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ Parameters:
DownloadFsxData:
Description: Automatically populate FSx for Lustre file system with model parameters and sequence databases?
Type: String
Default: "Y"
Default: "N"
AllowedValues: [Y, N]
CodeRepoS3BucketName:
Description: S3 Bucket Name to retrieve code zip
Type: String
Default: "aws-hcls-ml"
Default: "archon-iac"
S3BucketARN:
Description: S3 Bucket ARN
Type: String
Expand Down Expand Up @@ -68,8 +68,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref AWS::StackId
- Key: SolutionId
Value: SO9164

DownloadContainerRegistry:
Type: AWS::ECR::Repository
Expand All @@ -83,8 +81,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref "AWS::StackId"
- Key: SolutionId
Value: SO9164

CodeBuildRole:
Type: AWS::IAM::Role
Expand Down Expand Up @@ -163,8 +159,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref "AWS::StackId"
- Key: SolutionId
Value: SO9164

EncryptionKey:
Type: "AWS::KMS::Key"
Expand Down Expand Up @@ -228,8 +222,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref "AWS::StackId"
- Key: SolutionId
Value: SO9164

CodeBuildLambdaExecutionRole:
Type: AWS::IAM::Role
Expand Down Expand Up @@ -258,7 +250,8 @@ Resources:
StartCodeBuildLambda:
Type: AWS::Lambda::Function
Properties:
ReservedConcurrentExecutions: 10
# ReservedConcurrentExecutions: 10
# ReservedConcurrentExecutions: 0
Code:
ZipFile: |
import logging
Expand Down Expand Up @@ -302,9 +295,7 @@ Resources:
- Key: Application
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref "AWS::StackId"
- Key: SolutionId
Value: SO9164
Value: !Ref "AWS::StackId"

##################################################
# Delete container repo on stack deletion
Expand Down Expand Up @@ -337,7 +328,8 @@ Resources:
DeleteContainerRepoLambda:
Type: AWS::Lambda::Function
Properties:
ReservedConcurrentExecutions: 10
# ReservedConcurrentExecutions: 10
# ReservedConcurrentExecutions: 0
Code:
ZipFile: |
import logging
Expand Down Expand Up @@ -386,8 +378,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref "AWS::StackId"
- Key: SolutionId
Value: SO9164

##################################################
# Create Download Container
Expand Down Expand Up @@ -429,9 +419,7 @@ Resources:
- Key: Application
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref "AWS::StackId"
- Key: SolutionId
Value: SO9164
Value: !Ref "AWS::StackId"

StartDownloadContainerBuild:
Type: Custom::ResourceForBuildingContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ Resources:

download_scripts = [
"/scripts/download_alphafold_params.sh",
"/scripts/download_bfd.sh",
"/scripts/download_esmfold_params.sh",
"/scripts/download_mgnify.sh",
"/scripts/download_openfold_params.sh",
"/scripts/download_pdb_mmcif.sh",
"/scripts/download_pdb_seqres.sh",
"/scripts/download_pdb70.sh",
"/scripts/download_small_bfd.sh",
"/scripts/download_uniref30.sh",
"/scripts/download_uniprot.sh",
"/scripts/download_uniref90.sh",
"/scripts/download_omegafold_params.sh",
"/scripts/download_rfdesign_params.sh",
"/scripts/download_diffdock_params.sh",
# "/scripts/download_bfd.sh",
# "/scripts/download_esmfold_params.sh",
# "/scripts/download_mgnify.sh",
# "/scripts/download_openfold_params.sh",
# "/scripts/download_pdb_mmcif.sh",
# "/scripts/download_pdb_seqres.sh",
# "/scripts/download_pdb70.sh",
# "/scripts/download_small_bfd.sh",
# "/scripts/download_uniref30.sh",
# "/scripts/download_uniprot.sh",
# "/scripts/download_uniref90.sh",
# "/scripts/download_omegafold_params.sh",
# "/scripts/download_rfdesign_params.sh",
# "/scripts/download_diffdock_params.sh",
"/scripts/download_rfdiffusion_params.sh"
]

Expand Down Expand Up @@ -188,8 +188,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref AWS::StackId
- Key: SolutionId
Value: SO9164

DownloadFsxData:
Type: Custom::ResourceForDownloadingData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Parameters:
- 250
- 500
- 1000
Default: 500
Default: 125
Subnet:
Description: Subnet ID for the file system.
Type: String
Expand Down Expand Up @@ -65,9 +65,7 @@ Resources:
Ref: ApplicationName
- Key: StackId
Value:
Ref: AWS::StackId
- Key: SolutionId
Value: SO9164
Ref: AWS::StackId

DataRepoAssociation:
Type: AWS::FSx::DataRepositoryAssociation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref "AWS::StackId"
- Key: SolutionId
Value: SO9164

CodeBuildProjectAlphaFold2:
Type: AWS::CodeBuild::Project
Expand Down Expand Up @@ -82,8 +80,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref "AWS::StackId"
- Key: SolutionId
Value: SO9164

StartAlphaFold2ContainerBuild:
Type: Custom::ResourceForBuildingContainer
Expand Down Expand Up @@ -132,7 +128,6 @@ Resources:
Tags:
Application: !Ref ApplicationName
StackId: !Ref "AWS::StackId"
SolutionId: SO9164
Type: container

DeleteAlphaFold2ContainerRepo:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref "AWS::StackId"
- Key: SolutionId
Value: SO9164

CodeBuildProjectProteinMPNN:
Type: AWS::CodeBuild::Project
Expand Down Expand Up @@ -81,8 +79,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref "AWS::StackId"
- Key: SolutionId
Value: SO9164

StartProteinMPNNContainerBuild:
Type: Custom::ResourceForBuildingContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ Resources:
Value: !Ref ApplicationName
- Key: StackId
Value: !Ref "AWS::StackId"
- Key: SolutionId
Value: SO9164

CodeBuildProjectRFDiffusion:
Type: AWS::CodeBuild::Project
Expand Down Expand Up @@ -126,7 +124,6 @@ Resources:
Tags:
Application: !Ref ApplicationName
StackId: !Ref "AWS::StackId"
SolutionId: SO9164
Type: container

DeleteRFDiffusionContainerRepo:
Expand Down
Loading