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): fargate support for jobs #13591

Closed
wants to merge 1 commit into from

Conversation

kokachev
Copy link
Contributor

Added Fargate support for Batch jobs.

closes: #13590


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

@gitpod-io
Copy link

gitpod-io bot commented Mar 15, 2021

@github-actions github-actions bot added the @aws-cdk/aws-batch Related to AWS Batch label Mar 15, 2021
@kokachev kokachev force-pushed the feature/batch-fargate-support branch from 166c998 to 3c4fd44 Compare March 16, 2021 01:43
@kokachev kokachev force-pushed the feature/batch-fargate-support branch from bef6f46 to f3eadba Compare March 16, 2021 02:45
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: f3eadba
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@iliapolo iliapolo added effort/medium Medium work item – several days of effort p1 labels Mar 20, 2021
@kokachev
Copy link
Contributor Author

kokachev commented Apr 2, 2021

@iliapolo review?

@iliapolo
Copy link
Contributor

iliapolo commented Apr 2, 2021

@iliapolo review?

@kokachev Apologies for the delay. Thanks for creating this PR!

I should be able to get a first round in soon 👍

@kokachev
Copy link
Contributor Author

@iliapolo review?

@kokachev Apologies for the delay. Thanks for creating this PR!

I should be able to get a first round in soon 👍

@iliapolo can someone else review it?

@kokachev
Copy link
Contributor Author

kokachev commented May 6, 2021

@iliapolo should I close this PR?

@iliapolo
Copy link
Contributor

iliapolo commented May 6, 2021

@kokachev No - I still have this on my radar. Would be good if you resolved the conflicts that arose in the meantime though :)

Copy link
Contributor

@iliapolo iliapolo left a comment

Choose a reason for hiding this comment

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

Nice. Very clean and straight forward 👍

```ts
const vpc = new ec2.Vpc(this, 'VPC');

const spotEnvironment = new batch.ComputeEnvironment(stack, 'MyFargateEnvironment', {
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
const spotEnvironment = new batch.ComputeEnvironment(stack, 'MyFargateEnvironment', {
const fargateSpotEnvironment = new batch.ComputeEnvironment(stack, 'MyFargateEnvironment', {

/**
* Resources will be Fargate resources.
*/
FARGATE_SPOT = 'FARGATE_SPOT',
Copy link
Contributor

Choose a reason for hiding this comment

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

What does spot mean in the context of fargate? would be nice to have a sentence or two about it.

@@ -82,6 +82,164 @@ describe('Batch Compute Evironment', () => {
});
});
});
describe('using fargate resources', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@iliapolo iliapolo added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 17, 2021
@github-actions
Copy link

This PR has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label May 18, 2021
@kokachev
Copy link
Contributor Author

will update the PR.

@brendonparker
Copy link

Looking forward to being able to play with this :)

@@ -458,6 +523,9 @@ export class JobDefinition extends Resource implements IJobDefinition {
user: container.user,
vcpus: container.vcpus || 1,
volumes: container.volumes,
fargatePlatformConfiguration: container.fargatePlatformConfiguration ? {

Choose a reason for hiding this comment

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

Sorry, my github-fu is weak. Not sure how to put a comment on code that isn't a part of the PR.

But above, when setting the resourceRequirements, don't we need a way to pass those in for fargate?

resourceRequirements: container.gpuCount
  ? [{ type: 'GPU', value: String(container.gpuCount) }]
  : undefined

Also, pretty sure that vcpus needs to be not set

@peterwoodworth peterwoodworth removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jun 11, 2021
@iliapolo iliapolo added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 20, 2021
@iliapolo iliapolo changed the title feat(aws-batch): fargate support for batch jobs feat(batch): fargate support for batch jobs Jun 20, 2021
@iliapolo iliapolo changed the title feat(batch): fargate support for batch jobs feat(batch): fargate support for jobs Jun 20, 2021
@robertd
Copy link
Contributor

robertd commented Jul 14, 2021

Looking forward to this PR being merged in 👍 ... just in time for what I'm working on. 😄

@DDynamic
Copy link
Contributor

DDynamic commented Aug 2, 2021

@iliapolo @brendonparker since it has been a little while since the author has responded, I've opened PR #15848 that responds to all of the feedback left on this MR in hopes that this will be brought to completion soon. A review as soon as you get a chance would be greatly appreciated.

@robertd
Copy link
Contributor

robertd commented Aug 2, 2021

@DDynamic sweet 👍😊

@iliapolo
Copy link
Contributor

iliapolo commented Aug 2, 2021

Closing in favor of #15848

@iliapolo iliapolo closed this Aug 2, 2021
mergify bot pushed a commit that referenced this pull request Sep 12, 2021
Added Fargate support for Batch jobs.

Note: this is not entirely my work - most of it was done by @kokachev. It is an updated version of Fargate support for batch jobs based on the feedback left in #13591.

- Doc fixes
- Integration test addition
- Network configuration for Fargate
- Support `ResourceRequirements` for Fargate jobs
- Other minor fixes revealed by integration test

closes: #13590, #13591
----

*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
@aws-cdk/aws-batch Related to AWS Batch effort/medium Medium work item – several days of effort p1 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-batch): Fargate support for batch jobs
7 participants