Skip to content

Commit

Permalink
Tests docker run
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud DEMARCQ authored and Arnaud DEMARCQ committed Nov 13, 2024
1 parent db46624 commit 1153fa4
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/docker_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

name: Test Dockerd

on:
push:
branches:
- '**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: List things
run: |
cd docker_run
docker compose create
dokcer compose run
31 changes: 31 additions & 0 deletions docker_run/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
database:
image: ghcr.io/baosystems/postgis:12-3.3
ports:
- 127.0.0.1:5432:5432
environment:
POSTGRES_USER: dhis
POSTGRES_DB: dhis
POSTGRES_PASSWORD: &postgres_password dhis
PGPASSWORD: *postgres_password # needed by psql in healthcheck
healthcheck:
test: ["CMD-SHELL", "psql --no-password --quiet --username $$POSTGRES_USER postgres://127.0.0.1/$$POSTGRES_DB -p 5432 --command \"SELECT 'ok'\" > /dev/null"]
start_period: 120s
interval: 1s
timeout: 3s
retries: 5

prometheusdbexporter:
image: simpledotorg/prometheusdbexporter:ademarcq-13779.239
ports:
- 127.0.0.1:8080:8080
environment:
TODO: tada
TIDI: tudu
POSTGRES_PASSWORD: &postgres_password dhis
PGPASSWORD: *postgres_password # needed by psql in healthcheck
volumes:
- ./target/tmp:/tmp
- ./sources:/app/rtsl/prom_db_exporter/sources


13 changes: 13 additions & 0 deletions docker_run/sources/heartbeat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"asynch": false,
"type": "sql",
"name": "dbHeartbeat",
"query": "select 1 as value, 'database' as source;",
"metrics": [{
"metricName": "postgres_heartbeat",
"metricValueKey": "value",
"labelsKeys": {
"source": "source"
}
}]
}
14 changes: 14 additions & 0 deletions docker_run/sources/sessions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"asynch": false,
"type": "sql",
"name": "getSessionInfo",
"query": "select application_name, count(*) as value from pg_stat_activity group by application_name",
"metrics": [{
"metricName": "postgres_sessions_per_application_count",
"metricValueKey": "value",
"labelsKeys": {
"application_name": "application_name"
}
}]
}

15 changes: 15 additions & 0 deletions docker_run/sources/tracked_entities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"asynch": true,
"type": "sql",
"cron": "* * * * *",
"name": "DHIS2_Trackedentityinstance",
"query": "select trackedentityinstance.trackedentitytypeid, trackedentitytype.name, count(*) as value from trackedentityinstance left outer join trackedentitytype on trackedentityinstance.trackedentitytypeid = trackedentitytype.trackedentitytypeid group by trackedentityinstance.trackedentitytypeid, trackedentitytype.name",
"metrics": [{
"metricName": "dhis2_trackedentityinstance_count",
"metricValueKey": "value",
"labelsKeys": {
"trackedentitytypeid": "trackedentitytypeid",
"name": "name"
}
}]
}

0 comments on commit 1153fa4

Please sign in to comment.