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): jobStateTimeLimitActions property added #30158

Merged
merged 24 commits into from May 17, 2024

Conversation

mazyu36
Copy link
Contributor

@mazyu36 mazyu36 commented May 12, 2024

Issue # (if applicable)

Closes #30142 .

Reason for this change

Missing property in the L2 Construct.

Description of changes

Add jobStateTimeLimitActions property to the JobQueue Construct.

Description of how you validated changes

Add unit tests and integ tests.

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team May 12, 2024 01:18
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels May 12, 2024
@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 May 12, 2024
* The action to take when a job is at the head of the job queue in the specified state
* for the specified period of time.
*/
readonly action: JobStateTimeLimitActionsAction;
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be better to make action optional and set the default value to JobStateTimeLimitActionsAction.CANCEL, since that is the only value we can configure at the moment.

Copy link
Contributor Author

@mazyu36 mazyu36 May 12, 2024

Choose a reason for hiding this comment

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

Thank you for your comment.
I think your suggestion is better.

I have changed action to be optional and set its default value to JobStateTimeLimitActionsAction.CANCEL.

/**
* The state of the job needed to trigger the action.
*/
readonly state: JobStateTimeLimitActionsState;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is similar comment above, it may be better to make state optional and set default value to JobStateTimeLimitActionsState.RUNNABLE.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks.

I have changed state to be optional and set its default value to JobStateTimeLimitActionsState.RUNNABLE.

@badmintoncryer
Copy link
Contributor

I am not a reviewer, but I have provided some comments for your reference.

Copy link
Contributor

@go-to-k go-to-k 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 this PR.
Sorry for the many comments, but I commented as much as I could see.
I may make additional comments if anything else comes up.

packages/aws-cdk-lib/aws-batch/README.md Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-batch/lib/job-queue.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-batch/lib/job-queue.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-batch/lib/job-queue.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-batch/lib/job-queue.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-batch/lib/job-queue.ts Outdated Show resolved Hide resolved
* The reason to log for the action being taken.
* @see https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#job_stuck_in_runnable
*/
export enum JobStateTimeLimitActionsReason {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we add the MISCONFIGURATION:SERVICE_ROLE_PERMISSIONS?

Copy link
Contributor Author

@mazyu36 mazyu36 May 15, 2024

Choose a reason for hiding this comment

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

It seems that the MISCONFIGURATION:SERVICE_ROLE_PERMISSIONS is not supported at the moment.

I tried to set that via CDK and CLI, but I can't.

I checked in the management console as well, but it seems that only three other options are available for configuration.

image

image

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, nice catch.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you also add a new test for the case where the array is empty?

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 a test case for an empty array.

packages/aws-cdk-lib/aws-batch/README.md Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-batch/lib/job-queue.ts Outdated Show resolved Hide resolved
@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 May 15, 2024
mazyu36 and others added 11 commits May 16, 2024 00:22
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
mazyu36 and others added 5 commits May 16, 2024 00:26
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
@mazyu36
Copy link
Contributor Author

mazyu36 commented May 15, 2024

@go-to-k
Thank you for the review. I apologize for the numerous formatting issues in the document.
I have addressed all of your comments.

Copy link
Contributor

@go-to-k go-to-k 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 changes, LGTM.

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

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

Minor comments

@mazyu36
Copy link
Contributor Author

mazyu36 commented May 17, 2024

@GavinZZ
Thank you for the review !
I have responded to all of your questions.

@github-actions github-actions bot added bug This issue is a bug. feature-request A feature should be added or improved. and removed feature-request A feature should be added or improved. bug This issue is a bug. labels May 17, 2024
Copy link
Contributor

mergify bot commented May 17, 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).

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

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 9a4b045
  • 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 411a58c into aws:main May 17, 2024
12 checks passed
Copy link
Contributor

mergify bot commented May 17, 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).

@mazyu36 mazyu36 deleted the batch-jobstatelimitactions-30142 branch May 18, 2024 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(batch): missing JobStateTimeLimitActions in the JobQueue Construct
5 participants