

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 의 서비스 작업 페이로드 AWS Batch
<a name="service-job-payload"></a>

[SubmitServiceJob](https://docs.aws.amazon.com/batch/latest/APIReference/API_SubmitServiceJob.html)을 사용하여 서비스 작업을 제출할 때는 작업을 정의하는 두 가지 주요 파라미터인 `serviceJobType`과 `serviceRequestPayload`를 제공합니다.
+ 는 작업을 실행할 AWS 서비스를 `serviceJobType` 지정합니다. SageMaker 훈련 작업의 경우 이 값은 `SAGEMAKER_TRAINING`입니다.
+ `serviceRequestPayload`는 일반적으로 대상 서비스로 직접 전송되는 전체 요청을 포함하는 JSON 인코딩 문자열입니다. SageMaker 훈련 작업의 경우 이 페이로드에는 SageMaker AI [CreateTrainingJob](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html) API와 함께 사용되는 것과 동일한 파라미터가 포함됩니다.

사용 가능한 모든 파라미터의 전체 목록과 해당 설명은 SageMaker AI [CreateTrainingJob](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html) API 레퍼런스를 참조하세요. `CreateTrainingJob`에서 지원하는 모든 파라미터를 서비스 작업 페이로드에 포함할 수 있습니다.

추가 훈련 작업 구성의 예제는 [SageMaker AI 개발자 안내서](https://docs.aws.amazon.com/sagemaker/latest/dg/gs.html)의 [API, CLI 및 SDK](https://docs.aws.amazon.com/sagemaker/latest/dg/api-and-sdk-reference-overview.html)를 참조하세요.

PySDK에는 헬퍼 클래스와 유틸리티가 있으므로 서비스 작업 생성에 PySDK를 사용할 것이 권장됩니다. PySDK 사용에 대한 예제는 GitHub의 [SageMaker AI 예제](https://github.com/aws/amazon-sagemaker-examples)를 참조하세요.

## 서비스 작업 페이로드 예제
<a name="service-job-payload-example"></a>

다음 예제는 'hello world' 훈련 스크립트를 실행하는 SageMaker 훈련 작업에 대한 간단한 서비스 작업 페이로드를 보여줍니다.

이 페이로드는 `SubmitServiceJob`을 호출할 때 `serviceRequestPayload` 파라미터에 JSON 문자열로 전달됩니다.

```
{
  "TrainingJobName": "my-simple-training-job",
  "RoleArn": "arn:aws:iam::123456789012:role/SageMakerExecutionRole",
  "AlgorithmSpecification": {
    "TrainingInputMode": "File",
    "TrainingImage": "763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.0.0-cpu-py310",
    "ContainerEntrypoint": [
      "echo",
      "hello world"
    ]
  },
  "ResourceConfig": {
    "InstanceType": "ml.c5.xlarge",
    "InstanceCount": 1,
    "VolumeSizeInGB": 1
  },
  "OutputDataConfig": {
    "S3OutputPath": "s3://your-output-bucket/output"
  },
  "StoppingCondition": {
    "MaxRuntimeInSeconds": 30
  }
}
```