Skip to content

Commit

Permalink
not sure how gh action docker networks work but let's see
Browse files Browse the repository at this point in the history
  • Loading branch information
danielt-ent committed Dec 28, 2023
1 parent 298b693 commit 0f74eb8
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,21 @@ jobs:
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

test:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Compose up
shell: bash
id: compose-up
run: |
docker compose up -d
- name: Test
shell: bash
run: |
./test.sh
7 changes: 7 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ services:
environment:
- SPRING_PROFILES_ACTIVE=postgres,o11y,file
- POSTGRES_URL=jdbc:postgresql://postgres/petclinic
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/actuator/health" ]
timeout: 5s
retries: 3
ports:
- "8080:8080"
networks:
Expand Down Expand Up @@ -65,11 +69,14 @@ services:
image: grafana/tempo:latest
container_name: tempo
command: [ "-config.file=/etc/tempo.yaml" ]
# tempo seems to take 30s to shutdown. Who's got that much time?
stop_grace_period: 2s
volumes:
- ./compose/config/tempo-local.yaml:/etc/tempo.yaml
- tempo_data:/tmp/tempo
ports:
- "9411:9411" # zipkin
- "3200:3200" # http
promtail:
image: grafana/promtail:latest
container_name: promtail
Expand Down
4 changes: 3 additions & 1 deletion compose/config/grafana-datasources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090
uid: prometheus
url: http://prometheus:9090
isDefault: true
access: proxy
editable: true
Expand Down Expand Up @@ -57,6 +58,7 @@ datasources:
enabled: true
- name: Loki
type: loki
uid: loki
access: proxy
orgId: 1
url: http://loki:3100
Expand Down
9 changes: 9 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

until curl -sSfo /dev/null http://localhost:3000/api/datasources/uid/prometheus/health; do echo Waiting for Grafana; sleep 1; done
curl -sSfo /dev/null http://localhost:3000/api/datasources/uid/loki/health
curl -sSfo /dev/null http://localhost:8080/actuator/health
#docker compose ps --services --status running |grep tempo
# tempo datasource health checks in grafana aren't supported as of now so just check ingester readiness
until curl -sSfo /dev/null http://localhost:3200/ready; do echo Waiting for Tempo; sleep 1; done

0 comments on commit 0f74eb8

Please sign in to comment.