sync-lora-job.yaml 1.25 KB
Newer Older
1
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# SPDX-License-Identifier: Apache-2.0
apiVersion: batch/v1
kind: Job
metadata:
  name: sync-hf-lora-to-minio
spec:
  template:
    spec:
      containers:
      - name: uploader
        image: python:3.10-slim
        command:
        - /bin/sh
        - -c
        - |
          set -eux
18
          pip install --no-cache-dir huggingface-hub==1.11.0 awscli==1.44.80
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
          hf download  $MODEL_NAME --local-dir /tmp/lora
          rm -rf /tmp/lora/.cache
          aws --endpoint-url=http://minio:9000 s3 mb s3://$LORA_ROOT_PATH || true
          aws --endpoint-url=http://minio:9000 s3 sync /tmp/lora s3://$LORA_ROOT_PATH/$MODEL_NAME
        envFrom:
        - secretRef:
            name: hf-token-secret
        - secretRef:
            name: minio-secret
        env:
        - name: AWS_REGION   # set this to your aws region
          value: us-east-1
        - name: AWS_ALLOW_HTTP # remove/disable this if you are using a S3 endpoint or secure MinIO
          value: "true"
        - name: LORA_ROOT_PATH
          value: "my-loras"
        - name: MODEL_NAME
          value: codelion/Qwen3-0.6B-accuracy-recovery-lora
      restartPolicy: Never
38
  backoffLimit: 3