AWS PCS의 작업 완료 로그 - AWS PCS

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

AWS PCS의 작업 완료 로그

작업 완료 로그는 추가 비용 없이 완료 시 AWS 병렬 컴퓨팅 서비스(AWS PCS) 작업에 대한 주요 세부 정보를 제공합니다. 다른 AWS 서비스를 사용하여 Amazon CloudWatch Logs, Amazon Simple Storage Service(Amazon S3) 및 Amazon Data Firehose와 같은 로그 데이터에 액세스하고 처리할 수 있습니다. AWS PCS는 다음과 같이 작업에 대한 메타데이터를 기록합니다.

  • 작업 ID 및 이름

  • 사용자 및 그룹 정보

  • 작업 상태(예: COMPLETED, FAILED, CANCELLED)

  • 사용된 파티션

  • 시간 제한

  • 시작, 종료, 제출 및 적격 시간

  • 노드 목록 및 개수

  • 프로세서 수

  • 작업 디렉터리

  • 리소스 사용량(CPU, 메모리)

  • 종료 코드

  • 노드 세부 정보(이름, 인스턴스 IDs, 인스턴스 유형)

사전 조건

AWS PCS 클러스터를 관리하는 IAM 보안 주체는 pcs:AllowVendedLogDeliveryForResource 작업을 허용해야 합니다.

다음 예제 IAM 정책은 필요한 권한을 부여합니다.

JSON
{ "Version": "2012-10-17", "Statement": [ { "Sid": "PcsAllowVendedLogsDelivery", "Effect": "Allow", "Action": ["pcs:AllowVendedLogDeliveryForResource"], "Resource": [ "arn:aws:pcs:::cluster/*" ] } ] }

작업 완료 로그 설정

AWS Management Console 또는를 사용하여 AWS PCS 클러스터에 대한 작업 완료 로그를 설정할 수 있습니다 AWS CLI.

AWS Management Console
콘솔을 사용하여 작업 완료 로그를 설정하려면
  1. AWS PCS 콘솔을 엽니다.

  2. 탐색 창에서 클러스터를 선택합니다.

  3. 작업 완료 로그를 추가할 클러스터를 선택합니다.

  4. 클러스터 세부 정보 페이지에서 로그 탭을 선택합니다.

  5. 작업 완료 로그에서 추가를 선택하여 CloudWatch Logs, Amazon S3 및 Firehose 중에서 최대 3개의 로그 전송 대상을 추가합니다. CloudWatch

  6. 로그 전송 업데이트를 선택합니다.

AWS CLI
를 사용하여 작업 완료 로그를 설정하려면 AWS CLI
  1. 로그 전송 대상 생성:

    aws logs put-delivery-destination --region region \ --name pcs-logs-destination \ --delivery-destination-configuration \ destinationResourceArn=resource-arn

    다음과 같이 바꿉니다.

    • region -와 같이 대상을 생성하려는 AWS 리전 입니다. us-east-1

    • pcs-logs-destination - 대상의 이름

    • resource-arn - CloudWatch Logs 로그 그룹, S3 버킷 또는 Firehose 전송 스트림의 Amazon 리소스 이름(ARN)입니다.

    자세한 내용은 Amazon CloudWatch Logs API 참조에 나와 있는 PutDeliveryDestination을 참조하시기 바랍니다.

  2. PCS 클러스터를 로그 전송 소스로 설정합니다.

    aws logs put-delivery-source --region region \ --name cluster-logs-source-name \ --resource-arn cluster-arn \ --log-type PCS_JOBCOMP_LOGS

    다음과 같이 바꿉니다.

    • region -와 같은 클러스터 AWS 리전 의 us-east-1

    • cluster-logs-source-name - 소스의 이름입니다.

    • cluster-arn - AWS PCS 클러스터의 ARN

    자세한 내용은 Amazon CloudWatch Logs API 참조의 PutDeliverySource를 참조하세요. Amazon CloudWatch

  3. 전송 소스를 전송 대상에 연결합니다.

    aws logs create-delivery --region region \ --delivery-source-name cluster-logs-source \ --delivery-destination-arn destination-arn

    다음과 같이 바꿉니다.

    • region - AWS 리전와 같은 us-east-1

    • cluster-logs-source - 전송 소스의 이름입니다.

    • destination-arn - 전송 대상의 ARN입니다.

    자세한 내용은 Amazon CloudWatch Logs API 참조의 CreateDelivery를 참조하세요. Amazon CloudWatch

작업 완료 로그를 찾는 방법

CloudWatch Logs에서 로그 대상을 구성할 수 있으며 Amazon S3. AWS PCS는 다음과 같은 구조화된 경로 이름과 파일 이름을 사용합니다.

CloudWatch Logs

AWS PCS는 CloudWatch Logs 스트림에 다음 이름 형식을 사용합니다.

AWSLogs/PCS/cluster-id/jobcomp.log

예: AWSLogs/PCS/pcs_abc123de45/jobcomp.log

Amazon S3

AWS PCS는 S3 경로에 다음 이름 형식을 사용합니다.

AWSLogs/account-id/PCS/region/cluster-id/jobcomp/year/month/day/hour/

예: AWSLogs/111122223333/PCS/us-east-1/pcs_abc123de45/jobcomp/2025/06/19/11/

AWS PCS는 로그 파일에 다음 이름 형식을 사용합니다.

PCS_jobcomp_year-month-day-hour_cluster-id_random-id.log.gz

예: PCS_jobcomp_2025-06-19-11_pcs_abc123de45_04be080b.log.gz

작업 완료 로그 필드

AWS PCS는 작업 완료 로그 데이터를 JSON 객체로 기록합니다. JSON 컨테이너에는 작업 세부 정보가 jobcomp 들어 있습니다. 다음 표에서는 jobcomp 컨테이너 내부의 필드를 설명합니다. 일부 필드는 배열 작업 또는 이기종 작업과 같은 특정 상황에서만 존재합니다.

작업 완료 로그 필드
명칭 예시 값 필수 Notes
job_id 11 yes 항상 값과 함께 표시
user "root" yes 항상 값과 함께 표시
user_id 0 yes 항상 값과 함께 표시
group "root" yes 항상 값과 함께 표시
group_id 0 yes 항상 값과 함께 표시
name "wrap" yes 항상 값과 함께 표시
job_state "COMPLETED" yes 항상 값과 함께 표시
partition "Hydra-MpiQueue-abcdef01-7" yes 항상 값과 함께 표시
time_limit "UNLIMITED" yes 항상 존재하지만 존재할 수 있음 "UNLIMITED"
start_time "2025-06-19T10:58:57" yes 항상 존재하지만 존재할 수 있음 "Unknown"
end_time "2025-06-19T10:58:57" yes 항상 존재하지만 존재할 수 있음 "Unknown"
node_list "Hydra-MpiNG-abcdef01-2345-1" yes 항상 값과 함께 표시
node_cnt 1 yes 항상 값과 함께 표시
proc_cnt 1 yes 항상 값과 함께 표시
work_dir "/root" yes 항상 존재하지만 존재할 수 있음 "Unknown"
reservation_name "weekly_maintenance" yes 항상 존재하지만 빈 문자열일 수 있음 ""
tres.cpu 1 yes 항상 값과 함께 표시
tres.mem.val 600 yes 항상 값과 함께 표시
tres.mem.unit "M" yes "M" 또는 일 수 있음 "bb"
tres.node 1 yes 항상 값과 함께 표시
tres.billing 1 yes 항상 값과 함께 표시
account "finance" yes 항상 존재하지만 빈 문자열일 수 있음 ""
qos "normal" yes 항상 존재하지만 빈 문자열일 수 있음 ""
wc_key "project_1" yes 항상 존재하지만 빈 문자열일 수 있음 ""
cluster "unknown" yes 항상 존재하지만 존재할 수 있음 "unknown"
submit_time "2025-06-19T10:55:46" yes 항상 존재하지만 존재할 수 있음 "Unknown"
eligible_time "2025-06-19T10:55:46" yes 항상 존재하지만 존재할 수 있음 "Unknown"
array_job_id 12 아니요 작업이 배열 작업인 경우에만 표시됩니다.
array_task_id 1 아니요 작업이 배열 작업인 경우에만 표시됩니다.
het_job_id 10 아니요 작업이 이기종 작업인 경우에만 표시됩니다.
het_job_offset 0 아니요 작업이 이기종 작업인 경우에만 표시됩니다.
derived_exit_code_status 0 yes 항상 값과 함께 표시
derived_exit_code_signal 0 yes 항상 값과 함께 표시
exit_code_status 0 yes 항상 값과 함께 표시
exit_code_signal 0 yes 항상 값과 함께 표시
node_details[0].name "Hydra-MpiNG-abcdef01-2345-1" 아니요 항상 존재하지만 존재할 node_details 수 있음 "[]"
node_details[0].instance_id "i-0abcdef01234567a" 아니요 항상 존재하지만 존재할 node_details 수 있음 "[]"
node_details[0].instance_type "t4g.micro" 아니요 항상 존재하지만 존재할 node_details 수 있음 "[]"

작업 완료 로그 예

다음 예제에서는 다양한 작업 유형 및 상태에 대한 작업 완료 로그를 보여줍니다.

{ "jobcomp": { "job_id": 1, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "COMPLETED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T16:32:57", "end_time": "2025-06-19T16:33:03", "node_list": "Hydra-MpiNG-abcdef01-2345-[1-2]", "node_cnt": 2, "proc_cnt": 2, "work_dir": "/usr/bin", "reservation_name": "", "tres": { "cpu": 2, "mem": { "val": 1944, "unit": "M" }, "node": 2, "billing": 2 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T16:29:40", "eligible_time": "2025-06-19T16:29:41", "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 0, "node_details": [ { "name": "Hydra-MpiNG-abcdef01-2345-1", "instance_id": "i-0abc123def45678", "instance_type": "t4g.micro" }, { "name": "Hydra-MpiNG-abcdef01-2345-2", "instance_id": "i-0def456abc78901", "instance_type": "t4g.micro" } ] } } { "jobcomp": { "job_id": 2, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "COMPLETED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T16:33:13", "end_time": "2025-06-19T16:33:14", "node_list": "Hydra-MpiNG-abcdef01-2345-[1-2]", "node_cnt": 2, "proc_cnt": 2, "work_dir": "/usr/bin", "reservation_name": "", "tres": { "cpu": 2, "mem": { "val": 1944, "unit": "M" }, "node": 2, "billing": 2 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T16:33:13", "eligible_time": "2025-06-19T16:33:13", "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 0, "node_details": [ { "name": "Hydra-MpiNG-abcdef01-2345-1", "instance_id": "i-0abc123def45678", "instance_type": "t4g.micro" }, { "name": "Hydra-MpiNG-abcdef01-2345-2", "instance_id": "i-0def456abc78901", "instance_type": "t4g.micro" } ] } } { "jobcomp": { "job_id": 3, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "COMPLETED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T22:58:57", "end_time": "2025-06-19T22:58:57", "node_list": "Hydra-MpiNG-abcdef01-2345-1", "node_cnt": 1, "proc_cnt": 1, "work_dir": "/root", "reservation_name": "", "tres": { "cpu": 1, "mem": { "val": 972, "unit": "M" }, "node": 1, "billing": 1 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T22:55:46", "eligible_time": "2025-06-19T22:55:46", "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 0, "node_details": [ { "name": "Hydra-MpiNG-abcdef01-2345-1", "instance_id": "i-0abc234def56789", "instance_type": "t4g.micro" } ] } } { "jobcomp": { "job_id": 4, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "COMPLETED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "525600", "start_time": "2025-06-19T23:04:27", "end_time": "2025-06-19T23:04:27", "node_list": "Hydra-MpiNG-abcdef01-2345-[1-2]", "node_cnt": 2, "proc_cnt": 2, "work_dir": "/root", "reservation_name": "", "tres": { "cpu": 2, "mem": { "val": 1944, "unit": "M" }, "node": 2, "billing": 2 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T23:01:38", "eligible_time": "2025-06-19T23:01:38", "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 0, "node_details": [ { "name": "Hydra-MpiNG-abcdef01-2345-1", "instance_id": "i-0abc234def56789", "instance_type": "t4g.micro" }, { "name": "Hydra-MpiNG-abcdef01-2345-2", "instance_id": "i-0def345abc67890", "instance_type": "t4g.micro" } ] } } { "jobcomp": { "job_id": 5, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "FAILED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T23:09:00", "end_time": "2025-06-19T23:09:00", "node_list": "(null)", "node_cnt": 0, "proc_cnt": 0, "work_dir": "/root", "reservation_name": "", "tres": { "cpu": 1, "mem": { "val": 1, "unit": "G" }, "node": 1, "billing": 1 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T23:09:00", "eligible_time": "2025-06-19T23:09:00", "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 1, "node_details": [] } } { "jobcomp": { "job_id": 6, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "CANCELLED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T23:09:36", "end_time": "2025-06-19T23:09:36", "node_list": "(null)", "node_cnt": 0, "proc_cnt": 0, "work_dir": "/root", "reservation_name": "", "tres": { "cpu": 1, "mem": { "val": 400, "unit": "M" }, "node": 1, "billing": 1 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T23:09:35", "eligible_time": "2025-06-19T23:09:36", "het_job_id": 6, "het_job_offset": 0, "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 1, "node_details": [] } } { "jobcomp": { "job_id": 7, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "CANCELLED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T23:10:03", "end_time": "2025-06-19T23:10:03", "node_list": "(null)", "node_cnt": 0, "proc_cnt": 0, "work_dir": "/root", "reservation_name": "", "tres": { "cpu": 1, "mem": { "val": 400, "unit": "M" }, "node": 1, "billing": 1 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T23:10:03", "eligible_time": "2025-06-19T23:10:03", "het_job_id": 7, "het_job_offset": 0, "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 1, "node_details": [] } } { "jobcomp": { "job_id": 8, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "COMPLETED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T23:11:24", "end_time": "2025-06-19T23:11:24", "node_list": "Hydra-MpiNG-abcdef01-2345-1", "node_cnt": 1, "proc_cnt": 1, "work_dir": "/root", "reservation_name": "", "tres": { "cpu": 1, "mem": { "val": 400, "unit": "M" }, "node": 1, "billing": 1 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T23:11:23", "eligible_time": "2025-06-19T23:11:23", "het_job_id": 8, "het_job_offset": 0, "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 0, "node_details": [ { "name": "Hydra-MpiNG-abcdef01-2345-1", "instance_id": "i-0abc234def56789", "instance_type": "t4g.micro" } ] } } { "jobcomp": { "job_id": 9, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "COMPLETED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T23:11:24", "end_time": "2025-06-19T23:11:24", "node_list": "Hydra-MpiNG-abcdef01-2345-2", "node_cnt": 1, "proc_cnt": 1, "work_dir": "/root", "reservation_name": "", "tres": { "cpu": 1, "mem": { "val": 400, "unit": "M" }, "node": 1, "billing": 1 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T23:11:23", "eligible_time": "2025-06-19T23:11:23", "het_job_id": 8, "het_job_offset": 1, "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 0, "node_details": [ { "name": "Hydra-MpiNG-abcdef01-2345-2", "instance_id": "i-0def345abc67890", "instance_type": "t4g.micro" } ] } } { "jobcomp": { "job_id": 10, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "COMPLETED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T23:12:24", "end_time": "2025-06-19T23:12:24", "node_list":"Hydra-MpiNG-abcdef01-2345-1", "node_cnt": 1, "proc_cnt": 1, "work_dir": "/root", "reservation_name": "", "tres": { "cpu": 1, "mem": { "val": 400, "unit": "M" }, "node": 1, "billing": 1 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T23:12:14", "eligible_time": "2025-06-19T23:12:14", "het_job_id": 10, "het_job_offset": 0, "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 0, "node_details": [ { "name": "Hydra-MpiNG-abcdef01-2345-1", "instance_id": "i-0abc234def56789", "instance_type": "t4g.micro" } ] } } { "jobcomp": { "job_id": 11, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "COMPLETED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T23:12:24", "end_time": "2025-06-19T23:12:24", "node_list":"Hydra-MpiNG-abcdef01-2345-2", "node_cnt": 1, "proc_cnt": 1, "work_dir": "/root", "reservation_name": "", "tres": { "cpu": 1, "mem": { "val": 600, "unit": "M" }, "node": 1, "billing": 1 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T23:12:14", "eligible_time": "2025-06-19T23:12:14", "het_job_id": 10, "het_job_offset": 1, "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 0, "node_details": [ { "name": "Hydra-MpiNG-abcdef01-2345-2", "instance_id": "i-0def345abc67890", "instance_type": "t4g.micro" } ] } } { "jobcomp": { "job_id": 13, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "COMPLETED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T23:47:57", "end_time": "2025-06-19T23:47:58", "node_list":"Hydra-MpiNG-abcdef01-2345-1", "node_cnt": 1, "proc_cnt": 1, "work_dir": "/root", "reservation_name": "", "tres": { "cpu": 1, "mem": { "val": 972, "unit": "M" }, "node": 1, "billing": 1 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T23:43:56", "eligible_time": "2025-06-19T23:43:56" , "array_job_id": 12, "array_task_id": 1, "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 0, "node_details": [ { "name": "Hydra-MpiNG-abcdef01-2345-1", "instance_id": "i-0abc345def67890", "instance_type": "t4g.micro" } ] } } { "jobcomp": { "job_id": 12, "user": "root", "user_id": 0, "group": "root", "group_id": 0, "name": "wrap", "job_state": "COMPLETED", "partition": "Hydra-MpiQueue-abcdef01-7", "time_limit": "UNLIMITED", "start_time": "2025-06-19T23:47:58", "end_time": "2025-06-19T23:47:58", "node_list":"Hydra-MpiNG-abcdef01-2345-1", "node_cnt": 1, "proc_cnt": 1, "work_dir": "/root", "reservation_name": "", "tres": { "cpu": 1, "mem": { "val": 972, "unit": "M" }, "node": 1, "billing": 1 }, "account": "", "qos": "", "wc_key": "", "cluster": "unknown", "submit_time": "2025-06-19T23:43:56", "eligible_time": "2025-06-19T23:43:56" , "array_job_id": 12, "array_task_id": 2, "derived_exit_code_status": 0, "derived_exit_code_signal": 0, "exit_code_status": 0, "exit_code_signal": 0, "node_details": [ { "name": "Hydra-MpiNG-abcdef01-2345-1", "instance_id": "i-0abc345def67890", "instance_type": "t4g.micro" } ] } }