diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 4bd72eb5..fd1f1646 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -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 @@ -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 \ No newline at end of file diff --git a/dev/local/ch-compliance/docker-compose.ci.yml b/dev/local/ch-compliance/docker-compose.ci.yml new file mode 100644 index 00000000..597959a1 --- /dev/null +++ b/dev/local/ch-compliance/docker-compose.ci.yml @@ -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 +