Skip to content

Commit d771d51

Browse files
authored
added argocd to helmfile migration (#1672)
1 parent ef9d3e4 commit d771d51

File tree

98 files changed

+10278
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+10278
-18
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# SPDX-FileCopyrightText: (C) 2026 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: "Collect Diagnostics (Helmfile)"
5+
description: "Collects cluster diagnostics for helmfile-based deployments (no mage/ArgoCD dependency)"
6+
7+
inputs:
8+
k8s_diagnostics_args:
9+
description: "Arguments to pass to orch_k8s_diagnostics.py (e.g., '--errors-only --output-html --output-json')"
10+
required: false
11+
default: "--errors-only --output-html --output-json"
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: Run K8s diagnostics utility
17+
id: run-k8s-diagnostics
18+
if: always()
19+
shell: bash
20+
env:
21+
K8S_DIAGNOSTICS_ARGS: ${{ inputs.k8s_diagnostics_args }}
22+
run: |
23+
/usr/bin/python3 ./ci/orch_k8s_diagnostics.py $K8S_DIAGNOSTICS_ARGS || true
24+
echo "K8s diagnostics completed with args: $K8S_DIAGNOSTICS_ARGS"
25+
26+
- name: Collect cluster diagnostic information
27+
id: collect-cluster-diagnostics
28+
if: always()
29+
shell: bash
30+
run: |
31+
mkdir -p cluster-diagnostics
32+
kubectl get pods -o wide -A > cluster-diagnostics/pods-list.txt || true
33+
kubectl get all -A > cluster-diagnostics/kubectl-get-all.txt || true
34+
kubectl describe pods -A > cluster-diagnostics/pods-describe.txt || true
35+
kubectl get events -o yaml -A > cluster-diagnostics/events.yaml || true
36+
helm list -A > cluster-diagnostics/helm-releases.txt || true
37+
kubectl get helmrelease -A -o yaml > cluster-diagnostics/helmreleases.yaml || true
38+
kubectl get nodes -o wide > cluster-diagnostics/nodes.txt || true
39+
40+
- name: Collect pod logs
41+
if: always()
42+
shell: bash
43+
run: ./ci/collect_pod_logs.sh || true
44+
45+
- name: Upload diagnostic artifacts
46+
if: always()
47+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
48+
with:
49+
name: diagnostics-${{ github.job }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_number }}-${{ github.run_attempt }}
50+
path: |
51+
cluster-diagnostics/
52+
pod_logs/
53+
diagnostics_full_*.md
54+
diagnostics_full_*.html
55+
diagnostics_full_*.json
56+
retention-days: 15
57+
compression-level: 6
58+
if-no-files-found: warn
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# SPDX-FileCopyrightText: (C) 2026 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: "Deploy On-Prem Orchestrator (Helmfile)"
5+
description: "Deploys the on-prem orchestrator using helmfile — runs pre-orch and post-orch deploy steps"
6+
inputs:
7+
orch_version:
8+
required: false
9+
description: "Orchestrator version (git ref) to deploy"
10+
default: '${{ github.sha }}'
11+
orch_profile:
12+
required: false
13+
description: "Orchestrator profile to deploy"
14+
default: "onprem-eim"
15+
docker_username:
16+
required: true
17+
description: "Docker Hub username for pulling images"
18+
docker_password:
19+
required: true
20+
description: "Docker Hub password for pulling images"
21+
22+
runs:
23+
using: "composite"
24+
steps:
25+
- name: Checkout Orchestrator repo
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
repository: open-edge-platform/edge-manageability-framework
29+
ref: ${{ inputs.orch_version }}
30+
persist-credentials: false
31+
32+
# ── Detect Host IP ────────────────────────────────────────────────────────
33+
34+
- name: Detect host IP
35+
id: host-ip
36+
shell: bash
37+
run: |
38+
# Get interface with 10.x.x.x IP (same approach as ci/ven/dnsmasq-setup.sh)
39+
interface_name=$(ip -o -4 addr show | awk '$4 ~ /^10\./ {print $2}')
40+
if [ -z "$interface_name" ]; then
41+
echo "No interface found with 10.x IP, falling back to default route interface"
42+
interface_name=$(ip route show default | awk '{print $5; exit}')
43+
fi
44+
ip_address=$(ip -4 addr show "$interface_name" | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
45+
if [ -z "$ip_address" ]; then
46+
echo "❌ Could not detect host IP address"
47+
exit 1
48+
fi
49+
echo "Detected host IP: $ip_address (interface: $interface_name)"
50+
echo "host_ip=$ip_address" >> "$GITHUB_OUTPUT"
51+
52+
- name: Update env files with detected host IP
53+
shell: bash
54+
env:
55+
HOST_IP: ${{ steps.host-ip.outputs.host_ip }}
56+
ORCH_PROFILE: ${{ inputs.orch_profile }}
57+
run: |
58+
echo "Updating pre-orch.env and post-orch.env with EMF_ORCH_IP=$HOST_IP, EMF_HELMFILE_ENV=$ORCH_PROFILE"
59+
60+
# pre-orch.env: uncomment and set EMF_ORCH_IP, comment out individual IPs
61+
sed -i "s|^#EMF_ORCH_IP=.*|EMF_ORCH_IP=$HOST_IP|" helmfile-deploy/pre-orch/pre-orch.env
62+
sed -i "s|^EMF_TRAEFIK_IP=|#EMF_TRAEFIK_IP=|" helmfile-deploy/pre-orch/pre-orch.env
63+
sed -i "s|^EMF_HAPROXY_IP=|#EMF_HAPROXY_IP=|" helmfile-deploy/pre-orch/pre-orch.env
64+
65+
# post-orch.env: uncomment and set EMF_ORCH_IP, comment out individual IPs, set profile
66+
sed -i "s|^#EMF_ORCH_IP=.*|EMF_ORCH_IP=$HOST_IP|" helmfile-deploy/post-orch/post-orch.env
67+
sed -i "s|^EMF_TRAEFIK_IP=|#EMF_TRAEFIK_IP=|" helmfile-deploy/post-orch/post-orch.env
68+
sed -i "s|^EMF_HAPROXY_IP=|#EMF_HAPROXY_IP=|" helmfile-deploy/post-orch/post-orch.env
69+
sed -i "s|^EMF_HELMFILE_ENV=.*|EMF_HELMFILE_ENV=$ORCH_PROFILE|" helmfile-deploy/post-orch/post-orch.env
70+
71+
echo "✅ Both env files updated"
72+
73+
# ── Pre-Orch Deploy ──────────────────────────────────────────────────────
74+
75+
- name: Run pre-orch deploy
76+
shell: bash
77+
working-directory: helmfile-deploy/pre-orch
78+
env:
79+
DOCKER_USERNAME: ${{ inputs.docker_username }}
80+
DOCKER_PASSWORD: ${{ inputs.docker_password }}
81+
run: |
82+
echo "▶ Starting pre-orch deploy (provider: k3s) [timeout: 5m]"
83+
chmod +x pre-orch.sh
84+
timeout 300 ./pre-orch.sh k3s install \
85+
--docker-username "$DOCKER_USERNAME" \
86+
--docker-password "$DOCKER_PASSWORD"
87+
88+
- name: Verify pre-orch deployment
89+
shell: bash
90+
run: |
91+
echo "Verifying pre-orch components are ready..."
92+
kubectl get nodes -o wide
93+
echo "Waiting for all pods to be ready..."
94+
kubectl wait --for=condition=Ready pods --all -A --timeout=120s || true
95+
kubectl get pods -A
96+
97+
# ── Post-Orch Deploy ─────────────────────────────────────────────────────
98+
99+
- name: Run post-orch deploy
100+
shell: bash
101+
working-directory: helmfile-deploy/post-orch
102+
env:
103+
EMF_HELMFILE_ENV: ${{ inputs.orch_profile }}
104+
run: |
105+
echo "▶ Starting post-orch deploy (profile: $EMF_HELMFILE_ENV) [timeout: 20m]"
106+
chmod +x post-orch-deploy.sh
107+
timeout 1200 ./post-orch-deploy.sh install
108+
109+
- name: Verify post-orch deployment
110+
shell: bash
111+
working-directory: helmfile-deploy/post-orch
112+
run: |
113+
echo "Verifying post-orch deployment..."
114+
chmod +x watch-deploy.sh
115+
./watch-deploy.sh
116+
117+
# ── Install Orch CA Certificate ──────────────────────────────────────────
118+
119+
- name: Install orchestrator CA certificate
120+
shell: bash
121+
run: |
122+
kubectl get secret -n orch-gateway tls-orch -o jsonpath="{.data.tls\.crt}" | base64 -d > orch-ca.crt
123+
sudo cp -rf orch-ca.crt /usr/local/share/ca-certificates/
124+
sudo update-ca-certificates -f
125+
126+
# ── Diagnostics ──────────────────────────────────────────────────────────
127+
128+
- name: Get diagnostic information
129+
id: get-diagnostic-info
130+
if: always()
131+
shell: bash
132+
env:
133+
ORCH_PROFILE: ${{ inputs.orch_profile }}
134+
run: |
135+
mkdir -p "$ORCH_PROFILE-diagnostics"
136+
kubectl get pods -o wide -A > "$ORCH_PROFILE-diagnostics/pods-list.txt"
137+
kubectl describe pods -A > "$ORCH_PROFILE-diagnostics/pods-describe.txt"
138+
kubectl get events -o yaml -A > "$ORCH_PROFILE-diagnostics/events.yaml"
139+
helm list -A > "$ORCH_PROFILE-diagnostics/helm-releases.txt"
140+
141+
- name: Upload diagnostic information to CI artifact store
142+
if: always() && steps.get-diagnostic-info.conclusion == 'success'
143+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
144+
with:
145+
name: ${{ inputs.orch_profile }}-helmfile-diagnostics
146+
path: |
147+
${{ inputs.orch_profile }}-diagnostics/pods-list.txt
148+
${{ inputs.orch_profile }}-diagnostics/pods-describe.txt
149+
${{ inputs.orch_profile }}-diagnostics/events.yaml
150+
${{ inputs.orch_profile }}-diagnostics/helm-releases.txt

0 commit comments

Comments
 (0)