From 05bcbf01cd2ef48c4ed3bbf2a9c32a3531f9ed4c Mon Sep 17 00:00:00 2001 From: Francesco Beneventi Date: Mon, 23 Dec 2024 16:55:15 +0100 Subject: [PATCH 1/6] Add: installation test workflow --- .github/workflows/installation-test.yml | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/installation-test.yml diff --git a/.github/workflows/installation-test.yml b/.github/workflows/installation-test.yml new file mode 100644 index 0000000..2036e94 --- /dev/null +++ b/.github/workflows/installation-test.yml @@ -0,0 +1,55 @@ +name: Installation Test + +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop + +jobs: + test-installation: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker + uses: docker/setup-buildx-action@v3 + + - name: Create Docker services + run: | + docker compose up -d + # Wait for services to be healthy + sleep 30 + + - name: Check Docker containers status + run: | + # Check if all containers are running + if [ "$(docker compose ps --status running | wc -l)" -lt 2 ]; then + echo "Not all containers are running. Current status:" + docker compose ps + docker compose logs + exit 1 + fi + + - name: Test Grafana accessibility + run: | + # Wait for Grafana to be ready + timeout 60s bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3000)" != "200" ]]; do sleep 5; done' || exit 1 + + - name: Test MQTT broker + run: | + # Install mosquitto-clients for MQTT testing + sudo apt-get update && sudo apt-get install -y mosquitto-clients + + # Test MQTT connection + mosquitto_sub -h localhost -p 1883 -t test_topic -C 1 & + mosquitto_pub -h localhost -p 1883 -t test_topic -m "test message" + + - name: Cleanup + if: always() + run: docker compose down \ No newline at end of file From edf5aefd43314061e4afe1aa3b5c5951300bde4b Mon Sep 17 00:00:00 2001 From: Francesco Beneventi Date: Mon, 23 Dec 2024 17:08:42 +0100 Subject: [PATCH 2/6] fix: improve OS/docker compatibility --- docker/kairosdb/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/kairosdb/Dockerfile b/docker/kairosdb/Dockerfile index 7535fe8..16ab7c6 100644 --- a/docker/kairosdb/Dockerfile +++ b/docker/kairosdb/Dockerfile @@ -33,6 +33,7 @@ ADD kairosdb-env.sh /opt/kairosdb/bin/kairosdb-env.sh EXPOSE 4242 8083 2003 ADD config-kairos.sh /usr/bin/config-kairos.sh +RUN chmod +x /usr/bin/config-kairos.sh # Run kairosdb in foreground on boot CMD ["/usr/bin/config-kairos.sh"] From 595d0e777898832a77f2227b4f9685f23a0a8fe2 Mon Sep 17 00:00:00 2001 From: Francesco Beneventi Date: Mon, 23 Dec 2024 17:21:52 +0100 Subject: [PATCH 3/6] fix: grafana code in wworkflow --- .github/workflows/installation-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/installation-test.yml b/.github/workflows/installation-test.yml index 2036e94..32f466d 100644 --- a/.github/workflows/installation-test.yml +++ b/.github/workflows/installation-test.yml @@ -9,7 +9,7 @@ on: branches: - master - develop - + jobs: test-installation: runs-on: ubuntu-latest @@ -39,7 +39,7 @@ jobs: - name: Test Grafana accessibility run: | # Wait for Grafana to be ready - timeout 60s bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3000)" != "200" ]]; do sleep 5; done' || exit 1 + timeout 60s bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3000)" != "302" ]]; do sleep 5; done' || exit 1 - name: Test MQTT broker run: | From ac7e426db576db094fe9e17eae9934a6f39d503d Mon Sep 17 00:00:00 2001 From: Francesco Beneventi Date: Mon, 23 Dec 2024 18:06:45 +0100 Subject: [PATCH 4/6] fix: renamed workflow --- .github/workflows/installation-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/installation-test.yml b/.github/workflows/installation-test.yml index 32f466d..e09f8a6 100644 --- a/.github/workflows/installation-test.yml +++ b/.github/workflows/installation-test.yml @@ -1,4 +1,4 @@ -name: Installation Test +name: Build on: push: From c80f64233993fcff4e9900234c008a2c44427a12 Mon Sep 17 00:00:00 2001 From: Francesco Beneventi Date: Mon, 23 Dec 2024 18:13:41 +0100 Subject: [PATCH 5/6] Add: badge in readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 53cf43d..3257a8e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Examon HPC Monitoring +[![Build Status](https://github.com/ExamonHPC/examon/actions/workflows/installation-test.yml/badge.svg?branch=develop)](https://github.com/ExamonHPC/examon/actions/workflows/installation-test.yml) + A highly scalable framework for the performance and energy monitoring of HPC servers ## Setup From 49e49ff368a2a9aad9bfa7dcb45a93e56b161e34 Mon Sep 17 00:00:00 2001 From: Francesco Beneventi Date: Mon, 23 Dec 2024 18:50:04 +0100 Subject: [PATCH 6/6] Add: test for KairosDB accessibility in installation workflow --- .github/workflows/installation-test.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/installation-test.yml b/.github/workflows/installation-test.yml index e09f8a6..02f5aaf 100644 --- a/.github/workflows/installation-test.yml +++ b/.github/workflows/installation-test.yml @@ -41,6 +41,15 @@ jobs: # Wait for Grafana to be ready timeout 60s bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3000)" != "302" ]]; do sleep 5; done' || exit 1 + - name: Test KairosDB accessibility + run: | + # Wait for KairosDB to be ready + timeout 60s bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8083/api/v1/health/check)" != "204" ]]; do + echo "Waiting for KairosDB..." + sleep 5 + done' || exit 1 + echo "KairosDB is healthy" + - name: Test MQTT broker run: | # Install mosquitto-clients for MQTT testing