-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathaction.yaml
More file actions
150 lines (131 loc) · 6.59 KB
/
action.yaml
File metadata and controls
150 lines (131 loc) · 6.59 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
# SPDX-FileCopyrightText: (C) 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: "Deploy On-Prem Orchestrator (Helmfile)"
description: "Deploys the on-prem orchestrator using helmfile — runs pre-orch and post-orch deploy steps"
inputs:
orch_version:
required: false
description: "Orchestrator version (git ref) to deploy"
default: '${{ github.sha }}'
orch_profile:
required: false
description: "Orchestrator profile to deploy"
default: "onprem-eim"
docker_username:
required: true
description: "Docker Hub username for pulling images"
docker_password:
required: true
description: "Docker Hub password for pulling images"
runs:
using: "composite"
steps:
- name: Checkout Orchestrator repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: open-edge-platform/edge-manageability-framework
ref: ${{ inputs.orch_version }}
persist-credentials: false
# ── Detect Host IP ────────────────────────────────────────────────────────
- name: Detect host IP
id: host-ip
shell: bash
run: |
# Get interface with 10.x.x.x IP (same approach as ci/ven/dnsmasq-setup.sh)
interface_name=$(ip -o -4 addr show | awk '$4 ~ /^10\./ {print $2}')
if [ -z "$interface_name" ]; then
echo "No interface found with 10.x IP, falling back to default route interface"
interface_name=$(ip route show default | awk '{print $5; exit}')
fi
ip_address=$(ip -4 addr show "$interface_name" | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
if [ -z "$ip_address" ]; then
echo "❌ Could not detect host IP address"
exit 1
fi
echo "Detected host IP: $ip_address (interface: $interface_name)"
echo "host_ip=$ip_address" >> "$GITHUB_OUTPUT"
- name: Update env files with detected host IP
shell: bash
env:
HOST_IP: ${{ steps.host-ip.outputs.host_ip }}
ORCH_PROFILE: ${{ inputs.orch_profile }}
run: |
echo "Updating pre-orch.env and post-orch.env with EMF_ORCH_IP=$HOST_IP, EMF_HELMFILE_ENV=$ORCH_PROFILE"
# pre-orch.env: uncomment and set EMF_ORCH_IP, comment out individual IPs
sed -i "s|^#EMF_ORCH_IP=.*|EMF_ORCH_IP=$HOST_IP|" helmfile-deploy/pre-orch/pre-orch.env
sed -i "s|^EMF_TRAEFIK_IP=|#EMF_TRAEFIK_IP=|" helmfile-deploy/pre-orch/pre-orch.env
sed -i "s|^EMF_HAPROXY_IP=|#EMF_HAPROXY_IP=|" helmfile-deploy/pre-orch/pre-orch.env
# post-orch.env: uncomment and set EMF_ORCH_IP, comment out individual IPs, set profile
sed -i "s|^#EMF_ORCH_IP=.*|EMF_ORCH_IP=$HOST_IP|" helmfile-deploy/post-orch/post-orch.env
sed -i "s|^EMF_TRAEFIK_IP=|#EMF_TRAEFIK_IP=|" helmfile-deploy/post-orch/post-orch.env
sed -i "s|^EMF_HAPROXY_IP=|#EMF_HAPROXY_IP=|" helmfile-deploy/post-orch/post-orch.env
sed -i "s|^EMF_HELMFILE_ENV=.*|EMF_HELMFILE_ENV=$ORCH_PROFILE|" helmfile-deploy/post-orch/post-orch.env
echo "✅ Both env files updated"
# ── Pre-Orch Deploy ──────────────────────────────────────────────────────
- name: Run pre-orch deploy
shell: bash
working-directory: helmfile-deploy/pre-orch
env:
DOCKER_USERNAME: ${{ inputs.docker_username }}
DOCKER_PASSWORD: ${{ inputs.docker_password }}
run: |
echo "▶ Starting pre-orch deploy (provider: k3s) [timeout: 5m]"
chmod +x pre-orch.sh
timeout 300 ./pre-orch.sh k3s install \
--docker-username "$DOCKER_USERNAME" \
--docker-password "$DOCKER_PASSWORD"
- name: Verify pre-orch deployment
shell: bash
run: |
echo "Verifying pre-orch components are ready..."
kubectl get nodes -o wide
echo "Waiting for all pods to be ready..."
kubectl wait --for=condition=Ready pods --all -A --timeout=120s || true
kubectl get pods -A
# ── Post-Orch Deploy ─────────────────────────────────────────────────────
- name: Run post-orch deploy
shell: bash
working-directory: helmfile-deploy/post-orch
env:
EMF_HELMFILE_ENV: ${{ inputs.orch_profile }}
run: |
echo "▶ Starting post-orch deploy (profile: $EMF_HELMFILE_ENV) [timeout: 20m]"
chmod +x post-orch-deploy.sh
timeout 1200 ./post-orch-deploy.sh install
- name: Verify post-orch deployment
shell: bash
working-directory: helmfile-deploy/post-orch
run: |
echo "Verifying post-orch deployment..."
chmod +x watch-deploy.sh
./watch-deploy.sh
# ── Install Orch CA Certificate ──────────────────────────────────────────
- name: Install orchestrator CA certificate
shell: bash
run: |
kubectl get secret -n orch-gateway tls-orch -o jsonpath="{.data.tls\.crt}" | base64 -d > orch-ca.crt
sudo cp -rf orch-ca.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates -f
# ── Diagnostics ──────────────────────────────────────────────────────────
- name: Get diagnostic information
id: get-diagnostic-info
if: always()
shell: bash
env:
ORCH_PROFILE: ${{ inputs.orch_profile }}
run: |
mkdir -p "$ORCH_PROFILE-diagnostics"
kubectl get pods -o wide -A > "$ORCH_PROFILE-diagnostics/pods-list.txt"
kubectl describe pods -A > "$ORCH_PROFILE-diagnostics/pods-describe.txt"
kubectl get events -o yaml -A > "$ORCH_PROFILE-diagnostics/events.yaml"
helm list -A > "$ORCH_PROFILE-diagnostics/helm-releases.txt"
- name: Upload diagnostic information to CI artifact store
if: always() && steps.get-diagnostic-info.conclusion == 'success'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ inputs.orch_profile }}-helmfile-diagnostics
path: |
${{ inputs.orch_profile }}-diagnostics/pods-list.txt
${{ inputs.orch_profile }}-diagnostics/pods-describe.txt
${{ inputs.orch_profile }}-diagnostics/events.yaml
${{ inputs.orch_profile }}-diagnostics/helm-releases.txt