本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
將任務提交至配額共享
配額管理任務佇列要求所有任務在提交任務時指定配額共享。若要將任務提交至配額共享,請在 SubmitServiceJob quotaShareName中指定 。preemptionConfiguration 可以選擇性地提供 ,以限制任務嘗試進入 之前的先佔嘗試次數FAILED。若要限制任務體驗的先佔數量,請在提交任務時於 ServiceJobPreemptionConfiguration preemptionRetriesBeforeTermination中設定 。
使用 提交任務 AWS CLI
下列範例使用 submit-service-job命令將任務提交至配額共享。
aws batch submit-service-job \ --job-name"my-sagemaker-training-job"\ --job-queue"my-sagemaker-job-queue"\ --service-job-type "SAGEMAKER_TRAINING" \ --quota-share-name"my_quota_share"\ --timeout-config '{"attemptDurationSeconds":3600}' \ --scheduling-priority5\ --service-request-payload'{\"TrainingJobName\": \"sagemaker-training-job-example\", \"AlgorithmSpecification\": {\"TrainingImage\": \"123456789012.dkr.ecr.us-east-1.amazonaws.com/pytorch-inference:1.8.0-cpu-py3\", \"TrainingInputMode\": \"File\", \"ContainerEntrypoint\": [\"sleep\", \"1\"]}, \"RoleArn\":\"arn:aws:iam::123456789012:role/SageMakerExecutionRole\", \"OutputDataConfig\": {\"S3OutputPath\": \"s3://example-bucket/model-output/\"}, \"ResourceConfig\": {\"InstanceType\": \"ml.m5.large\", \"InstanceCount\": 1, \"VolumeSizeInGB\": 1}}'"