From 242e6366c6396b9ec7f4dba4c765ec09b6327799 Mon Sep 17 00:00:00 2001 From: Facu de la Cruz Date: Mon, 12 Oct 2020 20:23:24 -0300 Subject: [PATCH] Improving documentation, fixing Docker images versions, enabling CI Update README.md Update docker-build.yml Update docker-build.yml Update docker-build.yml Update docker-build.yml --- .github/workflows/docker-build.yml | 37 ++++++++++++++++++++++ .pre-commit-config.yaml | 1 - CHANGELOG.md | 8 +++++ ISP-Checker/Makefile | 2 +- ISP-Checker/docker/docker-compose.yaml | 6 ++-- ISP-Checker/grafana/network-dashboard.json | 3 +- ISP-Checker/telegraf/Dockerfile | 8 +++-- ISP-Checker/telegraf/conf/telegraf.conf | 4 +-- README.md | 24 ++++++++++++-- 9 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..ca6d061 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,37 @@ +name: Build + +on: + push: + branches: + - master + - develop + +defaults: + run: + shell: bash + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Install Docker Buildx + id: buildx + uses: crazy-max/ghaction-docker-buildx@v1 + with: + version: latest + + - name: hub.docker.com Login + run: | + echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + + - name: Build the multi-arch image + run: | + docker buildx build \ + --push \ + --tag tty0/isp_telegraf:1.15.3 \ + --tag tty0/isp_telegraf:latest \ + --platform linux/amd64,linux/arm/v7,linux/arm64 ./ISP-Checker/telegraf/ + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11e59c4..43b87ac 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,6 @@ repos: - id: trailing-whitespace - id: detect-private-key - id: check-symlinks - - id: check-yaml - id: mixed-line-ending - id: pretty-format-json args: ["--autofix"] diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aee15b..ae0fa19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # CHANGELOG +## October 12 2020 - v1.2 +* Enabling CI build a multi-architecture Docker image (Extending support to `linux/amd64`, `linux/arm/v7`, `linux/arm64`) +* Fixing Docker images version on Docker Compose. +* Improving Dashboard look and feel. +* Updated `mtr` exeuction period for a best performance. +* Updated `speedtest-cli` execution period to reduce bandwith usage. +* Updated `README.md` + ## October 10 2020 - v1.1 * Updated Speedtest checks to run once per hour (before was every 5 minutes). diff --git a/ISP-Checker/Makefile b/ISP-Checker/Makefile index 51ea34f..7c2fc90 100755 --- a/ISP-Checker/Makefile +++ b/ISP-Checker/Makefile @@ -1,7 +1,7 @@ .PHONY: default install start stop restart prune NAME=ISP-Checker -VERSION=1.1 +VERSION=1.2 AUTHOR="Facu de la Cruz " COMPOSE_FILE="./docker/docker-compose.yaml" diff --git a/ISP-Checker/docker/docker-compose.yaml b/ISP-Checker/docker/docker-compose.yaml index 043d23e..127fc83 100644 --- a/ISP-Checker/docker/docker-compose.yaml +++ b/ISP-Checker/docker/docker-compose.yaml @@ -5,7 +5,7 @@ services: - "docker.group=ISP-Checker" - "docker.app=influxdb" container_name: influxdb - image: influxdb:latest + image: influxdb:1.8.3-alpine expose: - 8086 restart: on-failure @@ -20,7 +20,7 @@ services: - "docker.group=ISP-Checker" - "docker.app=telegraf" container_name: telegraf - image: tty0/isp_telegraf:latest + image: tty0/isp_telegraf:1.15.3 volumes: - "../telegraf/conf/telegraf.conf:/etc/telegraf/telegraf.conf" env_file: @@ -34,7 +34,7 @@ services: - "docker.group=ISP-Checker" - "docker.app=grafana" container_name: grafana - image: grafana/grafana:latest + image: grafana/grafana:7.2.1-ubuntu environment: - GF_INSTALL_PLUGINS=https://grafana.com/api/plugins/gowee-traceroutemap-panel/versions/0.2.3/download;gowee-traceroutemap-panel expose: diff --git a/ISP-Checker/grafana/network-dashboard.json b/ISP-Checker/grafana/network-dashboard.json index 31f1adc..17b757c 100644 --- a/ISP-Checker/grafana/network-dashboard.json +++ b/ISP-Checker/grafana/network-dashboard.json @@ -5,7 +5,6 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "links": [], "panels": [ { "datasource": "InfluxDB", @@ -3612,7 +3611,7 @@ ] }, "time": { - "from": "now-30m", + "from": "now-1h", "to": "now" }, "timepicker": {}, diff --git a/ISP-Checker/telegraf/Dockerfile b/ISP-Checker/telegraf/Dockerfile index 456e55e..b01b227 100644 --- a/ISP-Checker/telegraf/Dockerfile +++ b/ISP-Checker/telegraf/Dockerfile @@ -1,7 +1,11 @@ -FROM telegraf:latest +FROM telegraf:1.15.3 + +ARG ARCH LABEL mantainer="Facu de la Cruz" -LABEL PROJECT="ISP_monitor" +LABEL email="fmdlc.unix@gmail.com" +LABEL project="ISP-Checker" +LABEL component="telegraf" COPY ./bin/entrypoint.sh /entrypoint.sh diff --git a/ISP-Checker/telegraf/conf/telegraf.conf b/ISP-Checker/telegraf/conf/telegraf.conf index e0b95c8..ca5c599 100644 --- a/ISP-Checker/telegraf/conf/telegraf.conf +++ b/ISP-Checker/telegraf/conf/telegraf.conf @@ -89,7 +89,7 @@ [[inputs.exec]] commands=["mtr -C google.com s3-website.ap-northeast-2.amazonaws.com s3-website.eu-central-1.amazonaws.com s3-website.af-south-1.amazonaws.com"] timeout = "3m" - interval = "10m" + interval = "7m" data_format = "csv" csv_skip_rows = 1 csv_column_names=[ "", "", "status","dest","hop","ip","loss","","", "","avg","best","worst","stdev"] @@ -100,7 +100,7 @@ commands = ["/usr/bin/speedtest-cli --csv --bytes"] name_override = "speedtest" timeout = "3m" - interval = "10m" + interval = "15m" data_format = "csv" csv_column_names = ['Server ID','Sponsor','Server Name','Timestamp','Distance','Ping','Download','Upload','Share','IP Address'] csv_timestamp_column = "Timestamp" diff --git a/README.md b/README.md index 3833c71..619a536 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,30 @@ It's easily extensible and it was built on top of [Docker](http://docker.com) to Feel free to reach me out for any feedback or ideas! :-) +## Table of contents + +1. [ Platforms ](#Platforms) +2. [ Download ](#Grafana) +3. [ Configuration ](#Configuration) +5. [ Installation ](#Installation) +6. [ Login ](#Login) +7. [ Removing ](#Removing) +8. [ Concepts ](#Cooncepts) +12. [ ToDo ](#ToDo) +13. [ Contributing ](#Contributing) +14. [ License ](#License) +
-#### Grafana Cloud +#### Platforms +The following platforms are supported: +* `linux/amd64`. +* `linux/arm/v7`, +* `linux/arm64`. +#### Download You can easily import this dashboard into your current Grafana installation getting it from the Official's [Grafana repository](https://grafana.com/grafana/dashboards/13140). ### Configuration @@ -29,8 +47,6 @@ Make sure you have the [Docker-CE](https://phoenixnap.com/kb/docker-on-raspberry ```bash $ curl -fsSL https://get.docker.com -o get-docker.sh | bash - ``` - -#### Preflight setup Configure the `./ISP-Checker/credentials.env` file. There are two users: * Read-Only user: Used by Grafana to acccess to metrics @@ -94,6 +110,8 @@ To remove run `make prune`. > It will remove all stopped containers (yes, not only the ISP-Checker ones). --- +## Concepts + ### Bandwith Bandwidth is the maximum rate of data transfer across a given path. Bandwidth may be characterized as network bandwidth or data bandwidth. The difference between internet speed and bandwidth can be summed in one line. Internet bandwidth is about how much data can be download or uploaded from your computer, while internet speed is how fast can the data be uploaded or downloaded on your computer.