Skip to content

Commit b427d6a

Browse files
committed
CI:update integration test with deployment check and push action enhancement
Signed-off-by: Sam Yuan <[email protected]>
1 parent fc425e9 commit b427d6a

File tree

4 files changed

+46
-23
lines changed

4 files changed

+46
-23
lines changed

.github/workflows/image-base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'base'
77

88
jobs:
9-
docker:
9+
baseimagebuild:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout

.github/workflows/image.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: image
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
image_build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
- name: Login to Quay
14+
uses: docker/login-action@v1
15+
with:
16+
registry: quay.io/sustainable_computing_io
17+
username: ${{ secrets.BOT_NAME }}
18+
password: ${{ secrets.BOT_TOKEN }}
19+
- name: make container
20+
run: make
21+
- name: push to quay
22+
run: podman push quay.io/sustainable_computing_io/kepler:latest

.github/workflows/integration_test.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Integration test
22

33
on:
44
pull_request:
5-
push:
6-
branches: [ main ]
75

86
jobs:
97
integration_test:
@@ -32,19 +30,3 @@ jobs:
3230
env:
3331
CLUSTER_PROVIDER: ${{matrix.kube_provider}}
3432
CTR_CMD: docker
35-
36-
- name: Login to Quay
37-
if: github.event_name == 'push'
38-
uses: docker/login-action@v1
39-
with:
40-
registry: quay.io/sustainable_computing_io
41-
username: ${{ secrets.BOT_NAME }}
42-
password: ${{ secrets.BOT_TOKEN }}
43-
44-
- name: make container
45-
if: github.event_name == 'push'
46-
run: make
47-
48-
- name: push to quay
49-
if: github.event_name == 'push'
50-
run: podman push quay.io/sustainable_computing_io/kepler:latest

hack/cluster-deploy.sh

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,29 @@ function main() {
3131

3232
# Ignore errors because some clusters might not have prometheus operator
3333
kubectl apply -f ${MANIFESTS_OUT_DIR} || true
34-
kubectl rollout status daemonset kepler-exporter -n kepler --timeout 60s
35-
36-
echo "Check the logs of the kepler-exporter with:"
37-
echo "kubectl -n kepler logs daemonset.apps/kepler-exporter"
34+
35+
# round for 3 times and each for 60s
36+
# check if the rollout status is running
37+
deploy_status=1
38+
for i in 1 2 3
39+
do
40+
echo "check deployment status for round $i"
41+
kubectl rollout status daemonset kepler-exporter -n kepler --timeout 60s
42+
#check rollout status
43+
if [ $? -eq 0 ]
44+
then
45+
deploy_status=0
46+
break
47+
fi
48+
done
49+
# if deployment in error
50+
if test $[deploy_status] -eq 1
51+
then
52+
echo "Check the status of the kepler-exporter"
53+
kubectl -n kepler describe daemonset.apps/kepler-exporter
54+
echo "Check the logs of the kepler-exporter"
55+
kubectl -n kepler logs daemonset.apps/kepler-exporter
56+
fi
3857
}
3958

4059
main "$@"

0 commit comments

Comments
 (0)