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

Create munge key ssm parameter if it doesn't already exist #22

Conversation

cartalla
Copy link
Contributor

Required by slurm cluster instances to communicate with each other securely.

Resolves bug #21

Description of changes:

Check if the parameter exists.
If not, then generate a munge key and store it in a new ssm parameter.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Required by slurm cluster instances to communicate with each other securely.

Resolves [bug #21](#21)
@cartalla cartalla requested a review from deeppat May 12, 2022 23:16
@cartalla cartalla self-assigned this May 12, 2022
# master_nodes: Defaults to 0
# data_nodes: Must be a multiple of number_of_azs
# ElasticSearch:
# ebs_volume_size: 20
Copy link

Choose a reason for hiding this comment

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

Why remove these commented out lines? Are they never going to be used? I think it's ok to keep them as a way to reference what can be added.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Clean up dead code. They are an artifact from when I didn't have the schema. The options are now documented in the schema file. My intent is to allow people to only specify non-default values to keep the file simple.

Copy link

Choose a reason for hiding this comment

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

Got it..looks good

Copy link

@deeppat deeppat left a comment

Choose a reason for hiding this comment

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

LGTM!

@deeppat deeppat merged commit acff722 into main May 13, 2022
logger.info(f"{self.config['slurm']['MungeKeySsmParameter']} SSM parameter doesn't exist. Creating it so can give IAM permissions to it.")
output = check_output(['dd if=/dev/random bs=1 count=1024 | base64 -w 0'], shell=True, stderr=subprocess.DEVNULL, encoding='utf8', errors='ignore')
munge_key = output.split('\n')[0]
# print(f"output\n{output}")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove commented out code.

@@ -59,7 +59,7 @@
'slurm': {
Optional('SlurmVersion', default='21.08.8'): str,
Optional('ClusterName'): str,
Optional('MungeKeySsmParameter', default='/slurm/munge_key'): str,
Optional('MungeKeySsmParameter', default='/slurm/munge_key'): str, # Will be created if it doesn't exist.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Move comments that were removed from the config to this file.

# ElasticSearch:
# ebs_volume_size: 20
# ebs_volume_type: GP2
# enable_version_upgrade: False
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add the comments into the config schema.

@cartalla cartalla deleted the 21-bug-deployment-fails-if-we-do-not-set-the-mungekeyssmparameter branch May 13, 2022 16:47
cartalla added a commit that referenced this pull request Jul 7, 2022
Add Regions and AZs to the InstanceConfig

The code has been updated support multiple regions.
The instance types that are available and the pricing varies by region so
all instance type info must be maintained by region.

Spot pricing additionally varies by instance type and by AZ and this
commit adds an updated EC2InstanceTypeInfoPkg package that looks up
the spot pricing for each instance type in each AZ and region.

The Region/AZ configuration is added to the InstanceConfig section of the config
file.
The region requires the VpcId, CIDR, and SshKeyPair.
The AZ requires the subnet ID and priority.

The slurm node configuration has been updated to add the AZ id to all compute nodes
and add the AZ name to all partitions.

Users can specify multiple partitions with sbatch if they want jobs to
be spread across multiple AZs.
The modulefile has been updated to set the partition to the list of
all regional/az partitions so that all nodes are available to the jobs
in the priority configured in the config file.

Create compute node security groups for other regions using a custom resource.
Save regional security group ids in ssm parameter store.

Update multi-region route53 hosted zone

Fix IAM permissions to handle multiple regions

Decode iam permissions messsages

Update security groups with remote region cidrs

Create slurmfs ARecord for use in other regions.
This required adding a lambda to do DNS lookups.

Add custom resource to add regional VPCs to the Route53 hosted zone.
This is required for now because of a CDK bug:

aws/aws-cdk#20496

The PR for the above bug is:

aws/aws-cdk#20530

Update github-pages to use mkdocs
Add github-docs target to Makefile

Update to cdk@2.28.1

Create AZ and interactive partitions, set default partitions

Resolves [FEATURE #22: Support mutiple availability zones and regions](#2)
cartalla added a commit that referenced this pull request Jul 9, 2022
* Add multi-AZ and multi-region support

Add Regions and AZs to the InstanceConfig

The code has been updated support multiple regions.
The instance types that are available and the pricing varies by region so
all instance type info must be maintained by region.

Spot pricing additionally varies by instance type and by AZ and this
commit adds an updated EC2InstanceTypeInfoPkg package that looks up
the spot pricing for each instance type in each AZ and region.

The Region/AZ configuration is added to the InstanceConfig section of the config
file.
The region requires the VpcId, CIDR, and SshKeyPair.
The AZ requires the subnet ID and priority.

The slurm node configuration has been updated to add the AZ id to all compute nodes
and add the AZ name to all partitions.

Users can specify multiple partitions with sbatch if they want jobs to
be spread across multiple AZs.
The modulefile has been updated to set the partition to the list of
all regional/az partitions so that all nodes are available to the jobs
in the priority configured in the config file.

Create compute node security groups for other regions using a custom resource.
Save regional security group ids in ssm parameter store.

Update multi-region route53 hosted zone

Fix IAM permissions to handle multiple regions

Decode iam permissions messsages

Update security groups with remote region cidrs

Create slurmfs ARecord for use in other regions.
This required adding a lambda to do DNS lookups.

Add custom resource to add regional VPCs to the Route53 hosted zone.
This is required for now because of a CDK bug:

aws/aws-cdk#20496

The PR for the above bug is:

aws/aws-cdk#20530

Update github-pages to use mkdocs
Add github-docs target to Makefile

Update to cdk@2.28.1

Create AZ and interactive partitions, set default partitions

Resolves [FEATURE #22: Support mutiple availability zones and regions](#2)

* Review fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Deployment fails if we do not set the MungeKeySsmParameter
2 participants