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(glue-alpha): add job run queuing to Glue job #31830

Merged

Conversation

jdebuseamazon
Copy link
Contributor

Issue # (if applicable)

Closes #31826

Reason for this change

Job within @aws-cdk/aws-glue-alpha does not currently include the jobRunQueuingEnabled property of the CfnJob within aws-cdk-lib/aws-glue. Setting this property currently requires a raw override.

Description of changes

Added jobRunQueuingEnabled to construction properties for Job, along with validation that this is not enabled when execution class is flexible and/or maxRetries exceeds zero (see).

Description of how you validated changes

Unit tests and an integration test.

Checklist


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 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Oct 21, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team October 21, 2024 09:37
@github-actions github-actions bot added feature-request A feature should be added or improved. p2 labels Oct 21, 2024
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.

@jdebuseamazon jdebuseamazon changed the title feat(aws-glue-alpha): add job run queuing to Glue job feat(glue-alpha): add job run queuing to Glue job Oct 21, 2024
@jdebuseamazon
Copy link
Contributor Author

Exemption Request (for ❌ Features must contain a change to a README file): the change only introduced an optional construction property, and for consistency with existing similar construction properties such as maxCapacity and maxRetries no details were included in the README file

@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Oct 21, 2024
@badmintoncryer
Copy link
Contributor

@jdebuseamazon Thank you for your contribution! I think it would be helpful to add a README description for this feature.

The descriptions for maxCapacity and minCapacity are necessary, but this should not be addressed in this PR.

@aws-cdk-automation aws-cdk-automation dismissed their stale review October 29, 2024 11:54

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

Copy link
Contributor

@badmintoncryer badmintoncryer left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

I would appreciate it if you could provide links regarding the need for a max retry of 0 and the fact that queueing cannot be enabled with the FLEX ExecutionClass.

Comment on lines 811 to 824
describe('enabling job run queuing', () => {
beforeEach(() => {
job = new glue.Job(stack, 'Job', {
...defaultProps,
jobRunQueuingEnabled: true,
});
});

test('should set JobRunQueuingEnabled', () => {
Template.fromStack(stack).hasResourceProperties('AWS::Glue::Job', {
JobRunQueuingEnabled: true,
});
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

This description may be sufficient.

Suggested change
describe('enabling job run queuing', () => {
beforeEach(() => {
job = new glue.Job(stack, 'Job', {
...defaultProps,
jobRunQueuingEnabled: true,
});
});
test('should set JobRunQueuingEnabled', () => {
Template.fromStack(stack).hasResourceProperties('AWS::Glue::Job', {
JobRunQueuingEnabled: true,
});
});
});
test('enabling job run queuing', () => {
job = new glue.Job(stack, 'Job', {
...defaultProps,
jobRunQueuingEnabled: true,
});
Template.fromStack(stack).hasResourceProperties('AWS::Glue::Job', {
JobRunQueuingEnabled: true,
});
});

Comment on lines 1207 to 1208
describe('validation for jobRunQueuingEnabled and maxRetries', () => {
test('jobRunQueuingEnabled with maxRetries > 0 should throw', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

If there is only one test within a describe block, I think a single test block is sufficient.

@@ -743,6 +756,10 @@ export class Job extends JobBase {
throw new Error('Both workerType and workerCount must be set');
}

if (props.jobRunQueuingEnabled === true && props.maxRetries !== undefined && props.maxRetries > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add condition !Token.isUnresolved(props.maxRetries) to the if statement.

This will enable support when maxRetries is token.

Suggested change
if (props.jobRunQueuingEnabled === true && props.maxRetries !== undefined && props.maxRetries > 0) {
if (props.jobRunQueuingEnabled === true && props.maxRetries !== undefined && Token.isUnresolved(props.maxRetries) && props.maxRetries > 0) {

@jdebuseamazon
Copy link
Contributor Author

Thank you for your contribution!

I would appreciate it if you could provide links regarding the need for a max retry of 0 and the fact that queueing cannot be enabled with the FLEX ExecutionClass.

No problem at all, very happy to contribute, and many thanks for reviewing. The restrictions on max retry and FLEX execution class are documented here (in the Considerations section)

@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 Oct 30, 2024
Copy link
Contributor

@badmintoncryer badmintoncryer left a comment

Choose a reason for hiding this comment

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

Thank you for the fix! The documentation you provided was also very helpful.

By merging updated base branch as needed, the "needs-maintainer-review" label will be applied. After that, please wait for the maintainer's review😁

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

@paulhcsun paulhcsun 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 the contribution @jdebuseamazon! And thank you for helping to review @badmintoncryer!

@paulhcsun
Copy link
Contributor

@Mergifyio update

Copy link
Contributor

mergify bot commented Nov 4, 2024

update

☑️ Nothing to do

  • #commits-behind > 0 [📌 update requirement]
  • -closed [📌 update requirement]
  • -conflict [📌 update requirement]
  • queue-position = -1 [📌 update requirement]

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 55a91a1
  • 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 Nov 4, 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 5fca268 into aws:main Nov 4, 2024
14 checks passed
Copy link

github-actions bot commented Nov 4, 2024

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK feature-request A feature should be added or improved. p2 pr/needs-maintainer-review This PR needs a review from a Core Team Member pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-glue-alpha): (add jobRunQueuingEnabled to Job)
4 participants