public static final class JobDefinitionContainer.Builder
extends java.lang.Object
JobDefinitionContainer
Constructor and Description |
---|
Builder() |
public JobDefinitionContainer.Builder image(ContainerImage image)
JobDefinitionContainer.getImage()
image
- The image used to start a container. This parameter is required.this
public JobDefinitionContainer.Builder assignPublicIp(java.lang.Boolean assignPublicIp)
JobDefinitionContainer.getAssignPublicIp()
assignPublicIp
- Whether or not to assign a public IP to the job.this
public JobDefinitionContainer.Builder command(java.util.List<java.lang.String> command)
JobDefinitionContainer.getCommand()
command
- The command that is passed to the container.
If you provide a shell command as a single string, you have to quote command-line arguments.this
public JobDefinitionContainer.Builder environment(java.util.Map<java.lang.String,java.lang.String> environment)
JobDefinitionContainer.getEnvironment()
environment
- The environment variables to pass to the container.this
public JobDefinitionContainer.Builder executionRole(IRole executionRole)
JobDefinitionContainer.getExecutionRole()
executionRole
- The IAM role that AWS Batch can assume.
Required when using Fargate.this
public JobDefinitionContainer.Builder gpuCount(java.lang.Number gpuCount)
JobDefinitionContainer.getGpuCount()
gpuCount
- The number of physical GPUs to reserve for the container.
The number of GPUs reserved for all
containers in a job should not exceed the number of available GPUs on the compute resource that the job is launched on.this
public JobDefinitionContainer.Builder instanceType(InstanceType instanceType)
JobDefinitionContainer.getInstanceType()
instanceType
- The instance type to use for a multi-node parallel job.
Currently all node groups in a
multi-node parallel job must use the same instance type. This parameter is not valid
for single-node container jobs.this
public JobDefinitionContainer.Builder jobRole(IRole jobRole)
JobDefinitionContainer.getJobRole()
jobRole
- The IAM role that the container can assume for AWS permissions.this
public JobDefinitionContainer.Builder linuxParams(LinuxParameters linuxParams)
JobDefinitionContainer.getLinuxParams()
linuxParams
- Linux-specific modifications that are applied to the container, such as details for device mappings.
For now, only the devices
property is supported.this
public JobDefinitionContainer.Builder logConfiguration(LogConfiguration logConfiguration)
JobDefinitionContainer.getLogConfiguration()
logConfiguration
- The log configuration specification for the container.this
public JobDefinitionContainer.Builder memoryLimitMiB(java.lang.Number memoryLimitMiB)
JobDefinitionContainer.getMemoryLimitMiB()
memoryLimitMiB
- The hard limit (in MiB) of memory to present to the container.
If your container attempts to exceed
the memory specified here, the container is killed. You must specify at least 4 MiB of memory for EC2 and 512 MiB for Fargate.this
public JobDefinitionContainer.Builder mountPoints(java.util.List<? extends MountPoint> mountPoints)
JobDefinitionContainer.getMountPoints()
mountPoints
- The mount points for data volumes in your container.this
public JobDefinitionContainer.Builder platformVersion(FargatePlatformVersion platformVersion)
JobDefinitionContainer.getPlatformVersion()
platformVersion
- Fargate platform version.this
public JobDefinitionContainer.Builder privileged(java.lang.Boolean privileged)
JobDefinitionContainer.getPrivileged()
privileged
- When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).this
public JobDefinitionContainer.Builder readOnly(java.lang.Boolean readOnly)
JobDefinitionContainer.getReadOnly()
readOnly
- When this parameter is true, the container is given read-only access to its root file system.this
public JobDefinitionContainer.Builder ulimits(java.util.List<? extends Ulimit> ulimits)
JobDefinitionContainer.getUlimits()
ulimits
- A list of ulimits to set in the container.this
public JobDefinitionContainer.Builder user(java.lang.String user)
JobDefinitionContainer.getUser()
user
- The user name to use inside the container.this
public JobDefinitionContainer.Builder vcpus(java.lang.Number vcpus)
JobDefinitionContainer.getVcpus()
vcpus
- The number of vCPUs reserved for the container.
Each vCPU is equivalent to
1,024 CPU shares. You must specify at least one vCPU for EC2 and 0.25 for Fargate.this
public JobDefinitionContainer.Builder volumes(java.util.List<? extends Volume> volumes)
JobDefinitionContainer.getVolumes()
volumes
- A list of data volumes used in a job.this
public JobDefinitionContainer build()
JobDefinitionContainer
java.lang.NullPointerException
- if any required attribute was not provided