diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4427caf..f1cd59a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,12 +13,12 @@ on: folders: description: 'Folders' required: true - default: 'mongodb' + default: 'mysql' type: string 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 @@ -34,11 +34,11 @@ jobs: - name: Defaulter id: defaulter env: - FOLDERS: "mongodb" + FOLDERS: "mysql" 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 "folders=${FOLDERS:-mysql}" >> $GITHUB_OUTPUT + echo "kubedb_version=${KUBEDB_VERSION:-v2024.8.21}" >> $GITHUB_OUTPUT test: name: Test runs-on: ubuntu-latest @@ -114,6 +114,7 @@ jobs: CLUSTER_UID=$(kubectl get ns kube-system -o=jsonpath='{.metadata.uid}') curl -X POST -o /tmp/kubedb-license.txt -d "name=1gtm&email=1gtm@appscode.com&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=1gtm@appscode.com&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: | @@ -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 @@ -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: diff --git a/hack/scripts/check-dashboard.sh b/hack/scripts/check-dashboard.sh index c1b640b..98b86a9 100644 --- a/hack/scripts/check-dashboard.sh +++ b/hack/scripts/check-dashboard.sh @@ -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 @@ -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() { @@ -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 @@ -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') @@ -123,6 +128,8 @@ wait_for_prometheus_target() { kubectl create ns demo +sleep 5h + for folder in "${folder_array[@]}"; do if [[ -v kind["$folder"] ]]; then echo "db name: $folder"