This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
forked from sustainable-computing-io/kepler
-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (102 loc) · 3.16 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
name: Integration test
on:
workflow_call:
env:
OUTPUT_DIR: "_output/"
FILE_NAME: "kepler.tar.gz"
ARTIFACT_DIR: "/tmp/artifacts"
jobs:
build-kepler:
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: build and export Kepler image
run: |
make build_containerized
make save-image
env:
IMAGE_REPO: "localhost:5001"
IMAGE_TAG: "devel"
IMAGE_NAME: "kepler"
CTR_CMD: docker
IMAGE_OUTPUT_PATH: ${{env.OUTPUT_DIR}}${{env.FILE_NAME}}
- name: save Kepler image as artifact
uses: actions/upload-artifact@v3
with:
name: kepler
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:
needs: [build-kepler]
runs-on: ubuntu-latest
strategy:
matrix:
cluster_provider: [kind,microshift]
steps:
- name: checkout source
uses: actions/checkout@v4
- name: download Kepler image artifact
uses: actions/download-artifact@v3
with:
name: kepler
- name: build manifest
run: make build-manifest OPTS="CI_DEPLOY"
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}
IMAGE_REPO: "localhost:5001"
IMAGE_TAG: "devel"
CTR_CMD: docker
- name: import Kepler image
run: make load-image
env:
IMAGE_REPO: "localhost:5001"
IMAGE_NAME: "kepler"
IMAGE_TAG: "devel"
CTR_CMD: docker
INPUT_PATH: ${{env.FILE_NAME}}
- name: use Kepler action to deploy cluster
uses: sustainable-computing-io/[email protected]
with:
cluster_provider: ${{matrix.cluster_provider}}
local_dev_cluster_version: v0.0.3
- 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"
CTR_CMD: docker
- name: deploy Kepler on cluster
run: make cluster-deploy
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}
IMAGE_REPO: "localhost:5001"
IMAGE_TAG: "devel"
CTR_CMD: docker
- name: Save artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ${{env.ARTIFACT_DIR}}
retention-days: 10
- name: run e2e tests
run: make e2e
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}
kepler_address: localhost:9102
- name: undeploy Kepler and cleanup the cluster
run: |
make cluster-clean
make cluster-down
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}