使用创建作业定义 ContainerProperties - Amazon Batch
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

使用创建作业定义 ContainerProperties

以下是包含单个容器的空作业定义模板。您可以使用此模板来创建作业定义,然后将其保存到文件中并与 Amazon CLI --cli-input-json选项一起使用。有关这些参数的更多信息,请参阅 的 Job 定义参数 ContainerProperties

{ "jobDefinitionName": "", "type": "container", "parameters": { "KeyName": "" }, "schedulingPriority": 0, "containerProperties": { "image": "", "vcpus": 0, "memory": 0, "command": [ "" ], "jobRoleArn": "", "executionRoleArn": "", "volumes": [ { "host": { "sourcePath": "" }, "name": "", "efsVolumeConfiguration": { "fileSystemId": "", "rootDirectory": "", "transitEncryption": "ENABLED", "transitEncryptionPort": 0, "authorizationConfig": { "accessPointId": "", "iam": "DISABLED" } } } ], "environment": [ { "name": "", "value": "" } ], "mountPoints": [ { "containerPath": "", "readOnly": true, "sourceVolume": "" } ], "readonlyRootFilesystem": true, "privileged": true, "ulimits": [ { "hardLimit": 0, "name": "", "softLimit": 0 } ], "user": "", "instanceType": "", "resourceRequirements": [ { "value": "", "type": "MEMORY" } ], "linuxParameters": { "devices": [ { "hostPath": "", "containerPath": "", "permissions": [ "WRITE" ] } ], "initProcessEnabled": true, "sharedMemorySize": 0, "tmpfs": [ { "containerPath": "", "size": 0, "mountOptions": [ "" ] } ], "maxSwap": 0, "swappiness": 0 }, "logConfiguration": { "logDriver": "syslog", "options": { "KeyName": "" }, "secretOptions": [ { "name": "", "valueFrom": "" } ] }, "secrets": [ { "name": "", "valueFrom": "" } ], "networkConfiguration": { "assignPublicIp": "DISABLED" }, "fargatePlatformConfiguration": { "platformVersion": "" } }, "nodeProperties": { "numNodes": 0, "mainNode": 0, "nodeRangeProperties": [ { "targetNodes": "", "container": { "image": "", "vcpus": 0, "memory": 0, "command": [ "" ], "jobRoleArn": "", "executionRoleArn": "", "volumes": [ { "host": { "sourcePath": "" }, "name": "", "efsVolumeConfiguration": { "fileSystemId": "", "rootDirectory": "", "transitEncryption": "DISABLED", "transitEncryptionPort": 0, "authorizationConfig": { "accessPointId": "", "iam": "ENABLED" } } } ], "environment": [ { "name": "", "value": "" } ], "mountPoints": [ { "containerPath": "", "readOnly": true, "sourceVolume": "" } ], "readonlyRootFilesystem": true, "privileged": true, "ulimits": [ { "hardLimit": 0, "name": "", "softLimit": 0 } ], "user": "", "instanceType": "", "resourceRequirements": [ { "value": "", "type": "MEMORY" } ], "linuxParameters": { "devices": [ { "hostPath": "", "containerPath": "", "permissions": [ "WRITE" ] } ], "initProcessEnabled": true, "sharedMemorySize": 0, "tmpfs": [ { "containerPath": "", "size": 0, "mountOptions": [ "" ] } ], "maxSwap": 0, "swappiness": 0 }, "logConfiguration": { "logDriver": "awslogs", "options": { "KeyName": "" }, "secretOptions": [ { "name": "", "valueFrom": "" } ] }, "secrets": [ { "name": "", "valueFrom": "" } ], "networkConfiguration": { "assignPublicIp": "DISABLED" }, "fargatePlatformConfiguration": { "platformVersion": "" } } } ] }, "retryStrategy": { "attempts": 0, "evaluateOnExit": [ { "onStatusReason": "", "onReason": "", "onExitCode": "", "action": "RETRY" } ] }, "propagateTags": true, "timeout": { "attemptDurationSeconds": 0 }, "tags": { "KeyName": "" }, "platformCapabilities": [ "EC2" ], "eksProperties": { "podProperties": { "serviceAccountName": "", "hostNetwork": true, "dnsPolicy": "", "containers": [ { "name": "", "image": "", "imagePullPolicy": "", "command": [ "" ], "args": [ "" ], "env": [ { "name": "", "value": "" } ], "resources": { "limits": { "KeyName": "" }, "requests": { "KeyName": "" } }, "volumeMounts": [ { "name": "", "mountPath": "", "readOnly": true } ], "securityContext": { "runAsUser": 0, "runAsGroup": 0, "privileged": true, "readOnlyRootFilesystem": true, "runAsNonRoot": true } } ], "volumes": [ { "name": "", "hostPath": { "path": "" }, "emptyDir": { "medium": "", "sizeLimit": "" }, "secret": { "secretName": "", "optional": true } } ] } } }
注意

您可以使用以下命令生成单容器作业定义模板: Amazon CLI

$ aws batch register-job-definition --generate-cli-skeleton