Skip to content

Commit

Permalink
ci(compliance): split compose
Browse files Browse the repository at this point in the history
Updates: #251
  • Loading branch information
ernado committed Dec 9, 2023
1 parent fca34b4 commit b79e6cd
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 19 deletions.
24 changes: 5 additions & 19 deletions .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,13 @@ jobs:

- uses: actions/checkout@v4

- name: Go build
env:
CGO_ENABLED: 0
run: go build -v ./cmd/oteldb

- name: Image
uses: docker/build-push-action@v5
with:
context: .
file: deploy.Dockerfile
push: false
tags: ghcr.io/go-fater/oteldb
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build docker-compose
# Before the cache, it was "run: docker compose build".
working-directory: dev/local/ch-compliance
run: docker buildx bake --file docker-compose.ci.yml --file docker-compose-cache.json

- name: Start
run: docker compose up -d
run: docker compose up -f docker-compose.ci.yml -d
working-directory: dev/local/ch-compliance

- name: Wait
Expand All @@ -91,7 +81,3 @@ jobs:
- name: Verify
working-directory: dev/local/ch-compliance
run: go run ./cmd/compliance-verify --target 99.60 result.oteldb.json

- name: Cleanup
working-directory: dev/local/ch-compliance
run: docker compose down -t 1 -v
51 changes: 51 additions & 0 deletions dev/local/ch-compliance/docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: "3"

services:
clickhouse:
image: clickhouse/clickhouse-server:23.10
ports:
- "9000:9000"
- "8123:8123"
volumes:
- ./clickhouse.xml:/etc/clickhouse-server/config.d/monitoring.xml
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', '127.0.0.1:8123/ping']
interval: 1s
timeout: 1s
retries: 30

oteldb:
image: ghcr.io/go-fater/oteldb
build:
context: ../../../
dockerfile: deploy.Dockerfile
environment:
- OTELDB_STORAGE=ch
- CH_DSN=clickhouse://clickhouse:9000
- OTEL_LOG_LEVEL=info
- OTEL_TRACES_EXPORTER=none
- OTEL_METRICS_EXPORTER=none
- OTEL_LOGS_EXPORTER=stdout
- OTEL_RESOURCE_ATTRIBUTES=service.name=go-faster.oteldb
ports:
- "9090:9090"
depends_on:
- clickhouse

prometheus:
image: prom/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
volumes:
- './prometheus.yml:/etc/prometheus/prometheus.yml'
ports:
- "9091:9090"
restart: unless-stopped

demo-1:
image: julius/prometheus-demo-service:latest
demo-2:
image: julius/prometheus-demo-service:latest
demo-3:
image: julius/prometheus-demo-service:latest

0 comments on commit b79e6cd

Please sign in to comment.