-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (151 loc) · 9.56 KB
/
common-comp-tests.yml
File metadata and controls
169 lines (151 loc) · 9.56 KB
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
---
# SPDX-FileCopyrightText: (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Common Component Tests
on:
workflow_call:
inputs:
component:
required: true
type: string
description: "The component to test (e.g., app-deployment-manager, app-resource-manager)"
use-enic:
required: true
description: "Deploy Edge Cluster using EniC"
type: boolean
default: true
emf-branch:
required: true
description: "Branch in edge-manageability-framework to checkout"
type: string
default: main
permissions:
contents: read
jobs:
component-test:
runs-on: ubuntu-24.04-16core-64GB # ubuntu-24.04-4core-16GB ubuntu-22.04-32core-128GB & ubuntu-24.04-16core-64GB
timeout-minutes: 60
env:
ORCH_DEFAULT_PASSWORD: ${{ secrets.ORCH_DEFAULT_PASSWORD }}
CODER_DIR: ${{ github.workspace }}
DOCKERHUB_TOKEN: ${{ secrets.SYS_DOCKERHUB_RO }}
DOCKERHUB_USERNAME: ${{ secrets.SYS_DOCKERHUB_USERNAME }}
GH_TOKEN: ${{ secrets.SYS_ORCH_GITHUB }}
steps:
- name: Deploy Kind Orchestrator
id: deploy-kind-orchestrator
uses: open-edge-platform/edge-manageability-framework/.github/actions/deploy_kind@ed0de70b9080465711c587a3ed7a75e51aa1fcb9
timeout-minutes: 45
with:
orch_version: ${{ inputs.emf-branch || 'main' }}
orch_password: ${{ secrets.ORCH_DEFAULT_PASSWORD }}
docker_username: ${{ secrets.SYS_DOCKERHUB_USERNAME }}
docker_password: ${{ secrets.SYS_DOCKERHUB_RO }}
token: ${{ secrets.SYS_ORCH_GITHUB }}
deployment_type: 'all'
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.24
- name: Checkout app-orch-deployment repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: open-edge-platform/app-orch-deployment
persist-credentials: false
path: app-orch-deployment
token: ${{ secrets.SYS_ORCH_GITHUB }}
- name: Get current git hash of the app-orch-deployment PR
id: get-git-hash-app-orch-deployment
working-directory: app-orch-deployment
env:
GIT_HASH: ${{ github.event.pull_request.head.sha }}
run: echo "GIT_HASH_CHARTS=${GIT_HASH}" >> "$GITHUB_ENV"
- name: Describe ${{ inputs.component }} application # zizmor: ignore[template-injection]
run: kubectl describe application -n dev ${{ inputs.component }} || true
- name: Setup Test environment
run: |
sudo awk -i inplace '/BEGIN ORCH DEVELOPMENT HOSTS/,/END ORCH DEVELOPMENT HOSTS/ { next } 1' /etc/hosts
sudo awk -i inplace '/BEGIN ORCH SRE DEVELOPMENT HOST/,/END ORCH SRE DEVELOPMENT HOST/ { next } 1' /etc/hosts
mage gen:hostfileTraefik | sudo tee -a /etc/hosts > /dev/null
echo "Updated Hostfile entries!"
mage gen:orchCa deploy:orchCa
- name: Setup users and project/org
run: |
mage tenantUtils:createDefaultMtSetup
echo "Orch org/project/users created!"
echo "Project uID:"
kubectl get projects.project -o json | jq -r ".items[0].status.projectStatus.uID"
- name: Deploy Edge Cluster using EniC
if: ${{ inputs.use-enic }}
run: |
mage deploy:edgeCluster dev
echo "ENIC deployment done!"
- name: Upload Deployment Packages to Catalog
run: |
mage app:upload
echo "Deployment packages uploaded to catalog!"
- name: Redeploy and Rebuild Component
working-directory: app-orch-deployment/${{ inputs.component }} # zizmor: ignore[template-injection]
run: |
echo "Redeploying and rebuilding component ${{ inputs.component }}"
make coder-rebuild
make coder-redeploy
- name: Run Component Tests
working-directory: app-orch-deployment/${{ inputs.component }} # zizmor: ignore[template-injection]
run: |
echo "Running component tests for ${{ inputs.component }}"
make component-test
echo "${{ inputs.component }} component tests done!"
- name: Report
uses: becheran/go-testreport@90efc1ce13c872f23d6bc8a069527c26288b8f9c
with:
input: app-orch-deployment/${{ inputs.component }}/test-report.json
output: app-orch-deployment/${{ inputs.component }}/${{ github.event_name }}-${{ github.event.number }}-test-report.html
template: app-orch-deployment/${{ inputs.component }}/test/template.html
- name: Upload Test Report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-report
path: app-orch-deployment/${{ inputs.component }}/${{ github.event_name }}-${{ github.event.number }}-test-report.html
- name: Get ENiC diagnostic information
if: ${{ failure() }}
id: get-enic-diag-info
run: |
kubectl -n orch-cluster get pods -o wide -A > orch-cluster-list.log
kubectl logs -n orch-cluster -l app=cluster-manager-cm -c cluster-manager --tail=-1 > cluster-manager.log || echo "No current logs for cluster-manager"
kubectl logs -n orch-cluster -l app=cluster-manager-cm -c cluster-manager --previous --tail=-1 > cluster-manager-previous.log || echo "No previous logs for cluster-manager"
kubectl logs -n orch-cluster -l app.kubernetes.io/name=cluster-connect-gateway --tail=-1 > cluster-connect-gateway.log || echo "No current logs for cluster-connect-gateway"
kubectl logs -n orch-cluster -l app.kubernetes.io/name=cluster-connect-gateway --previous --tail=-1 > cluster-connect-gateway-previous.log || echo "No previous logs for cluster-connect-gateway"
kubectl logs -n orch-cluster -l app=intel-infra-provider-manager -c intel-infra-provider-manager --tail=-1 > intel-infra-provider-manager.log || echo "No current logs for intel-infra-provider-manager"
kubectl logs -n orch-cluster -l app=intel-infra-provider-manager -c intel-infra-provider-manager --previous --tail=-1 > intel-infra-provider-manager-previous.log || echo "No previous logs for intel-infra-provider-manager"
kubectl logs -n orch-cluster -l app=southbound-api -c intel-infra-provider-southbound --tail=-1 > intel-infra-provider-southbound.log || echo "No current logs for intel-infra-provider-southbound"
kubectl logs -n orch-cluster -l app=southbound-api -c intel-infra-provider-southbound --previous --tail=-1 > intel-infra-provider-southbound-previous.log || echo "No previous logs for intel-infra-provider-southbound"
kubectl logs -n enic -l app=enic -c edge-node --tail=-1 > enic.log || echo "No current logs for enic"
kubectl logs -n orch-app -l app=app-interconnect-manager -c app-interconnect-manager --tail=-1 > app-interconnect-manager.log || echo "No current logs for app-interconnect-manager"
kubectl logs -n orch-app -l app=app-deployment-api -c app-deployment-api --tail=-1 > app-deployment-api.log || echo "No current logs for app-deployment-api"
kubectl logs -n orch-app -l app=app-deployment-api -c app-deployment-api-rest-proxy --tail=-1 > app-deployment-api-rest-proxy.log || echo "No current logs for app-deployment-api-rest-proxy"
kubectl logs -n orch-app -l app=ma-adm-app-deployment-manager -c controller --tail=-1 > ma-adm-app-deployment-manager.log || echo "No current logs for ma-adm-app-deployment-manager"
kubectl logs -n orch-app -l app=app-deployment-manager -c controller --tail=-1 > app-deployment-manager.log || echo "No current logs for app-deployment-manager"
kubectl logs -n orch-app -l app=app-orch-tenant-controller -c config-provisioner --tail=-1 > app-orch-tenant-controller.log || echo "No current logs for app-orch-tenant-controller"
kubectl logs -n orch-app -l app=app-resource-manager -c app-resource-manager --tail=-1 > app-resource-manager.log || echo "No current logs for app-resource-manager"
kubectl logs -n orch-app -l app=app-resource-manager -c app-resource-manager-rest-proxy --tail=-1 > app-resource-manager-rest-proxy.log || echo "No current logs for app-resource-manager-rest-proxy"
kubectl logs -n orch-app -l app=app-orch-catalog -c app-orch-catalog-server --tail=-1 > app-orch-catalog-server.log || echo "No current logs for app-orch-catalog-server"
kubectl logs -n orch-app -l app=app-orch-catalog -c app-orch-catalog-rest-proxy --tail=-1 > app-orch-catalog-rest-proxy.log || echo "No current logs for app-orch-catalog-rest-proxy"
kubectl logs -n orch-app -l app=app-service-proxy -c app-service-proxy --tail=-1 > app-service-proxy.log || echo "No current logs for app-service-proxy"
kubectl logs -n orch-app -l app=vnc-proxy-app-resource-manager -c vncproxy --tail=-1 > vnc-proxy-app-resource-manager.log || echo "No current logs for vnc-proxy-app-resource-manager"
- name: Upload ENiC diagnostic artifacts
if: ${{ failure() && steps.get-enic-diag-info.conclusion == 'success' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: pods-logs
path: |
orch-cluster-list.log
cluster-manager.log
cluster-manager-previous.log
cluster-connect-gateway.log
cluster-connect-gateway-previous.log
intel-infra-provider-manager.log
intel-infra-provider-manager-previous.log
intel-infra-provider-southbound.log
intel-infra-provider-southbound-previous.log