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(stepfunctions-tasks): EMR createCluster command support OnDemandSpecification #27791

Merged
merged 30 commits into from
Dec 21, 2023

Conversation

go-to-k
Copy link
Contributor

@go-to-k go-to-k commented Nov 1, 2023

This PR supports OnDemandSpecification in instance fleets for EMR createCluster.

Closes #27761.


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/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Nov 1, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team November 1, 2023 11:49
@github-actions github-actions bot added the star-contributor [Pilot] contributed between 25-49 PRs to the CDK label Nov 1, 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 aws-cdk-automation dismissed their stale review November 2, 2023 09:12

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

@go-to-k go-to-k marked this pull request as ready for review November 2, 2023 09:26
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 2, 2023
@go-to-k
Copy link
Contributor Author

go-to-k commented Nov 2, 2023

This PR adds the integ tests for On-Demand only.

There is no integ test for Spot, but I added it in another PR.

#27809

Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks!
The implementation looks correct.
Some adjustments are needed on the interface declaration in my opinion.

* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-emr-instancefleetconfig-ondemandprovisioningspecification.html
*
*/
export interface OnDemandProvisioningSpecificationProperty {
Copy link
Contributor

Choose a reason for hiding this comment

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

This interface declaration is missing the CapacityReservationOptions attribute.

Copy link
Contributor Author

@go-to-k go-to-k Nov 2, 2023

Choose a reason for hiding this comment

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

@lpizzinidev

I originally added it because it was in the API reference, but the CloudFormation document apparently does not support it, so I deleted it.

c0caee8#diff-f0a4ce25fba5b6013a9e99af978fe476abb485cdd149be1d30f20d7bd4f70591

Is this necessary?
In my opinion, it should follow CloudFormation, so I didn't think it was necessary to add it.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-emr-instancefleetconfig-ondemandprovisioningspecification.html

JSON

{
  "AllocationStrategy" : String
}

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, CFN is the right reference in this case.
Thanks for clarifying.

Comment on lines 640 to 644
* Currently, the only option is lowest-price (the default), which launches the lowest price first.
*
* @default - lowest-price
*/
readonly allocationStrategy?: OnDemandAllocationStrategy;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Currently, the only option is lowest-price (the default), which launches the lowest price first.
*
* @default - lowest-price
*/
readonly allocationStrategy?: OnDemandAllocationStrategy;
* Currently, the only option is lowest-price (the default), which launches the lowest price first.
*/
readonly allocationStrategy: OnDemandAllocationStrategy;

The property is required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I had been changed it to be possible for undefined because a default value is defined, but it is required according to CFn docs. So I will add!

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 added them.

6510ab0

/**
* The launch specification for Spot instances in the fleet, which determines the defined duration and provisioning timeout behavior.
*
* @default - no spotSpecification
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @default - no spotSpecification
* @default - no spot specification

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 instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions.
* On-Demand Instances allocation strategy is available in Amazon EMR releases 5.12.1 and later.
*
* @default - no onDemandSpecification
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @default - no onDemandSpecification
* @default - no on-demand specification

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 2, 2023
@go-to-k
Copy link
Contributor Author

go-to-k commented Nov 2, 2023

@lpizzinidev

Thanks again!

Please review the following things and changed codes!

#27791 (comment)

#27791 (comment)

Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks 👍

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

This PR has been in the MERGE CONFLICTS 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.

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

@go-to-k thanks for starting this! looks good, just a few minor stylistic comments!

Comment on lines 132 to 133
*
* @param property
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
*
* @param property

*
* @param property
*/
function OnDemandProvisioningSpecificationPropertyToJson(property: EmrCreateCluster.OnDemandProvisioningSpecificationProperty | undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function OnDemandProvisioningSpecificationPropertyToJson(property: EmrCreateCluster.OnDemandProvisioningSpecificationProperty | undefined) {
function OnDemandProvisioningSpecificationPropertyToJson(property?: EmrCreateCluster.OnDemandProvisioningSpecificationProperty) {

Comment on lines 146 to 147
*
* @param property
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
*
* @param property

Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to leave an @param docstring, you have to describe the property like

@param property the spot provisioning specification

(But we don't need to do that here, I dont think)

allocationStrategy: EmrCreateCluster.OnDemandAllocationStrategy.LOWEST_PRICE,
},
},
name: 'Master',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
name: 'Master',
name: 'Main',

(we're avoiding the term master now)

@mergify mergify bot dismissed kaizencc’s stale review December 19, 2023 04:49

Pull request has been modified.

@go-to-k
Copy link
Contributor Author

go-to-k commented Dec 19, 2023

@kaizencc

Thanks for the review!

I fixed, so could you please take a look at them?

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

Thanks for changing the other instances of master to main as well. Appreciate it!

Copy link
Contributor

mergify bot commented Dec 21, 2023

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).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 21, 2023
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@mergify mergify bot merged commit 73a5e74 into aws:main Dec 21, 2023
12 checks passed
Copy link
Contributor

mergify bot commented Dec 21, 2023

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).

paulhcsun pushed a commit to paulhcsun/aws-cdk that referenced this pull request Jan 5, 2024
…Specification (aws#27791)

This PR supports OnDemandSpecification in instance fleets for EMR createCluster.

Closes aws#27761.

----

*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
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 star-contributor [Pilot] contributed between 25-49 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(stepfunctions-tasks): EMR createCluster command support OnDemandSpecification
4 participants