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

batch: Cannot omit the start/end of target node on batch.MultiNodeContainer #29415

Open
2 tasks
jalencato opened this issue Mar 8, 2024 · 1 comment · May be fixed by #29849
Open
2 tasks

batch: Cannot omit the start/end of target node on batch.MultiNodeContainer #29415

jalencato opened this issue Mar 8, 2024 · 1 comment · May be fixed by #29849
Assignees
Labels
@aws-cdk/aws-batch Related to AWS Batch bug This issue is a bug. effort/medium Medium work item – several days of effort p1

Comments

@jalencato
Copy link

Describe the feature

When using CDK to deploy aws batch multi-node jobs, we have to specify both the start_node and end_node, FYI: https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_batch/MultiNodeContainer.html#aws_cdk.aws_batch.MultiNodeContainer. But refer to the https://docs.aws.amazon.com/batch/latest/APIReference/API_NodeRangeProperty.html#API_NodeRangeProperty_Contents, it is possible to omit start_node/end_node here.

Use Case

Our use case is as following: after I deploy the aws batch cloud infrastructure, I can use boto3 with python to submit a job like:

import boto3 

response = batch_client.submit_job(
    jobName=job_name,
    jobQueue=job_queue,
    jobDefinition=multi_job_definition,
    parameters=job_parameters,
    nodeOverrides={
        "numNodes": overridden_num_nodes,
    },
)

Currently It will throw error like:

botocore.errorfactory.ClientException: An error occurred (ClientException) when calling the SubmitJob operation: NumNodes override can only be applied if the job definition has at least 1 target node without a range_end i.e (:) or (range_start:).

This is because in CDK we have to specify the start_node and end_node. But if we support to omit the end_node in CDK, we can avoid this problem. And this is valid according to the aws batch multi-node job definition. Currently the only work around is to create another job_definition based on what we deploy and modify the target node in the batch console.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.131.0

Environment details (OS name and version, etc.)

Amazon Linux 2

@jalencato jalencato added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 8, 2024
@github-actions github-actions bot added the @aws-cdk/aws-batch Related to AWS Batch label Mar 8, 2024
@pahud
Copy link
Contributor

pahud commented Mar 11, 2024

https://docs.aws.amazon.com/batch/latest/APIReference/API_NodeRangeProperty.html#API_NodeRangeProperty_Contents, it is possible to omit start_node/end_node here.

Yes looks like the ending node index can be omitted. I guess we need a PR to get it fixed.

@pahud pahud added p1 bug This issue is a bug. effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. feature-request A feature should be added or improved. labels Mar 11, 2024
@pahud pahud changed the title (aws-batch): Cannot omit the start/end of target node on batch.MultiNodeContainer batch: Cannot omit the start/end of target node on batch.MultiNodeContainer Mar 11, 2024
@shikha372 shikha372 self-assigned this Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-batch Related to AWS Batch bug This issue is a bug. effort/medium Medium work item – several days of effort p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants