Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: sayedppqq <[email protected]>
  • Loading branch information
sayedppqq committed Sep 25, 2024
1 parent 20081a4 commit 5893cdf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
kubedb_version:
description: 'KubeDB Version'
required: true
default: 'v2024.7.11-rc.1' #needs to be dynamic
default: 'v2024.8.21' #needs to be dynamic
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-dashboard-check
Expand All @@ -38,7 +38,7 @@ jobs:
KUBEDB_VERSION: ${{ inputs.kubedb_version }}
run: |
echo "folders=${FOLDERS:-mongodb}" >> $GITHUB_OUTPUT
echo "kubedb_version=${KUBEDB_VERSION:-v2024.7.11-rc.1}" >> $GITHUB_OUTPUT
echo "kubedb_version=${KUBEDB_VERSION:-v2024.8.21}" >> $GITHUB_OUTPUT
test:
name: Test
runs-on: ubuntu-latest
Expand Down Expand Up @@ -114,12 +114,13 @@ jobs:
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
cat /tmp/kubedb-license.txt
- name: Install Longhorn
run: |
helm repo add longhorn https://charts.longhorn.io
helm repo update
helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace --version 1.6.2 --wait --burst-limit=10000
# - name: Install Longhorn
# run: |
# helm repo add longhorn https://charts.longhorn.io
# helm repo update
# helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace --version 1.6.2 --wait --burst-limit=10000

- name: Install KubeDB
run: |
Expand All @@ -146,7 +147,7 @@ jobs:
cd ..
git clone https://github.com/kubedb/cli.git
cd cli
# git checkout check
git checkout mssql-dashboard
go install ./...
- name: Install Prometheus
Expand Down Expand Up @@ -179,7 +180,7 @@ jobs:
cd ..
git clone https://github.com/kubedb/samples.git
cd samples
git checkout mg-args
git checkout mssql-monitoring
- name: Check Dashboard Metrics
env:
Expand Down
13 changes: 9 additions & 4 deletions hack/scripts/check-dashboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

declare -A kind=(["connectcluster"]="ConnectCluster" ["druid"]="Druid" ["elasticsearch"]="Elasticsearch" ["kafka"]="Kafka" ["mariadb"]="MariaDB"
["mongodb"]="MongoDB" ["mysql"]="MySQL" ["perconaxtradb"]="PerconaXtraDB" ["pgpool"]="Pgpool" ["postgres"]="Postgres" ["proxysql"]="ProxySQL"
["rabbitmq"]="RabbitMQ" ["redis"]="Redis" ["singlestore"]="Singlestore" ["solr"]="Solr" ["zookeeper"]="ZooKeeper")
["rabbitmq"]="RabbitMQ" ["redis"]="Redis" ["singlestore"]="Singlestore" ["solr"]="Solr" ["zookeeper"]="ZooKeeper" ["mssqlserver"]="MSSQLServer")

# export the ENVs from .env file
if [ -f .env ]; then
Expand Down Expand Up @@ -77,8 +77,13 @@ create_db_dependencies() {
kubectl wait --for=jsonpath='{.status.phase}'=Ready ConnectCluster connectcluster -n demo --timeout=10m

kubectl apply -f ../samples/kafka/connectcluster/monitoring/file-source.yaml
sleep 2s
fi

if [ "$folder" == "redis" ]; then
kubectl apply -f ../samples/redis/monitoring/sentinel.yaml
kubectl wait --for=jsonpath='{.status.phase}'=Ready RedisSentinel sentinel -n demo --timeout=10m
fi
sleep 2s
}

cleanup() {
Expand All @@ -97,7 +102,7 @@ check_dashboard_for_non_dbs() {
for file in "${inside_files_array[@]}"; do
if [[ $file == *.json ]]; then
dashboard_name="${file::-5}"
echo "checking for dashboard $dashboard_name"
echo "checking for dashboard $dashboard_name"
url="https://raw.githubusercontent.com/appscode/grafana-dashboards/master/$folder/$file"
echo "$HOME/go/bin/kubectl-dba monitor dashboard -u $url -o=true --prom-svc-name=prometheus-kube-prometheus-prometheus --prom-svc-namespace=monitoring --prom-svc-port=9090"
$HOME/go/bin/kubectl-dba monitor dashboard -u $url -d=false --prom-svc-name=prometheus-kube-prometheus-prometheus --prom-svc-namespace=monitoring --prom-svc-port=9090
Expand All @@ -107,7 +112,7 @@ check_dashboard_for_non_dbs() {

wait_for_prometheus_target() {
target="$1"
echo "checking if $target-stats target exist in prometheus..."
echo "checking if $target-stats target exist in prometheus...."
for (( i=1; i<=600; i++ )); do
# Curl the Prometheus API to get the targets and extract the pool information
Targets=$(curl -s http://localhost:9090/api/v1/targets | jq -r '.data.activeTargets[] | .labels.service')
Expand Down

0 comments on commit 5893cdf

Please sign in to comment.