4.4. JobSet Operator를 사용하여 워크로드 관리


OpenShift Container Platform에서 JobSet Operator를 사용하여 HPC(고성능 컴퓨팅) 및 AI 교육과 같은 대규모 조정된 워크로드를 관리하고 실행합니다. 다중 템플릿 작업 지원 및 안정적인 네트워킹과 같은 기능을 통해 신속하게 복구하고 리소스를 효율적으로 사용할 수 있습니다.

4.4.1. JobSet 배포

JobSet Operator를 사용하여 JobSet을 배포하여 대규모의 조정된 워크로드를 관리하고 실행할 수 있습니다.

사전 요구 사항

  • JobSet Operator를 설치했습니다.
  • 사용 가능한 NVIDIA GPU가 있는 클러스터가 있어야 합니다.

프로세스

  1. 다음 명령을 실행하여 새 프로젝트를 만듭니다.

    $ oc new-project <my_namespace>
  2. jobset.yaml 이라는 파일을 생성합니다.

    apiVersion: jobset.x-k8s.io/v1alpha2
    kind: JobSet
    metadata:
      name: pytorch
    spec:
      replicatedJobs:
      - name: workers
        template:
          spec:
            parallelism: <pods_running_number>
            completions: <pods_finish_number>
            backoffLimit: 0
            template:
              spec:
                imagePullSecrets:
                  - name: my-registry-secret
                initContainers:
                  - name: prepare
                    image: docker.io/alpine/git:v2.52.0
                    args: ['clone', 'https://github.com/pytorch/examples']
                    volumeMounts:
                      - name: workdir
                        mountPath: /git
                containers:
                  - name: pytorch
                    image: docker.io/pytorch/pytorch:2.10.0-cuda13.0-cudnn9-runtime
                    resources:
                      limits:
                        nvidia.com/gpu: "1"
                      requests:
                        nvidia.com/gpu: "1"
                    ports:
                    - containerPort: 4321
                    env:
                    - name: MASTER_ADDR
                      value: "pytorch-workers-0-0.pytorch"
                    - name: MASTER_PORT
                      value: "4321"
                    - name: RANK
                      valueFrom:
                        fieldRef:
                          fieldPath: metadata.annotations['batch.kubernetes.io/job-completion-index']
                    - name: PYTHONUNBUFFERED
                      value: "0"
                    command:
                    - /bin/sh
                    - -c
                    - |
                      cd examples/distributed/ddp-tutorial-series
                      torchrun --nproc_per_node=1 --nnodes=3 --rdzv_id=100 --rdzv_backend=c10d --rdzv_endpoint=$MASTER_ADDR:$MASTER_PORT multinode.py 1000 100
                    volumeMounts:
                      - name: workdir
                        mountPath: /workspace
                volumes:
                  - name: workdir
                    emptyDir: {}

    다음과 같습니다.

    <pods_running_number>
    동시에 실행되는 Pod 수를 지정합니다.
    <pods_finish_number>
    작업을 완료하려면 성공적으로 완료해야 하는 총 Pod 수를 지정합니다.
  3. 다음 명령을 실행하여 JobSet 구성을 적용합니다.

    $ oc apply -f jobset.yaml

검증

  • 다음 명령을 실행하여 Pod가 시작되었는지 확인합니다.

    $ oc get pods -n <my_namespace>

    출력 예

    NAME                        READY   STATUS    RESTARTS   AGE
    pytorch-workers-0-0-2lzwt   1/1     Running   0          2m17s
    pytorch-workers-0-1-g2lrv   1/1     Running   0          2m17s
    pytorch-workers-0-2-dpljq   1/1     Running   0          2m17s

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동