Skip to content

Commit 22e766b

Browse files
authored
Check architecture of ComputeNodeAmi (#142)
It needs to match the architecture of the cluster. Resolves #141
1 parent 6b6b48c commit 22e766b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/cdk/cdk_slurm_stack.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3570,6 +3570,16 @@ def create_parallel_cluster_config(self):
35703570
PARALLEL_CLUSTER_SUPPORTS_MULTIPLE_COMPUTE_RESOURCES_PER_QUEUE = True
35713571
PARALLEL_CLUSTER_SUPPORTS_MULTIPLE_INSTANCE_TYPES_PER_COMPUTE_RESOURCE = True
35723572

3573+
# Check the architecture of the ComputeNodeAmi
3574+
if 'ComputeNodeAmi' in self.config['slurm']['ParallelClusterConfig']:
3575+
compute_node_ami = self.config['slurm']['ParallelClusterConfig']['ComputeNodeAmi']
3576+
ami_info = self.ec2_client.describe_images(ImageIds=[compute_node_ami])['Images'][0]
3577+
ami_architecture = ami_info['Architecture']
3578+
cluster_architecture = self.config['slurm']['ParallelClusterConfig']['Architecture']
3579+
if ami_architecture != cluster_architecture:
3580+
logger.error(f"Config slurm/ParallelClusterConfig/ComputeNodeAmi({compute_node_ami}) architecture=={ami_architecture}. Must be the same as slurm/ParallelClusterConfig/Architecture({cluster_architecture})")
3581+
exit(1)
3582+
35733583
self.parallel_cluster_config = {
35743584
'HeadNode': {
35753585
'Dcv': {

0 commit comments

Comments
 (0)