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

Feature Request: cdk construct for parallel cluster #5541

Open
snemir2 opened this issue Jul 31, 2023 · 6 comments
Open

Feature Request: cdk construct for parallel cluster #5541

snemir2 opened this issue Jul 31, 2023 · 6 comments

Comments

@snemir2
Copy link

snemir2 commented Jul 31, 2023

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
                
            }
                
        )
@chenwany
Copy link
Contributor

Hello! Thank you for the feature request!
Could you elaborate a bit more to help me to understand the request? Do you mean adding official support for ParallelCluster deployment with cdk by introducing ParallelCluster construct in aws-construct-library: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html

Thanks

@snemir2
Copy link
Author

snemir2 commented Aug 11, 2023

The goal is to easily provision clusters with CDK with the rest of the infra.

@chenwany
Copy link
Contributor

Thanks, I tracked this into our backlog

@rvencu
Copy link

rvencu commented Sep 16, 2023

Hi, I am also keen to get this feature so I can convert my current convoluted solution to a more elegant one

@aws aws deleted a comment from snemir2 Sep 18, 2023
@tcutts
Copy link

tcutts commented Jan 15, 2024

I'd like to see ParallelCluster formally supported by CDK too - wondering whether the feature request really needs to be with CDK rather than ParallelCluster though?

@pradoz
Copy link

pradoz commented Jun 10, 2024

I would find this enhancement useful as well. Ideally, the configuration file would be abstracted into parameters to allow cluster management directly from CDK

@chenwany Where can one view where this landed in the backlog?

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

No branches or pull requests

6 participants