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

(aws-batch): Unable to Specify Mount point and Volume in CDK for Batch Job #26622

Closed
navneethc opened this issue Aug 3, 2023 · 6 comments
Closed
Labels
@aws-cdk/aws-batch Related to AWS Batch bug This issue is a bug. 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.

Comments

@navneethc
Copy link

Describe the bug

I have a working StepFunction that calls a couple of Batch jobs. These were configured using the console. I'm trying to automate the deployment of the workflow using CDK (TypeScript). I am unable to find the options to specify the mount points and volume configuration that's found in the console.

Specifically, if you are looking at the console and setting up an EC2-based job definition:
Linux and logging settings > Filesystem configuration > Additional configuration > Volumes configuration, and similarly, next to it Mount points configuration.

I am trying to do this with both aws-cdk-lib/aws-batch and @aws-cdk/aws-batch-alpha (v2.89.0), but I can't find the right properties to specify.

The Batch job is EC2-based and will run a container using a previously defined computer environments. The EBS storage cannot be restricted to 30 GB.

Expected Behavior

I can't find the appropriate classes to use in the documentation. I'm not sure if it's unimplemented or undocumented.

Current Behavior

Batch job cannot be created without these options.

Reproduction Steps

NA

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.79.0

Framework Version

No response

Node.js Version

16.20.1

OS

Ubuntu

Language

Typescript

Language Version

4.9.5

Other information

No response

@navneethc navneethc added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 3, 2023
@github-actions github-actions bot added the @aws-cdk/aws-batch Related to AWS Batch label Aug 3, 2023
@peterwoodworth
Copy link
Contributor

You should be able to provide volumes to our ECS Container constructs, such as here.

If you want to drop to the L1s, you will want to configure the JobDefinition.containerProperties

Do either of these help your use case?

@peterwoodworth peterwoodworth added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Aug 3, 2023
@navneethc
Copy link
Author

You should be able to provide volumes to our ECS Container constructs, such as here.

If you want to drop to the L1s, you will want to configure the JobDefinition.containerProperties

Do either of these help your use case?

Thanks for the reply. This is the relevant bit of the stack I have already created:

import * as batch from '@aws-cdk/aws-batch-alpha';

const jobdef = new batch.EcsJobDefinition(this, 'job-def-name',{
  jobDefinitionName: 'fooname',
  timeout: cdk.Duration.hours(#),
  container = new batch.EcsEc2ContainerDefinition(this, 'container-name', {
    image: fooImage,
    jobRole: batchRole,
    command: [foo, bar, baz],
    memory: cdk.Size.mebibytes(####)
    cpu: #,
    logging: ecs.LogDriver.awslogs,
  })
})

I'm not quite sure which properties I should use to specify the mount points and volume. I see the volume property, but when I follow the links, the example provided is for EFS.

@peterwoodworth
Copy link
Contributor

Volume prop takes in an array of EcsVolumes. You should be able to use EcsVolume.host()

@peterwoodworth peterwoodworth added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Aug 3, 2023
@github-actions
Copy link

github-actions bot commented Aug 6, 2023

This issue 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 Aug 6, 2023
@navneethc
Copy link
Author

Volume prop takes in an array of EcsVolumes. You should be able to use EcsVolume.host()

This is exactly what I was looking for. Thank you.

@github-actions
Copy link

github-actions bot commented Aug 7, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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 bug This issue is a bug. 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.
Projects
None yet
Development

No branches or pull requests

2 participants