-
Notifications
You must be signed in to change notification settings - Fork 812
99 lines (86 loc) · 2.92 KB
/
Copy pathcall-e2e.yaml
File metadata and controls
99 lines (86 loc) · 2.92 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Call e2e test
on:
workflow_call:
inputs:
ref:
description: 'Reference id to run tests'
required: true
type: string
type:
description: 'E2E type'
required: true
type: string
default: pullrequest
permissions:
contents: read
jobs:
e2e-test:
strategy:
matrix:
include:
- device: nvidia
type: tesla-p4
# - device: nvidia
# type: rtx-4090
# - device: huawei
# type: ascend-910b3
runs-on: [ "${{ matrix.device }}", "${{ matrix.type }}" ]
environment: ${{ matrix.device }}
env:
E2E_TYPE: ${{ inputs.type }}
HAMI_VERSION: ${{ inputs.ref }}
steps:
- name: checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Acquire shared e2e runner lock
run: bash hack/e2e-runner-lock.sh acquire
- name: install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod
- name: setup e2e env
run: |
make e2e-env-setup
- name: download hami helm
if: inputs.type == 'pullrequest'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: chart_package_artifact
path: charts/
- name: download hami image
if: inputs.type == 'pullrequest'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: hami-image
path: ./image
- name: load e2e image
if: inputs.type == 'pullrequest'
run: |
echo "Loading Docker image from image.tar..."
# Import directly into the k8s.io containerd namespace so kubelet can use it
# without pulling from the registry.
sudo ctr -n k8s.io images import ./image/image.tar
sudo ctr -n k8s.io images ls | grep hami
- name: deploy hami helm
run: |
make helm-deploy
- name: e2e test
run: |
make e2e-test
- name: cleanup e2e env
if: always()
run: |
echo "Cleaning up HAMi deployment..."
helm uninstall hami -n hami-system --kubeconfig "${KUBE_CONF:-${HOME}/.kube/config}" 2>/dev/null || true
kubectl wait --for=delete pod --all -n hami-system \
--timeout=120s --kubeconfig "${KUBE_CONF:-${HOME}/.kube/config}" 2>/dev/null || true
kubectl annotate node --all \
hami.io/mutex.lock- hami.io/node-handshake- \
hami.io/node-nvidia-register- hami.io/nvidia-license- \
--kubeconfig "${KUBE_CONF:-${HOME}/.kube/config}" 2>/dev/null || true
echo "Cleanup done."
- name: Release shared e2e runner lock
if: always()
run: bash hack/e2e-runner-lock.sh release