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-alpha): add RuntimePlatform prop #26506

Closed

Conversation

khushail
Copy link
Contributor

@khushail khushail commented Jul 26, 2023

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 the p2 label Jul 26, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team July 26, 2023 00:32
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@khushail khushail changed the title (aws-batch-alpha): Construct Props RuntimePlatform feat(aws-batch-alpha): add RuntimePlatform prop Jul 26, 2023
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@khushail khushail changed the title feat(aws-batch-alpha): add RuntimePlatform prop feat(batch-alpha): add RuntimePlatform prop Aug 15, 2023
pahud
pahud previously requested changes Aug 15, 2023
if (props.runtimePlatform) {
this.runtimePlatform = props.runtimePlatform;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should modify the _renderContainerDefinition() function to add the new runtimePlatform property like

runtimePlatform: this.runtimePlatform

So it will synth a new container definition for ContainerProperties

@pahud
Copy link
Contributor

pahud commented Aug 15, 2023

OK looks like the RuntimePlatform support was just added into cloudformation in Aug 2023
image

AWS CDK at this moment uses CFN spec 130.1.0 which does not include this property yet.

cfnspec 130.1.0 was PR merged on July 14
#26362

The latest CFN spec is 135.0.0 which DOES have runtimePlatform property.
https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json

We will need to wait another PR from the core team to support 135.0.0 or above before we are allowed to continue this PR.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

6 similar comments
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@pahud
Copy link
Contributor

pahud commented Aug 25, 2023

I was wrong. CDK now uses awscdk-service-spec as the source of the truth for the L1 and the latest definition can be found here:
https://github.com/cdklabs/awscdk-service-spec/blob/main/sources/CloudFormationSchema/us-east-1/aws-batch-jobdefinition.json

And I can confirm ContainerProperties.RuntimePlatform is already in the definition so I think it should be available in the L1 props.

    "ContainerProperties" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "User" : {
          "type" : "string"
        },
        "Secrets" : {
          "type" : "array",
          "uniqueItems" : false,
          "items" : {
            "$ref" : "#/definitions/Secret"
          }
        },
        "Memory" : {
          "type" : "integer"
        },
        "Privileged" : {
          "type" : "boolean"
        },
        "LinuxParameters" : {
          "$ref" : "#/definitions/LinuxParameters"
        },
        "FargatePlatformConfiguration" : {
          "$ref" : "#/definitions/FargatePlatformConfiguration"
        },
        "JobRoleArn" : {
          "type" : "string"
        },
        "ReadonlyRootFilesystem" : {
          "type" : "boolean"
        },
        "Vcpus" : {
          "type" : "integer"
        },
        "Image" : {
          "type" : "string"
        },
        "ResourceRequirements" : {
          "type" : "array",
          "uniqueItems" : false,
          "items" : {
            "$ref" : "#/definitions/ResourceRequirement"
          }
        },
        "LogConfiguration" : {
          "$ref" : "#/definitions/LogConfiguration"
        },
        "MountPoints" : {
          "type" : "array",
          "uniqueItems" : false,
          "items" : {
            "$ref" : "#/definitions/MountPoints"
          }
        },
        "ExecutionRoleArn" : {
          "type" : "string"
        },
        "RuntimePlatform" : {
          "$ref" : "#/definitions/RuntimePlatform"
        },

@khushail khushail changed the title feat(batch-alpha): add RuntimePlatform prop chore(batch-alpha): add RuntimePlatform prop Aug 25, 2023
@khushail khushail marked this pull request as ready for review August 25, 2023 19:45
@aws-cdk-automation aws-cdk-automation dismissed their stale review August 25, 2023 19:47

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@mergify mergify bot dismissed pahud’s stale review August 25, 2023 21:23

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 579cfe2
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

*
* A runtimePlatform is supported only for tasks using the Fargate launch type.
*
* @default - Undefined.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't write "undefined". We all know that the JavaScript value of a missing variable is undefined.

Describe what the behavior is if the value is left undefined.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this property need to be on the interface? IEcsContainerDefinition ?

It only needs to be here if downstream consumers of this class need to make decisions based on runtimePlatform. If so, it also needs to be added to EcsContainerDefinition.fromContainerDefinitionAttributes().

*
* A runtimePlatform is supported only for tasks using the Fargate launch type.
*
* @default - Undefined.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same.

@@ -643,6 +667,10 @@ abstract class EcsContainerDefinitionBase extends Construct implements IEcsConta
logConfiguration: this.logDriverConfig,
readonlyRootFilesystem: this.readonlyRootFilesystem,
resourceRequirements: this._renderResourceRequirements(),
runtimePlatform: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make it so the entire subobject is not rendered if this.runtimePlatform is undefined, otherwise this will lead to unnecessary changes to existing templates.

*
* @default - Undefined.
*/
readonly runtimePlatform?: RuntimePlatform;
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of having this subproperty, how about we inline the 2 fields from RuntimePlatform here? It will be easier to work with for users.

Prefer flat properties, CDK Design Guidelines, section Props.

@rix0rrr
Copy link
Contributor

rix0rrr commented Aug 29, 2023

Also this is not a chore, feat or fix are better choices.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

1 similar comment
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@gmarchand
Copy link

Hello @pahud, Sorry I can not help you on this one, I don't have the skills to contribute. But the need is always here.

@mrgrain
Copy link
Contributor

mrgrain commented Sep 11, 2023

@comcalvi FYI

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

3 similar comments
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@khushail khushail marked this pull request as draft September 15, 2023 23:07
@aws-cdk-automation
Copy link
Collaborator

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label Sep 16, 2023
@khushail khushail changed the title chore(batch-alpha): add RuntimePlatform prop feat(batch-alpha): add RuntimePlatform prop Sep 26, 2023
@khushail khushail reopened this Sep 26, 2023
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@aws-cdk-automation
Copy link
Collaborator

The pull request linter fails with the following errors:

❌ Features must contain a change to a README file.
❌ Features must contain a change to an integration test file and the resulting snapshot.

PRs must pass status checks before we can provide a meaningful review.

If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing Exemption Request and/or Clarification Request.

@aws-cdk-automation
Copy link
Collaborator

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants