Feature Request: cdk construct for parallel cluster
- Dominant language
- Python
- Stars
- 888
- Forks
- 314
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 43
Description
Now that parallel cluster supports CloudFormation custom resource, was wondering if you can officially support cdk deployment of parallel clusters. As a quick poc, deploying the custom resource and then paralell cluster works in principal (python cdk below)
```
class CustomResourceProvider(Stack):
ServiceToken=None
def __init__(self, scope: Construct, construct_id: str, env , params, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
#cloudfomation for custom resource provider
PC_CF_CRP="https://" + env.region +"-aws-parallelcluster.s3." + env.region + ".amazonaws.com/parallelcluster/" + params['PC_VERSION'] + "/templates/custom_resource/cluster.yaml"
#deploy cfn_stack for custom resource provider
cfn_stack=cdk.CfnStack(self, "ParallelClusterCustomResourceProvider",
template_url=PC_CF_CRP)
output=cdk.CfnOutput( self, "ServiceToken",
value=cfn_stack.get_att("Outputs.ServiceToken").to_string())
self.ServiceToken=cfn_stack.get_att("Outputs.ServiceToken").to_string()
class ParallelCluster(Stack):
def __init__(self, scope: Construct, construct_id: str, env , params, ServiceToken, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
# now lets provision a cluster thrugh the deployed custom resource provider
###this needs to be parameterized by environment
CLUSTER_CONFIG = yaml.safe_load(open("deployment_v2/config-file.yaml", 'r'))
print ("ServiceToken: " + ServiceToken)
CustomResource(self, "PclusterClusterSERGEY",
resource_type="Custom::PclusterCluster",
service_token=ServiceToken,
properties={
'ClusterName': 'SERGEY',
'ClusterConfiguration': CLUSTER_CONFIG
}
)
```
Contributor guide
Assessment
This issue has not been assessed yet.