Add streaming precompute engine: sketch-based windowed aggregation over Prometheus/VictoriaMetrics remote write #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Builds | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+*' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'asap-common/installation/**' | |
| - 'asap-planner/**' | |
| - 'asap-sketch-ingest/**' | |
| - 'asap-query-engine/**' | |
| - 'asap-tools/queriers/prometheus-client/**' | |
| - '.github/workflows/docker.yml' | |
| workflow_dispatch: | |
| permissions: | |
| packages: write | |
| contents: read | |
| jobs: | |
| build-images: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # --- Base image (Python, fast) --- | |
| - name: Build base image | |
| run: | | |
| docker build \ | |
| -t sketchdb-base:latest \ | |
| -f asap-common/installation/Dockerfile \ | |
| asap-common | |
| - name: Push base image | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| docker tag sketchdb-base:latest ghcr.io/projectasap/asap-base:${{ github.ref_name }} | |
| docker tag sketchdb-base:latest ghcr.io/projectasap/asap-base:latest | |
| docker push ghcr.io/projectasap/asap-base:${{ github.ref_name }} | |
| docker push ghcr.io/projectasap/asap-base:latest | |
| # --- Planner (Python, depends on base) --- | |
| - name: Build planner image | |
| run: | | |
| docker build \ | |
| -t asap-planner:local \ | |
| -f asap-planner/Dockerfile \ | |
| asap-planner | |
| - name: Push planner image | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| docker tag asap-planner:local ghcr.io/projectasap/asap-planner:${{ github.ref_name }} | |
| docker tag asap-planner:local ghcr.io/projectasap/asap-planner:latest | |
| docker push ghcr.io/projectasap/asap-planner:${{ github.ref_name }} | |
| docker push ghcr.io/projectasap/asap-planner:latest | |
| # --- Sketch Ingest (Python, depends on base) --- | |
| - name: Build sketch-ingest image | |
| run: | | |
| docker build \ | |
| -t asap-sketch-ingest:local \ | |
| -f asap-sketch-ingest/Dockerfile \ | |
| asap-sketch-ingest | |
| - name: Push sketch-ingest image | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| docker tag asap-sketch-ingest:local ghcr.io/projectasap/asap-sketch-ingest:${{ github.ref_name }} | |
| docker tag asap-sketch-ingest:local ghcr.io/projectasap/asap-sketch-ingest:latest | |
| docker push ghcr.io/projectasap/asap-sketch-ingest:${{ github.ref_name }} | |
| docker push ghcr.io/projectasap/asap-sketch-ingest:latest | |
| # --- Prometheus Client (Python, depends on base) --- | |
| - name: Build prometheus-client image | |
| run: | | |
| docker build \ | |
| -t asap-prometheus-client:local \ | |
| -f asap-tools/queriers/prometheus-client/Dockerfile \ | |
| asap-tools/queriers/prometheus-client | |
| - name: Push prometheus-client image | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| docker tag asap-prometheus-client:local ghcr.io/projectasap/asap-prometheus-client:${{ github.ref_name }} | |
| docker tag asap-prometheus-client:local ghcr.io/projectasap/asap-prometheus-client:latest | |
| docker push ghcr.io/projectasap/asap-prometheus-client:${{ github.ref_name }} | |
| docker push ghcr.io/projectasap/asap-prometheus-client:latest | |
| # --- Query Engine (Rust, slow — uses GHCR layer cache) --- | |
| - name: Build and push query-engine | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: asap-query-engine/Dockerfile | |
| push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| tags: | | |
| ghcr.io/projectasap/asap-query-engine:${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'pr-test' }} | |
| ghcr.io/projectasap/asap-query-engine:latest | |
| cache-from: type=registry,ref=ghcr.io/projectasap/asap-query-engine:buildcache | |
| cache-to: type=registry,ref=ghcr.io/projectasap/asap-query-engine:buildcache,mode=max |