JobDefinitionContainer

class aws_cdk.aws_batch.JobDefinitionContainer(*, image, command=None, environment=None, gpu_count=None, instance_type=None, job_role=None, linux_params=None, log_configuration=None, memory_limit_mib=None, mount_points=None, privileged=None, read_only=None, ulimits=None, user=None, vcpus=None, volumes=None)

Bases: object

(experimental) Properties of a job definition container.

Parameters
  • image (ContainerImage) – (experimental) The image used to start a container.

  • command (Optional[Sequence[str]]) – (experimental) 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. Default: - CMD value built into container image.

  • environment (Optional[Mapping[str, str]]) – (experimental) The environment variables to pass to the container. Default: none

  • gpu_count (Union[int, float, None]) – (experimental) 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. Default: - No GPU reservation.

  • instance_type (Optional[InstanceType]) – (experimental) 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. Default: - None

  • job_role (Optional[IRole]) – (experimental) The IAM role that the container can assume for AWS permissions. Default: - An IAM role will created.

  • linux_params (Optional[LinuxParameters]) – (experimental) Linux-specific modifications that are applied to the container, such as details for device mappings. For now, only the devices property is supported. Default: - None will be used.

  • log_configuration (Optional[LogConfiguration]) – (experimental) The log configuration specification for the container. Default: - containers use the same logging driver that the Docker daemon uses

  • memory_limit_mib (Union[int, float, None]) – (experimental) 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 a job. Default: 4

  • mount_points (Optional[Sequence[MountPoint]]) – (experimental) The mount points for data volumes in your container. Default: - No mount points will be used.

  • privileged (Optional[bool]) – (experimental) When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user). Default: false

  • read_only (Optional[bool]) – (experimental) When this parameter is true, the container is given read-only access to its root file system. Default: false

  • ulimits (Optional[Sequence[Ulimit]]) – (experimental) A list of ulimits to set in the container. Default: - No limits.

  • user (Optional[str]) – (experimental) The user name to use inside the container. Default: - None will be used.

  • vcpus (Union[int, float, None]) – (experimental) The number of vCPUs reserved for the container. Each vCPU is equivalent to 1,024 CPU shares. You must specify at least one vCPU. Default: 1

  • volumes (Optional[Sequence[Volume]]) – (experimental) A list of data volumes used in a job. Default: - No data volumes will be used.

Stability

experimental

Attributes

command

(experimental) 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.

Default
  • CMD value built into container image.

Stability

experimental

Return type

Optional[List[str]]

environment

(experimental) The environment variables to pass to the container.

Default

none

Stability

experimental

Return type

Optional[Mapping[str, str]]

gpu_count

(experimental) 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.

Default
  • No GPU reservation.

Stability

experimental

Return type

Union[int, float, None]

image

(experimental) The image used to start a container.

Stability

experimental

Return type

ContainerImage

instance_type

(experimental) 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.

Default
  • None

Stability

experimental

Return type

Optional[InstanceType]

job_role

(experimental) The IAM role that the container can assume for AWS permissions.

Default
  • An IAM role will created.

Stability

experimental

Return type

Optional[IRole]

linux_params

(experimental) Linux-specific modifications that are applied to the container, such as details for device mappings.

For now, only the devices property is supported.

Default
  • None will be used.

Stability

experimental

Return type

Optional[LinuxParameters]

log_configuration

(experimental) The log configuration specification for the container.

Default
  • containers use the same logging driver that the Docker daemon uses

Stability

experimental

Return type

Optional[LogConfiguration]

memory_limit_mib

(experimental) 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 a job.

Default

4

Stability

experimental

Return type

Union[int, float, None]

mount_points

(experimental) The mount points for data volumes in your container.

Default
  • No mount points will be used.

Stability

experimental

Return type

Optional[List[MountPoint]]

privileged

(experimental) When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).

Default

false

Stability

experimental

Return type

Optional[bool]

read_only

(experimental) When this parameter is true, the container is given read-only access to its root file system.

Default

false

Stability

experimental

Return type

Optional[bool]

ulimits

(experimental) A list of ulimits to set in the container.

Default
  • No limits.

Stability

experimental

Return type

Optional[List[Ulimit]]

user

(experimental) The user name to use inside the container.

Default
  • None will be used.

Stability

experimental

Return type

Optional[str]

vcpus

(experimental) The number of vCPUs reserved for the container.

Each vCPU is equivalent to 1,024 CPU shares. You must specify at least one vCPU.

Default

1

Stability

experimental

Return type

Union[int, float, None]

volumes

(experimental) A list of data volumes used in a job.

Default
  • No data volumes will be used.

Stability

experimental

Return type

Optional[List[Volume]]