diff --git a/.github/workflows/installation-test.yml b/.github/workflows/installation-test.yml new file mode 100644 index 00000000..02f5aaf4 --- /dev/null +++ b/.github/workflows/installation-test.yml @@ -0,0 +1,64 @@ +name: Build + +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)" != "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 + 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 diff --git a/README.md b/README.md index 53cf43dc..3257a8e0 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 diff --git a/docker/kairosdb/Dockerfile b/docker/kairosdb/Dockerfile index 7535fe84..16ab7c67 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"]