job_test.yaml 1.72 KB
Newer Older
raojy's avatar
raojy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
suite: test job
templates:
  - job.yaml
tests:
  - it: should create job when modelDownload is enabled
    set:
      extraInit:
        modelDownload:
          enabled: true
          image:
            repository: "amazon/aws-cli"
            tag: "2.6.4"
            pullPolicy: "IfNotPresent"
          waitContainer:
            command: [ "/bin/bash" ]
            args: [ "-c", "wait" ]
          downloadJob:
            command: [ "/bin/bash" ]
            args:
              - "-eucx"
              - "aws --endpoint-url $S3_ENDPOINT_URL s3 sync s3://$S3_BUCKET_NAME/$S3_PATH /data"
        pvcStorage: "1Gi"
        s3modelpath: "relative_s3_model_path/opt-125m"
        awsEc2MetadataDisabled: true
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: Job
      - equal:
          path: spec.template.spec.containers[0].name
          value: job-download-model
      - equal:
          path: spec.template.spec.containers[0].image
          value: amazon/aws-cli:2.6.4
      - equal:
          path: spec.template.spec.restartPolicy
          value: OnFailure

  - it: should not create job when modelDownload is disabled
    set:
      extraInit:
        modelDownload:
          enabled: false
          image:
            repository: "amazon/aws-cli"
            tag: "2.6.4"
            pullPolicy: "IfNotPresent"
          waitContainer:
            command: [ "/bin/bash" ]
            args: [ "-c", "wait" ]
          downloadJob:
            command: [ "/bin/bash" ]
            args: [ "-c", "download" ]
        initContainers:
          - name: llm-d-routing-proxy
            image: ghcr.io/llm-d/llm-d-routing-sidecar:v0.2.0
        pvcStorage: "10Gi"
    asserts:
      - hasDocuments:
          count: 0