-
Notifications
You must be signed in to change notification settings - Fork 191
123 lines (110 loc) · 3.38 KB
/
integration_test.yml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Integration test
on: # yamllint disable-line rule:truthy
workflow_call:
env:
OUTPUT_DIR: _output/
FILE_NAME: kepler_libbpf.tar.gz
ARTIFACT_DIR: /tmp/artifacts
jobs:
build-kepler:
runs-on: ubuntu-latest
env:
CTR_CMD: docker
steps:
# checkout source code
- name: checkout source
uses: actions/checkout@v4
# set up golang
- name: install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# build kepler image
- name: build and export Kepler image
run: |
make build_image
make save-image
env:
IMAGE_REPO: localhost:5001
IMAGE_NAME: kepler
IMAGE_TAG: devel
IMAGE_OUTPUT_PATH: ${{env.OUTPUT_DIR}}${{env.FILE_NAME}}
# save kepler image
- name: save Kepler image as artifact
uses: actions/upload-artifact@v4.6.0
with:
name: keplerlibbpf
path: ${{env.OUTPUT_DIR}}${{env.FILE_NAME}}
retention-days: 1
# ref https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
# as PR or Push event, we don't keep artifact in 90 days hence use 1 day here to save resources.
integration_test_with_libbpf:
needs: [build-kepler]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cluster_provider: [kind]
env:
CTR_CMD: docker
steps:
- name: checkout source
uses: actions/checkout@v4
- name: download Kepler image artifact
uses: actions/download-artifact@v4
with:
name: keplerlibbpf
- name: Install all tools
uses: ./.github/tools-cache
- name: build manifest
run: make build-manifest OPTS="CI_DEPLOY DEBUG_DEPLOY"
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}
IMAGE_REPO: localhost:5001
IMAGE_TAG: devel
- name: import Kepler image
run: make load-image
env:
IMAGE_REPO: localhost:5001
IMAGE_NAME: kepler
IMAGE_TAG: devel
INPUT_PATH: ${{env.FILE_NAME}}
# set up k8s cluster with ebpf
- name: use Kepler action to deploy cluster
uses: sustainable-computing-io/kepler-action@v0.0.7
with:
ebpfprovider: libbpf
cluster_provider: ${{matrix.cluster_provider}}
local_dev_cluster_version: v0.0.5
- name: push Kepler image to local registry
run: |
make push-image
make image-prune
env:
IMAGE_REPO: localhost:5001
IMAGE_NAME: kepler
IMAGE_TAG: devel
- name: deploy Kepler on cluster
run: make cluster-deploy
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}
NO_BUILDS: true
KUBECONFIG: /tmp/kubeconfig
- name: Save artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4.6.0
with:
name: artifacts
path: ${{env.ARTIFACT_DIR}}
retention-days: 10
- name: run e2e tests
run: make e2e
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}
KUBECONFIG: /tmp/kubeconfig
- name: undeploy Kepler and cleanup the cluster
run: |
make cluster-clean
make cluster-down
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}