Skip to content

Commit caa949f

Browse files
carsten989Carsten Schafer
andauthored
PKI2-196 change to openlan org (#1097)
* Add new cluster deployer GH action Signed-off-by: Carsten Schafer <Carsten.Schafer@kinarasystems.com> * New version of dev01 deploy Signed-off-by: Carsten Schafer <Carsten.Schafer@kinarasystems.com> --------- Signed-off-by: Carsten Schafer <Carsten.Schafer@kinarasystems.com> Co-authored-by: Carsten Schafer <Carsten.Schafer@kinarasystems.com>
1 parent 791723a commit caa949f

5 files changed

Lines changed: 209 additions & 9 deletions

File tree

.github/workflows/cgw-dev-deployment.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ defaults:
55
shell: bash
66

77
env:
8+
AWS_EKS_NAME: tip-openlan-lab
9+
K8S_VERSION: "1.36.1"
10+
HELMFILE_VERSION: "1.5.2"
811
AWS_DEFAULT_OUTPUT: json
912
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
1013
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }}
@@ -41,9 +44,8 @@ on:
4144
description: 'Namespace (normally openlan-CONFIGNAME)'
4245
required: false
4346
cluster:
44-
default: "tip-wlan-main"
45-
#other: "tip-wlan-qa"
46-
description: "AWS cluster name: tip-wlan-main or tip-wlan-qa"
47+
default: "tip-openlan-lab"
48+
description: "AWS cluster name: tip-openlan-lab"
4749
required: false
4850
region:
4951
default: "ap-south-1"
@@ -115,13 +117,14 @@ jobs:
115117
116118
- name: Install kubectl, helmfile and plugins
117119
run: |
118-
curl -s -LO "https://dl.k8s.io/release/v1.27.14/bin/linux/amd64/kubectl"
120+
curl -s -LO "https://dl.k8s.io/release/${{ env.K8S_VERSION }}/bin/linux/amd64/kubectl"
119121
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
120-
curl -s -LO "https://github.com/helmfile/helmfile/releases/download/v0.165.0/helmfile_0.165.0_linux_amd64.tar.gz"
121-
tar xvzf helmfile_0.165.0_linux_amd64.tar.gz helmfile
122+
curl -s -LO \
123+
"https://github.com/helmfile/helmfile/releases/download/v${{ env.HELMFILE_VERSION }}/helmfile_${{ env.HELMFILE_VERSION }}/helmfile_${{ env.HELMFILE_VERSION }}_linux_amd64.tar.gz"
124+
tar xvzf helmfile_${{ env.HELMFILE_VERSION }}_linux_amd64.tar.gz helmfile
122125
sudo install -o root -g root -m 0755 helmfile /usr/local/bin/helmfile
123-
helm plugin install https://github.com/aslafy-z/helm-git --version 0.16.0
124-
helm plugin install https://github.com/databus23/helm-diff
126+
helm plugin install https://github.com/aslafy-z/helm-git --version 1.5.2
127+
helm plugin install https://github.com/databus23/helm-diff --version 3.15.7
125128
126129
- name: Create certificate file
127130
working-directory: wlan-cloud-ucentral-deploy/cgw
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
name: New Deploy DEV01 OpenWIFI Cloud SDK
2+
3+
defaults:
4+
run:
5+
shell: bash
6+
7+
env:
8+
AWS_EKS_NAME: tip-openlan-lab
9+
K8S_VERSION: "1.36.1"
10+
AWS_DEFAULT_OUTPUT: json
11+
AWS_DEFAULT_REGION: ap-south-1
12+
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
13+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }}
14+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }}
15+
16+
# Insta certs:
17+
#WEBSOCKET_CERT: ${{ secrets.INSTA_WEBSOCKET_CERT }}
18+
#WEBSOCKET_KEY: ${{ secrets.INSTA_WEBSOCKET_KEY }}
19+
# DigiCert certs:
20+
WEBSOCKET_CERT: ${{ secrets.DIGICERT_CERT }}
21+
WEBSOCKET_KEY: ${{ secrets.DIGICERT_KEY }}
22+
23+
# https://stackoverflow.com/questions/59977364/github-actions-how-use-strategy-matrix-with-script
24+
# Required object fiels per environment:
25+
# - namespace - namespace suffix that will used added for the Kubernetes environment (i.e. if you pass 'test', kubernetes namespace will be named 'openwifi-test')
26+
# - deploy_method - deployment method for the chart deployment (supported methods - 'git' (will use helm-git from assembly chart) and 'bundle' (will use chart stored in the Artifactory0
27+
# - chart_version - version of chart to be deployed from assembly chart (for 'git' method git ref may be passed, for 'bundle' method version of chart may be passed)
28+
# - owgw_version - OpenWIFI Gateway version to deploy (will be used for Docker image tag and git branch for Helm chart if git deployment is required)
29+
# - owsec_version - OpenWIFI Security version to deploy (will be used for Docker image tag and git branch for Helm chart if git deployment is required)
30+
# - owfms_version - OpenWIFI Firmware version to deploy (will be used for Docker image tag and git branch for Helm chart if git deployment is required)
31+
# - owprov_version - OpenWIFI Provisioning version to deploy (will be used for Docker image tag and git branch for Helm chart if git deployment is required)
32+
# - owanalytics_version - OpenWIFI Analytics version to deploy (will be used for Docker image tag and git branch for Helm chart if git deployment is required)
33+
# - owsub_version - OpenWIFI Subscription (Userportal) version to deploy (will be used for Docker image tag and git branch for Helm chart if git deployment is required)
34+
# - owrrm_version - OpenWIFI radio resource management service version to deploy (will be used for Docker image tag and git branch for Helm chart if git deployment is required)
35+
# - owgwui_version - OpenWIFI Web UI version to deploy (will be used for Docker image tag and git branch for Helm chart if git deployment is required)
36+
# - owprovui_version - OpenWIFI Provisioning Web UI version to deploy (will be used for Docker image tag and git branch for Helm chart if git deployment is required)
37+
testbeds: '[
38+
{
39+
"namespace": "dev01",
40+
"deploy_method": "git",
41+
"chart_version": "${{ github.event.inputs.chart_version }}",
42+
"owgw_version": "master",
43+
"owsec_version": "main",
44+
"owfms_version": "main",
45+
"owprov_version": "main",
46+
"owanalytics_version": "main",
47+
"owsub_version": "main",
48+
"owrrm_version": "main",
49+
"owgwui_version": "main",
50+
"owprovui_version": "main"
51+
}
52+
]'
53+
54+
on:
55+
workflow_dispatch:
56+
inputs:
57+
chart_version:
58+
description: 'Chart version to deploy eg: v4.1.0, if force latest not set'
59+
required: true
60+
default: 'main'
61+
force_latest:
62+
default: 'false'
63+
description: 'Force deployment of the latest versions of all microservices ignoring matrix versions'
64+
required: true
65+
id:
66+
description: 'run identifier'
67+
required: false
68+
69+
jobs:
70+
id:
71+
name: Workflow ID Provider
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: ${{ github.event.inputs.id }}
75+
run: echo run identifier ${{ inputs.id }}
76+
77+
generate-matrix:
78+
name: Generate matrix for build
79+
runs-on: ubuntu-latest
80+
needs:
81+
- id
82+
outputs:
83+
matrix: ${{ steps.set-matrix.outputs.matrix }}
84+
steps:
85+
- name: generate-matrix
86+
id: set-matrix
87+
run: |
88+
cat >> $GITHUB_OUTPUT << EOF
89+
matrix={"include":${{ env.testbeds }}}
90+
EOF
91+
92+
deploy:
93+
name: Update OpenWIFI Cloud SDK instances
94+
runs-on: ubuntu-latest
95+
needs:
96+
- id
97+
- generate-matrix
98+
strategy:
99+
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
100+
fail-fast: false
101+
steps:
102+
103+
- name: Checkout repo with Helm values
104+
uses: actions/checkout@v4
105+
with:
106+
repository: Telecominfraproject/wlan-cloud-ucentral-deploy
107+
path: wlan-cloud-ucentral-deploy
108+
ref: ${{ matrix.chart_version }}
109+
110+
- name: Prepare certificates from secrets
111+
working-directory: wlan-cloud-ucentral-deploy/chart/environment-values
112+
run: |
113+
echo "${{ env.WEBSOCKET_CERT }}" | base64 -d > cert.pem
114+
echo "${{ env.WEBSOCKET_KEY }}" | base64 -d > key.pem
115+
116+
- name: Fetch kubeconfig
117+
run: |
118+
aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
119+
120+
- name: Install kubectl
121+
run: |
122+
curl -s -LO "https://dl.k8s.io/release/${{ env.K8S_VERSION }}/bin/linux/amd64/kubectl"
123+
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
124+
125+
- name: Deploy OpenWIFI Cloud SDK
126+
working-directory: wlan-cloud-ucentral-deploy/chart/environment-values
127+
run: |
128+
export NAMESPACE=${{ matrix.namespace }}
129+
export RTTY_TOKEN=${{ secrets.RTTY_TOKEN }}
130+
export OWGW_AUTH_USERNAME=${{ secrets.UCENTRALGW_AUTH_USERNAME }}
131+
export OWGW_AUTH_PASSWORD=${{ secrets.UCENTRALGW_AUTH_PASSWORD }}
132+
export OWFMS_S3_SECRET=${{ secrets.UCENTRALFMS_S3_SECRET }}
133+
export OWFMS_S3_KEY=${{ secrets.UCENTRALFMS_S3_KEY }}
134+
export CERT_LOCATION=cert.pem
135+
export KEY_LOCATION=key.pem
136+
export OWSEC_NEW_PASSWORD=${{ secrets.OWSEC_NEW_PASSWORD }}
137+
export MAILER_USERNAME=${{ secrets.MAILER_USERNAME }}
138+
export MAILER_PASSWORD=${{ secrets.MAILER_PASSWORD }}
139+
export IPTOCOUNTRY_IPINFO_TOKEN=${{ secrets.IPTOCOUNTRY_IPINFO_TOKEN }}
140+
export DOMAIN=lab.open-lan.org
141+
export CERTIFICATE_ARN=arn:aws:acm:ap-south-1:289708231103:certificate/2da39707-c340-48ec-a819-0014126548af
142+
# use insta + digicert chaincerts here
143+
export VALUES_FILE_LOCATION=values.openwifi-qa.yaml,values.openwifi-qa.single-external-db.yaml,values.openwifi-qa.separate-lbs.yaml
144+
if [[ "${{ github.event.inputs.force_latest }}" == "false" ]]; then
145+
export DEPLOY_METHOD=${{ matrix.deploy_method }}
146+
export CHART_VERSION=${{ matrix.chart_version }}
147+
export OWGW_VERSION=${{ matrix.owgw_version }}
148+
export OWGWUI_VERSION=${{ matrix.owgwui_version }}
149+
export OWSEC_VERSION=${{ matrix.owsec_version }}
150+
export OWFMS_VERSION=${{ matrix.owfms_version }}
151+
export OWPROV_VERSION=${{ matrix.owprov_version }}
152+
export OWPROVUI_VERSION=${{ matrix.owprovui_version }}
153+
export OWANALYTICS_VERSION=${{ matrix.owanalytics_version }}
154+
export OWSUB_VERSION=${{ matrix.owsub_version }}
155+
export OWRRM_VERSION=${{ matrix.owrrm_version }}
156+
else
157+
export DEPLOY_METHOD=git
158+
export CHART_VERSION=main
159+
export OWGW_VERSION=master
160+
export OWGWUI_VERSION=main
161+
export OWSEC_VERSION=main
162+
export OWFMS_VERSION=main
163+
export OWPROV_VERSION=main
164+
export OWPROVUI_VERSION=main
165+
export OWANALYTICS_VERSION=main
166+
export OWSUB_VERSION=main
167+
export OWRRM_VERSION=main
168+
fi
169+
./deploy.sh
170+
171+
- name: Show resource state on deployment failure
172+
if: failure()
173+
run: |
174+
kubectl get pods --namespace openwifi-${{ matrix.namespace }}
175+
kubectl get services --namespace openwifi-${{ matrix.namespace }}
176+
kubectl get persistentvolumeclaims --namespace openwifi-${{ matrix.namespace }}
177+
178+
- name: Describe pods on deployment failure
179+
if: failure()
180+
run: |
181+
kubectl describe pods --namespace openwifi-${{ matrix.namespace }}
182+
183+
- name: Describe services on deployment failure
184+
if: failure()
185+
run: |
186+
kubectl describe services --namespace openwifi-${{ matrix.namespace }}
187+
188+
- name: Describe persistentvolumeclaims on deployment failure
189+
if: failure()
190+
run: |
191+
kubectl describe persistentvolumeclaims --namespace openwifi-${{ matrix.namespace }}
192+
193+
- name: Rollback Cloud SDK
194+
#if: failure()
195+
# don't roll back so easier to diagnose issues
196+
if: false
197+
run: |
198+
helm rollback tip-openwifi --namespace openwifi-${{ matrix.namespace }} --wait --timeout 20m

.github/workflows/cloud-sdk-qa-deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ jobs:
130130
export MAILER_USERNAME=${{ secrets.MAILER_USERNAME }}
131131
export MAILER_PASSWORD=${{ secrets.MAILER_PASSWORD }}
132132
export IPTOCOUNTRY_IPINFO_TOKEN=${{ secrets.IPTOCOUNTRY_IPINFO_TOKEN }}
133-
export EXTRA_VALUES='owgw.configProperties.logging\.level=information'
134133
./deploy.sh
135134
136135
- name: Show resource state on deployment failure
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)