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
203 lines (179 loc) · 5.93 KB
/
platform-validation.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: Platform Validation
on:
workflow_dispatch:
env:
OUTPUT_DIR: "_output/"
KEPLER_FILE_NAME: "kepler.tar.gz"
VALIDATOR_FILE_NAME: "validator.tar.gz"
ARTIFACT_DIR: "/tmp/artifacts"
jobs:
build-artifacts:
runs-on: [self-hosted, linux, x64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Quay
uses: docker/login-action@v1
with:
registry: quay.io/sustainable_computing_io
username: ${{ secrets.BOT_NAME }}
password: ${{ secrets.BOT_TOKEN }}
- name: Install Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: Build and export Kepler image with test specific tag
run: |
make build_containerized
make save-image
env:
IMAGE_REPO: "localhost:5001"
IMAGE_NAME: "kepler"
IMAGE_TAG: "platform-validation"
CTR_CMD: docker
IMAGE_OUTPUT_PATH: ${{env.OUTPUT_DIR}}${{env.KEPLER_FILE_NAME}}
- name: Save Kepler image as artifact
uses: actions/upload-artifact@v3
with:
name: kepler
path: ${{env.OUTPUT_DIR}}${{env.KEPLER_FILE_NAME}}
retention-days: 1
- name: Build and push kepler-validator to official group repo with latest tag
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
push: true
tags: quay.io/sustainable_computing_io/kepler-validator:latest
labels: latest
file: build/Dockerfile.kepler-validator
- name: Build and export kepler-validator image with test specific tag
run: |
make build-validation-container
make save-image
env:
IMAGE_REPO: "localhost:5001"
IMAGE_NAME: "kepler-validator"
IMAGE_TAG: "x86-rapl"
CTR_CMD: docker
IMAGE_OUTPUT_PATH: ${{env.OUTPUT_DIR}}${{env.VALIDATOR_FILE_NAME}}
- name: Save kepler-validator test image as artifact
uses: actions/upload-artifact@v3
with:
name: validator
path: ${{env.OUTPUT_DIR}}${{env.VALIDATOR_FILE_NAME}}
retention-days: 1
platform_validation_test:
needs: [build-artifacts]
runs-on: [self-hosted, linux, x64]
strategy:
matrix:
cluster_provider: [kind]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Kepler test image artifact
uses: actions/download-artifact@v3
with:
name: kepler
- name: Download kepler-validator test image artifact
uses: actions/download-artifact@v3
with:
name: validator
- name: Build manifest
run: make build-manifest OPTS="CI_DEPLOY PROMETHEUS_DEPLOY"
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}
IMAGE_REPO: "localhost:5001"
IMAGE_TAG: "platform-validation"
CTR_CMD: docker
- name: Import Kepler test image
run: make load-image
env:
IMAGE_REPO: "localhost:5001"
IMAGE_NAME: "kepler"
IMAGE_TAG: "platform-validation"
CTR_CMD: docker
INPUT_PATH: ${{env.KEPLER_FILE_NAME}}
- name: Import kepler-validator test image
run: make load-image
env:
IMAGE_REPO: "localhost:5001"
IMAGE_NAME: "kepler-validator"
IMAGE_TAG: "x86-rapl"
CTR_CMD: docker
INPUT_PATH: ${{env.VALIDATOR_FILE_NAME}}
- name: Get Node component power before deploy kind cluster
run: |
make get-power
env:
IMAGE_REPO: "localhost:5001"
IMAGE_NAME: "kepler-validator"
IMAGE_TAG: "x86-rapl"
CTR_CMD: docker
- 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
prometheus_enable: true
grafana_enable: true
- name: Push Kepler test image to local registry
run: |
make push-image
env:
IMAGE_REPO: "localhost:5001"
IMAGE_NAME: "kepler"
IMAGE_TAG: "platform-validation"
CTR_CMD: docker
- name: Push kepler-validator test image to local registry
run: |
make push-image
make image-prune
env:
IMAGE_REPO: "localhost:5001"
IMAGE_NAME: "kepler-validator"
IMAGE_TAG: "x86-rapl"
CTR_CMD: docker
- name: Get Node component power before deploy kepler
run: |
make get-power
env:
IMAGE_REPO: "localhost:5001"
IMAGE_NAME: "kepler-validator"
IMAGE_TAG: "x86-rapl"
CTR_CMD: docker
- name: Deploy Kepler on cluster
run: make cluster-deploy
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}
IMAGE_REPO: "localhost:5001"
IMAGE_TAG: "platform-validation"
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 platform validation test cases
run: make platform-validation
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}
IMAGE_REPO: "localhost:5001"
IMAGE_NAME: "kepler-validator"
IMAGE_TAG: "x86-rapl"
CTR_CMD: docker
kepler_address: localhost:9102
prometheus_address: localhost:9090
- name: Undeploy Kepler and cleanup the cluster
run: |
make cluster-clean
make cluster-down
env:
CLUSTER_PROVIDER: ${{matrix.cluster_provider}}