This documentation references Amazon ParallelCluster. For running HPC and AI workloads, we recommend Amazon Parallel Computing Service (Amazon PCS)
Configuration settings to define actions and arguments
The following configuration settings are used to define HeadNode / CustomActions / OnNodeStart & OnNodeConfigured & OnNodeUpdated and Scheduling / CustomActions / OnNodeStart & OnNodeConfigured actions and arguments.
HeadNode: [...] CustomActions: OnNodeStart: # Script URL. This is run before any of the bootstrap scripts are run Script: s3://amzn-s3-demo-bucket/on-node-start.shArgs: - arg1 OnNodeConfigured: # Script URL. This is run after all the bootstrap scripts are run Script: s3://amzn-s3-demo-bucket/on-node-configured.shArgs: - arg1 OnNodeUpdated: # Script URL. This is run after the head node update is completed. Script: s3://amzn-s3-demo-bucket/on-node-updated.shArgs: - arg1 # Bucket permissions Iam: S3Access: - BucketName:bucket_nameEnableWriteAccess: false Scheduling: Scheduler: slurm [...] SlurmQueues: - Name: queue1 [...] CustomActions: OnNodeStart: Script: s3://amzn-s3-demo-bucket/on-node-start.shArgs: - arg1 OnNodeConfigured: Script: s3://amzn-s3-demo-bucket/on-node-configured.shArgs: - arg1 Iam: S3Access: - BucketName:bucket_nameEnableWriteAccess: false
Using the Sequence setting (added in Amazon ParallelCluster version 3.6.0):
HeadNode: [...] CustomActions: OnNodeStart: # Script URLs. The scripts are run in the same order as listed in the configuration, before any of the bootstrap scripts are run. Sequence: - Script: s3://amzn-s3-demo-bucket/on-node-start1.shArgs: - arg1 - Script: s3://amzn-s3-demo-bucket/on-node-start2.shArgs: - arg1 [...] OnNodeConfigured: # Script URLs. The scripts are run in the same order as listed in the configuration, after all the bootstrap scripts are run. Sequence: - Script: s3://amzn-s3-demo-bucket/on-node-configured1.shArgs: - arg1 - Script: s3://amzn-s3-demo-bucket/on-node-configured2.shArgs: - arg1 [...] OnNodeUpdated: # Script URLs. The scripts are run in the same order as listed in the configuration, after the head node update is completed. Sequence: - Script: s3://amzn-s3-demo-bucket/on-node-updated1.shArgs: - arg1 - Script: s3://amzn-s3-demo-bucket/on-node-updated2.shArgs: - arg1 [...] # Bucket permissions Iam: S3Access: - BucketName:bucket_nameEnableWriteAccess: false Scheduling: Scheduler: slurm [...] SlurmQueues: - Name: queue1 [...] CustomActions: OnNodeStart: # Script URLs. The scripts are run in the same order as listed in the configuration, before any of the bootstrap scripts are run Sequence: - Script: s3://amzn-s3-demo-bucket/on-node-start1.shArgs: - arg1 - Script: s3://amzn-s3-demo-bucket/on-node-start2.shArgs: - arg1 [...] OnNodeConfigured: # Script URLs. The scripts are run in the same order as listed in the configuration, after all the bootstrap scripts are run Sequence: - Script: s3://amzn-s3-demo-bucket/on-node-configured1.shArgs: - arg1 - Script: s3://amzn-s3-demo-bucket/on-node-configured2.shArgs: - arg1 [...] Iam: S3Access: - BucketName:bucket_nameEnableWriteAccess: false
The Sequence setting is added starting with Amazon ParallelCluster version 3.6.0.
When you specify Sequence, you can list multiple scripts for a custom action.
Amazon ParallelCluster continues to support configuring a custom action with a single script,
without including Sequence.
Amazon ParallelCluster doesn't support including both a single script and Sequence
for the same custom action. For example, Amazon ParallelCluster fails if you specify the following
configuration.
[...] CustomActions: OnNodeStart: # Script URL. This is run before any of the bootstrap scripts are run Script: s3://amzn-s3-demo-bucket/on-node-start.shArgs: - arg1 # Script URLs. The scripts are run in the same order as listed in the configuration, before any of the bootstrap scripts are run. Sequence: - Script: s3://amzn-s3-demo-bucket/on-node-start1.shArgs: - arg1 - Script: s3://amzn-s3-demo-bucket/on-node-start2.shArgs: - arg1 [...]