diff --git a/.env.example b/.env.example index 197f437..edeec38 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ # Barbacane image version to pull from ghcr.io/barbacane-dev -# The playground needs 1.0.0-rc.1 or later. `latest` is the most recent stable +# The playground needs 1.0.0-rc.2 or later. `latest` is the most recent stable # release, which release candidates do not move. -BARBACANE_VERSION=1.0.0-rc.1 +BARBACANE_VERSION=1.0.0-rc.2 # Admin token for the control plane, at least 32 bytes: the control plane # refuses to start without one. This is a demo default: change it for any diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a63e90..9dce30f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,6 +72,27 @@ jobs: - name: Run the smoke test run: bash scripts/smoke.sh + # Every running service with a health check reports healthy: a check the + # image cannot run (a shell command in an image without a shell) fails + # here, though the smoke test reaches the service over HTTP. + - name: Check the health checks + run: | + for container in $(docker compose ps -q); do + name=$(docker inspect -f '{{.Name}}' "$container") + [ -n "$(docker inspect -f '{{if .State.Health}}yes{{end}}' "$container")" ] || continue + status= + for _ in $(seq 1 30); do + status=$(docker inspect -f '{{.State.Health.Status}}' "$container") + [ "$status" = healthy ] && break + sleep 3 + done + echo "$name: $status" + if [ "$status" != healthy ]; then + docker inspect -f '{{json .State.Health.Log}}' "$container" + exit 1 + fi + done + - name: Dump logs on failure if: failure() run: docker compose logs --no-color --tail 300 diff --git a/README.md b/README.md index f2bc993..3c0da55 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ That's it! The API specs are compiled and signed automatically before the gatewa ## Version -The playground pulls the Barbacane release `docker-compose.yml` pins (`1.0.0-rc.1`) from [GitHub Container Registry](https://github.com/orgs/barbacane-dev/packages). It needs 1.0.0-rc.1 or later. To run another release, copy `.env.example` and set the version: +The playground pulls the Barbacane release `docker-compose.yml` pins (`1.0.0-rc.2`) from [GitHub Container Registry](https://github.com/orgs/barbacane-dev/packages). It needs 1.0.0-rc.2 or later. To run another release, copy `.env.example` and set the version: ```bash cp .env.example .env diff --git a/docker-compose.yml b/docker-compose.yml index 2ac0cab..3f9e24e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,7 @@ services: # public key goes to trusted_key, which the gateway pins. The key survives # restarts; removing the volumes replaces it. keygen: - image: ghcr.io/barbacane-dev/barbacane-standalone:${BARBACANE_VERSION:-1.0.0-rc.1} + image: ghcr.io/barbacane-dev/barbacane-standalone:${BARBACANE_VERSION:-1.0.0-rc.2} user: "0:0" entrypoint: ["/bin/sh", "-c"] command: @@ -40,7 +40,7 @@ services: # Spec Compiler (init container - compiles specs before gateway starts) # ========================================================================== compiler: - image: ghcr.io/barbacane-dev/barbacane-standalone:${BARBACANE_VERSION:-1.0.0-rc.1} + image: ghcr.io/barbacane-dev/barbacane-standalone:${BARBACANE_VERSION:-1.0.0-rc.2} command: ["compile", "--spec", "/specs/train-travel-api.yaml", "--spec", "/specs/train-events.yaml", "--spec", "/specs/s3-proxy.yaml", "--spec", "/specs/waf-demo.yaml", "--manifest", "/manifest/barbacane.yaml", "--output", "/output/api.bca", "--allow-plaintext"] # Root, to write the shared artifact volume (root-owned) and read the # signing key (owner-only). The gateway mounts the artifact read-only. @@ -62,7 +62,7 @@ services: # API Gateway (Data Plane) # ========================================================================== barbacane: - image: ghcr.io/barbacane-dev/barbacane-standalone:${BARBACANE_VERSION:-1.0.0-rc.1} + image: ghcr.io/barbacane-dev/barbacane-standalone:${BARBACANE_VERSION:-1.0.0-rc.2} # serve loads only artifacts signed by the key BARBACANE_TRUSTED_PUBKEY # pins: here, the public key the keygen container wrote. # --admin-bind on 0.0.0.0 exposes the admin API (/health, /metrics, @@ -123,7 +123,7 @@ services: # Control Plane (REST API) # ========================================================================== control-plane: - image: ghcr.io/barbacane-dev/barbacane-control:${BARBACANE_VERSION:-1.0.0-rc.1} + image: ghcr.io/barbacane-dev/barbacane-control:${BARBACANE_VERSION:-1.0.0-rc.2} ports: - "9091:9090" # Control Plane API (Prometheus has 9090 on the host) environment: @@ -136,7 +136,8 @@ services: postgres: condition: service_healthy healthcheck: - test: ["CMD", "bash", "-c", "echo > /dev/tcp/localhost/9090"] + # The image has no shell: `barbacane-control health` calls GET /health. + test: ["CMD", "/usr/local/bin/barbacane-control", "health"] interval: 10s timeout: 5s retries: 5