Skip to content

Commit ae51330

Browse files
authored
Merge pull request #108 from ravigurram8/topic-release-3
PCluster-imagebuilder pipeline added
2 parents 14b321b + b09eb5f commit ae51330

1 file changed

Lines changed: 136 additions & 1 deletion

File tree

products/rg_imgbldr.yml

Lines changed: 136 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,40 @@ Resources:
9292
action: ExecuteBash
9393
inputs:
9494
commands:
95-
- tar -xvf /tmp/rstudio.tar.gz
95+
- tar -xvf /tmp/rstudio.tar.gz
9696
- mkdir -p /tmp/rstudio
9797
- cp /tmp/RStudio/machine-images/config/infra/files/rstudio/* /tmp/rstudio
9898
- bash /tmp/RStudio/machine-images/config/infra/provisioners/provision-rstudio.sh
99+
ComponentPCluster:
100+
Type: "AWS::ImageBuilder::Component"
101+
Properties:
102+
Name: !Sub "${AWS::StackName}-ComponentPCluster"
103+
Platform: "Linux"
104+
Version: !Ref Ver
105+
Description: "Configure PCluster Server"
106+
Tags:
107+
Name: !Join ["-", [!Ref AWS::StackName, "ConfigurePCluster"]]
108+
ResourceType: "RLCatalyst-Research-Gateway"
109+
Data: !Sub |
110+
name: PCluster-Provisioner
111+
description: This is the provisioner for PCluster for Research Gateway
112+
schemaVersion: 1.0
113+
phases:
114+
- name: build
115+
steps:
116+
- name: AddFiles
117+
action: S3Download
118+
inputs:
119+
- source: "s3://${SourceBucketName}/PCluster.tar.gz"
120+
destination: /tmp/PCluster.tar.gz
121+
- name: ExtractFiles
122+
action: ExecuteBash
123+
inputs:
124+
commands:
125+
- tar -xvzf /tmp/PCluster.tar.gz -C /tmp
126+
- mkdir -p /tmp/cluster
127+
- cp /tmp/PCluster/machine-images/config/infra/files/pcluster/* /tmp/cluster
128+
- bash /tmp/PCluster/machine-images/config/infra/provisioners/provision-launch.sh
99129
100130
#############
101131
# RECIPE
@@ -128,6 +158,20 @@ Resources:
128158
Name: !Join ["-", [!Ref AWS::StackName, "Nextflow_AdvancedImageRecipe"]]
129159
ResourceType: "RLCatalyst-Research-Gateway"
130160

161+
PClusterImageRecipe:
162+
Type: "AWS::ImageBuilder::ImageRecipe"
163+
Properties:
164+
Name: !Sub "${AWS::StackName}-PClusterImageRecipe"
165+
Version: !Ref Ver
166+
ParentImage: !Ref MasterAMI
167+
Description: !Sub "${AWS::StackName}-PClusterImageRecipe"
168+
Components:
169+
- ComponentArn: !GetAtt ComponentConfigureOS.Arn
170+
- ComponentArn: !GetAtt ComponentPCluster.Arn
171+
Tags:
172+
Name: !Join ["-", [!Ref AWS::StackName, "PClusterImageRecipe"]]
173+
ResourceType: "RLCatalyst-Research-Gateway"
174+
131175
###############
132176
# INFRA CONFIG
133177
###############
@@ -170,6 +214,25 @@ Resources:
170214
Name: !Join ["-", [!Ref AWS::StackName, "RStudioInfraConfig"]]
171215
ResourceType: "RLCatalyst-Research-Gateway"
172216

217+
PClusterInfraConfig:
218+
Type: "AWS::ImageBuilder::InfrastructureConfiguration"
219+
Properties:
220+
Name: !Sub "${AWS::StackName}-PCluster-InfraConfig"
221+
InstanceProfileName: !Ref ResearchGatewayImgBldrInstancePfl
222+
InstanceTypes:
223+
- "m5.large"
224+
TerminateInstanceOnFailure: True
225+
SecurityGroupIds:
226+
- !Ref ResearchGatewayImgBldrInstanceSG
227+
SubnetId: !Ref PrivateSubnetId
228+
Logging:
229+
S3Logs:
230+
S3BucketName: !Ref SourceBucketName
231+
S3KeyPrefix: !Join ["/", ["Logs", "RL_RG_PCluster", !Ref Ver]]
232+
Tags:
233+
Name: !Join ["-", [!Ref AWS::StackName, "PClusterInfraConfig"]]
234+
ResourceType: "RLCatalyst-Research-Gateway"
235+
173236
ResearchGatewayImgBldrInstanceSG:
174237
Type: AWS::EC2::SecurityGroup
175238
Properties:
@@ -309,6 +372,57 @@ Resources:
309372
Tags:
310373
Name: "RStudio"
311374
RLCatalystProduct: "RStudio"
375+
PClusterDistributionConfiguration:
376+
Type: "AWS::ImageBuilder::DistributionConfiguration"
377+
Properties:
378+
Name: !Sub "${AWS::StackName}-PClusterDistributionConfig"
379+
Description: "PCluster for RLCatalyst Research Gateway"
380+
Distributions:
381+
- Region: "us-east-2"
382+
AmiDistributionConfiguration:
383+
Name: "PCluster {{ imagebuilder:buildDate }}"
384+
Description: "PCluster for RLCatalyst Research Gateway"
385+
AmiTags:
386+
RLCatalystProduct: "PCluster"
387+
- Region: "us-east-1"
388+
AmiDistributionConfiguration:
389+
Name: "PCluster {{ imagebuilder:buildDate }}"
390+
Description: "PCluster for RLCatalyst Research Gateway"
391+
AmiTags:
392+
RLCatalystProduct: "PCluster"
393+
- Region: "us-west-2"
394+
AmiDistributionConfiguration:
395+
Name: "PCluster {{ imagebuilder:buildDate }}"
396+
Description: "PCluster for RLCatalyst Research Gateway"
397+
AmiTags:
398+
RLCatalystProduct: "PCluster"
399+
- Region: "us-west-1"
400+
AmiDistributionConfiguration:
401+
Name: "PCluster {{ imagebuilder:buildDate }}"
402+
Description: "PCluster for RLCatalyst Research Gateway"
403+
AmiTags:
404+
RLCatalystProduct: "PCluster"
405+
- Region: "ap-south-1"
406+
AmiDistributionConfiguration:
407+
Name: "PCluster {{ imagebuilder:buildDate }}"
408+
Description: "PCluster for RLCatalyst Research Gateway"
409+
AmiTags:
410+
RLCatalystProduct: "PCluster"
411+
- Region: "ap-southeast-1"
412+
AmiDistributionConfiguration:
413+
Name: "PCluster {{ imagebuilder:buildDate }}"
414+
Description: "PCluster for RLCatalyst Research Gateway"
415+
AmiTags:
416+
RLCatalystProduct: "PCluster"
417+
- Region: "ap-southeast-2"
418+
AmiDistributionConfiguration:
419+
Name: "PCluster {{ imagebuilder:buildDate }}"
420+
Description: "PCluster for RLCatalyst Research Gateway"
421+
AmiTags:
422+
RLCatalystProduct: "PCluster"
423+
Tags:
424+
Name: "PCluster"
425+
RLCatalystProduct: "PCluster"
312426

313427
##############
314428
# PIPELINE
@@ -344,6 +458,22 @@ Resources:
344458
Name: "RL_RG_RStudio"
345459
ResourceType: "RLCatalyst-Research-Gateway"
346460

461+
PClusterImagePipeline:
462+
Type: "AWS::ImageBuilder::ImagePipeline"
463+
Properties:
464+
Name: !Sub "${AWS::StackName}-Pipeline_PCluster"
465+
Description: "Pipeline to build PCluster AMI for RLCatalyst Research Gateway"
466+
ImageRecipeArn: !Ref PClusterImageRecipe
467+
InfrastructureConfigurationArn: !Ref PClusterInfraConfig
468+
DistributionConfigurationArn: !Ref PClusterDistributionConfiguration
469+
ImageTestsConfiguration:
470+
ImageTestsEnabled: false
471+
TimeoutMinutes: 90
472+
Status: "ENABLED"
473+
Tags:
474+
Name: "RL_RG_PCluster"
475+
ResourceType: "RLCatalyst-Research-Gateway"
476+
347477
Outputs:
348478
NextflowAdvancedImagePipeline:
349479
Description: Nextflow_Advanced Image Builder Pipeline
@@ -355,3 +485,8 @@ Outputs:
355485
Value: !Ref RStudioImagePipeline
356486
Export:
357487
Name: !Sub "${AWS::StackName}-RStudioPipelineName"
488+
PClusterImagePipeline:
489+
Description: PCluster Image Builder Pipeline
490+
Value: !Ref PClusterImagePipeline
491+
Export:
492+
Name: !Sub "${AWS::StackName}-PClusterPipelineName"

0 commit comments

Comments
 (0)