-
Notifications
You must be signed in to change notification settings - Fork 1
185 lines (168 loc) · 6.8 KB
/
ci.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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: dashboard-check
on:
push:
branches:
- "*.*"
pull_request:
branches:
- "master"
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
folders:
description: 'Folders'
required: true
default: 'all'
type: string
kubedb_version:
description: 'KubeDB Version'
required: true
default: 'v2024.4.27' #needs to be dynamic
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-dashboard-check
cancel-in-progress: true
jobs:
config:
name: Configure Inputs
runs-on: ubuntu-latest
outputs:
folders: ${{ steps.defaulter.outputs.folders }}
kubedb_version : ${{ steps.defaulter.outputs.kubedb_version }}
steps:
- name: Defaulter
id: defaulter
env:
FOLDERS: ${{ inputs.folders }}
KUBEDB_VERSION: ${{ inputs.kubedb_version }}
run: |
echo "folders=${FOLDERS:-all}" >> $GITHUB_OUTPUT
echo "kubedb_version=${KUBEDB_VERSION:-v2024.4.27}" >> $GITHUB_OUTPUT
test:
name: Test
runs-on: ubuntu-latest
needs: config
strategy:
fail-fast: false
matrix:
k8s: [v1.27.3]
steps:
- uses: actions/checkout@v4
with:
ref: workflow
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.22'
id: go
- name: Install Homebrew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- uses: Homebrew/actions/setup-homebrew@master
- name: Prepare host
run: |
brew instal gh kubectl helm kind
- name: Prepare git
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
run: |
set -x
git config --global user.name "1gtm"
git config --global user.email "[email protected]"
git config --global \
url."https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com".insteadOf \
"https://github.com"
- name: Create Kubernetes ${{ matrix.k8s }} cluster
id: kind
uses: engineerd/[email protected]
with:
version: v0.20.0
config: hack/kubernetes/kind.yaml
image: kindest/node:${{ matrix.k8s }}
- name: Prepare cluster for testing
id: local-path
run: |
echo "waiting for nodes to be ready ..."
kubectl wait --for=condition=Ready nodes --all --timeout=5m
kubectl get nodes
kubectl wait --for=condition=Ready pods -n kube-system --all --timeout=10m
kubectl get pods -n kube-system
- name: Install cert-manager
run: |
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.yaml
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
- name: Issue License
env:
BYTEBUILDERS_LICENSE_TOKEN: ${{ secrets.BYTEBUILDERS_LICENSE_TOKEN }}
run: |
export KUBECONFIG="${HOME}/.kube/config"
CLUSTER_UID=$(kubectl get ns kube-system -o=jsonpath='{.metadata.uid}')
curl -X POST -o /tmp/kubedb-license.txt -d "name=1gtm&[email protected]&product=kubedb-enterprise&cluster=${CLUSTER_UID}&tos=true&token=${BYTEBUILDERS_LICENSE_TOKEN}" https://license-issuer.appscode.com/issue-license
curl -X POST -o /tmp/platform-license.txt -d "name=1gtm&[email protected]&product=platform&cluster=${CLUSTER_UID}&tos=true&token=${BYTEBUILDERS_LICENSE_TOKEN}" https://license-issuer.appscode.com/issue-license
- name: Install KubeDB
run: |
helm install kubedb oci://ghcr.io/appscode-charts/kubedb \
--version ${{ needs.config.outputs.kubedb_version }} \
--namespace kubedb --create-namespace \
--set-file global.license=/tmp/kubedb-license.txt \
--set global.featureGates.Druid=true \
--set global.featureGates.FerretDB=true \
--set global.featureGates.Memcached=true \
--set global.featureGates.MSSQLServer=true \
--set global.featureGates.PerconaXtraDB=true \
--set global.featureGates.PgBouncer=true \
--set global.featureGates.Pgpool=true \
--set global.featureGates.ProxySQL=true \
--set global.featureGates.RabbitMQ=true \
--set global.featureGates.Singlestore=true \
--set global.featureGates.Solr=true \
--set global.featureGates.ZooKeeper=true \
--wait --burst-limit=10000 --debug
- name: Install KubeDB CLI
run: |
cd ..
git clone https://github.com/kubedb/cli.git
cd cli
git checkout check
go install ./...
- name: Install Prometheus
run: |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install prometheus prometheus-community/kube-prometheus-stack -n monitoring --create-namespace --wait --burst-limit=10000
- name: Install Panopticon
run: |
helm repo add appscode https://charts.appscode.com/stable/
helm repo update
helm install panopticon appscode/panopticon \
-n kubeops --create-namespace \
--set monitoring.agent=prometheus.io/operator \
--set monitoring.serviceMonitor.labels.release=prometheus \
--set-file license=/tmp/kubedb-license.txt \
--wait --burst-limit=10000
sleep 5s
kubectl wait --for=condition=ready pod -l "app.kubernetes.io/name=panopticon,app.kubernetes.io/instance=panopticon" -n kubeops --timeout=10m
- name: Apply MetricsConfigurations
run: |
helm repo add appscode https://charts.appscode.com/stable/
helm repo update
helm upgrade -i kubedb-metrics appscode/kubedb-metrics -n kubedb --create-namespace --version=${{ needs.config.outputs.kubedb }} --wait --burst-limit=10000 --debug
- name: Prepare smaples
run: |
cd ..
git clone https://github.com/kubedb/samples.git
- name: Check Dashboard Metrics
env:
SINGLESTORE_LICENSE_USERNAME: ${{ secrets.SINGLESTORE_LICENSE_USERNAME }}
SINGLESTORE_LICENSE_PASSWORD: ${{ secrets.SINGLESTORE_LICENSE_PASSWORD }}
FOLDERS: ${{ needs.config.outputs.folders }}
run: |
echo "SINGLESTORE_LICENSE_USERNAME=$(echo $SINGLESTORE_LICENSE_USERNAME)" >> ./hack/scripts/.env
echo "SINGLESTORE_LICENSE_PASSWORD=$(echo $SINGLESTORE_LICENSE_PASSWORD)" >> ./hack/scripts/.env
echo "FOLDERS=$(echo $FOLDERS)" >> ./hack/scripts/.env
bash hack/scripts/check-dashboard.sh