-
Notifications
You must be signed in to change notification settings - Fork 26
102 lines (99 loc) · 3.62 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
name: Integration Test
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
base_change:
description: Change flag on base image
required: true
type: string
docker_secret:
description: Secret check
required: true
type: string
image_repo:
description: The image repo to use
required: true
type: string
image_tag:
description: The image tag to use
required: true
type: string
kepler_tag:
description: Kepler image tag
required: true
type: string
additional_opts:
description: additional deployment opts
required: true
type: string
env:
BASE_IMAGE: ${{ inputs.image_repo }}/kepler_model_server_base:${{ inputs.image_tag }}
IMAGE: localhost:5001/kepler_model_server:devel
KEPLER_IMAGE: quay.io/sustainable_computing_io/kepler:${{ inputs.kepler_tag }}
DEFAULT_MODEL_SERVER_BASE_IMAGE: quay.io/sustainable_computing_io/kepler_model_server_base:latest
jobs:
run-integration:
runs-on: ubuntu-20.04
steps:
- name: use Kepler action to deploy cluster
uses: sustainable-computing-io/[email protected]
with:
runningBranch: kind
cluster_provider: kind
- name: load kepler image
run: |
docker pull ${{ env.KEPLER_IMAGE }}
kind load docker-image ${{ env.KEPLER_IMAGE }}
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Replace value in Dockerfile if base changes
if: ${{ (inputs.base_change == 'true') && (inputs.docker_secret == 'true') }}
run: |
sed -i "s|${{ env.DEFAULT_MODEL_SERVER_BASE_IMAGE }}|${{ env.BASE_IMAGE }}|" dockerfiles/Dockerfile
- name: Replace value in Dockerfile.test if base changes
if: ${{ (inputs.base_change == 'true') && (inputs.docker_secret == 'true') }}
run: |
sed -i "s|${{ env.DEFAULT_MODEL_SERVER_BASE_IMAGE }}|${{ env.BASE_IMAGE }}|" dockerfiles/Dockerfile.test
- name: build Kepler model server and test image and push to local registry
run: make build build-test push push-test
- name: set up Kustomize
run: |
curl -o install_kustomize.sh https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh
chmod +x install_kustomize.sh
./install_kustomize.sh 5.3.0
chmod +x kustomize
mv kustomize /usr/local/bin/
- name: test deploying with only estimator
run: |
make deploy
./tests/e2e_test.sh --estimator ${{ inputs.additional_opts }}
make cleanup
env:
OPTS: ESTIMATOR
KEPLER_IMAGE_VERSION: ${{ inputs.kepler_tag }}
- name: test deploying with only server
run: |
make deploy
./tests/e2e_test.sh --server ${{ inputs.additional_opts }}
make cleanup
env:
OPTS: SERVER
KEPLER_IMAGE_VERSION: ${{ inputs.kepler_tag }}
- name: test deploying with estimator and model server
run: |
make deploy
./tests/e2e_test.sh --estimator --server ${{ inputs.additional_opts }}
make cleanup
env:
OPTS: ESTIMATOR SERVER
KEPLER_IMAGE_VERSION: ${{ inputs.kepler_tag }}
- name: upload artifacts on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: integration-test-artifacts
path: tmp/e2e