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

feat(batch): add fargate Runtime Platform properties to ECS Fargate C… #28841

Merged
merged 13 commits into from
Jan 30, 2024

Conversation

xazhao
Copy link
Contributor

@xazhao xazhao commented Jan 24, 2024

The property RuntimePlatform is not present in the AWS Batch ECS Fargate Job Definition. This PR adds flatten properties fargateCpuArchitecture and fargateOperatingSystemFamily to the ECS Fargate Job Definition in AWS Batch.

Closes #26484.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 labels Jan 24, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team January 24, 2024 17:42
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jan 24, 2024
@xazhao xazhao marked this pull request as ready for review January 24, 2024 17:54
@xazhao xazhao marked this pull request as draft January 24, 2024 19:43
@xazhao xazhao marked this pull request as ready for review January 25, 2024 15:28
Copy link
Contributor

@jfuss jfuss left a comment

Choose a reason for hiding this comment

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

All comments are mostly for my understanding of the change. Otherwise, seems like a straight forward change.

@@ -1616,7 +1620,7 @@
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-batch-alpha.EcsJobDefinition",
"fqn": "aws-cdk-lib.aws_batch.EcsJobDefinition",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know why this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The last change of this file was to stabilizing (convert alpha to regular module). So the snapshot would be before stabilizing which was still using aws-batch-alpha

/**
* The vCPU architecture of Fargate Runtime.
*
* @default - X86_64
Copy link
Contributor

Choose a reason for hiding this comment

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

For my own understanding, why set defaults for this and fargateOperatingSystemFamily?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is the default value should be same as the default value in CFN resource.

Comment on lines +63 to +64
fargateCpuArchitecture: ecs.CpuArchitecture.ARM64,
fargateOperatingSystemFamily: ecs.OperatingSystemFamily.LINUX,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it guaranteed that the batch EcsFaragetContainerDefintion will always match ecs? I am wondering if there is a case where ECS needs some update and then batch needs to follow. Meaning there would be a time where batch doesn't support all types ECS supports.

I might be looking at this in the wrong way or have an miss understanding on how things connect together within CDK.

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 saw it was already using enum values from ECS definition so I didn't really think about it... Looking at the current values they're the same but I'm not sure if that's guaranteed or it's documented somewhere.
If we can generate all these values from the schema in the future, then we can be confident about the values here.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 25, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 1f1b6a0
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Jan 30, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit ac8251f into aws:main Jan 30, 2024
10 checks passed
SankyRed pushed a commit that referenced this pull request Feb 8, 2024
#28841)

The property [RuntimePlatform](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-containerproperties.html#cfn-batch-jobdefinition-containerproperties-runtimeplatform) is not present in the AWS Batch ECS Fargate Job Definition. This PR adds flatten properties fargateCpuArchitecture and fargateOperatingSystemFamily to the ECS Fargate Job Definition in AWS Batch.

Closes #26484.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 pr/needs-maintainer-review This PR needs a review from a Core Team Member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-batch-alpha): Construct Props RuntimePlatform
4 participants