Files
ccs/.github/workflows/smoke-test-compose-url.yml
T
Kai (Tam Nhu) Tran 28f08cbb50 docs(docker): document ccs-net contract for sibling containers (#1259)
Add "Connect your app to CLIProxy" section to docker/README.md with:
- Public contract table (network=ccs-net, service DNS=ccs, ports 8317/3000)
- Pattern A: same compose file with external network reference
- Pattern B: docker run --network ccs-net
- Troubleshooting subsection (DNS, missing network, conflict, Podman, MTU)

Add one-line link in README.md pointing to the new section.
Add CHANGELOG entry under Unreleased noting the contract as SemVer-major stable.
Add CONTRIBUTING.md note that changing services.ccs or networks.ccs-net requires major bump.
2026-05-16 12:46:33 -04:00

77 lines
2.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Smoke Test – ccs.kaitran.ca/docker-compose.yaml
on:
release:
types:
- published
schedule:
# Nightly at 07:00 UTC
- cron: "0 7 * * *"
workflow_dispatch:
inputs:
do_up:
description: >
Also run `docker compose up -d`, wait for healthcheck, curl ports, then
`docker compose down -v`. Skipped by default (parse-only).
required: false
type: boolean
default: false
jobs:
smoke-test:
name: curl + parse (+ optional up/down)
runs-on: [self-hosted, linux, x64, cliproxy]
steps:
- name: Download compose from canonical URL
run: |
curl -fsSL https://ccs.kaitran.ca/docker-compose.yaml -o /tmp/ccs-compose.yaml
echo "--- downloaded compose ---"
cat /tmp/ccs-compose.yaml
- name: Validate compose parses (docker compose config)
run: docker compose -f /tmp/ccs-compose.yaml config
- name: Bring stack up, verify healthcheck, tear down
if: ${{ github.event_name == 'workflow_dispatch' && inputs.do_up == true }}
run: |
set -euo pipefail
docker compose -f /tmp/ccs-compose.yaml up -d
echo "Waiting for healthcheck to pass (max 90s)..."
for i in $(seq 1 18); do
STATUS=$(docker compose -f /tmp/ccs-compose.yaml ps --format json \
| python3 -c "import sys,json; data=sys.stdin.read().strip(); rows=json.loads('['+','.join(data.splitlines())+']') if data else []; print(next((r.get('Health','') for r in rows if 'ccs' in r.get('Service','')), 'unknown'))" 2>/dev/null || echo "unknown")
echo "Health: $STATUS"
if [ "$STATUS" = "healthy" ]; then
break
fi
sleep 5
done
# Verify ports respond
curl -fsSL --retry 3 --retry-delay 2 http://localhost:3000 -o /dev/null || \
{ echo "[X] Dashboard port 3000 did not respond"; docker compose -f /tmp/ccs-compose.yaml down -v; exit 1; }
curl -fsSL --retry 3 --retry-delay 2 http://localhost:8317 -o /dev/null || \
{ echo "[X] CLIProxy port 8317 did not respond"; docker compose -f /tmp/ccs-compose.yaml down -v; exit 1; }
echo "[OK] Both ports healthy"
docker compose -f /tmp/ccs-compose.yaml down -v
- name: Verify ccs-net network contract (sibling DNS resolution)
if: ${{ github.event_name == 'workflow_dispatch' && inputs.do_up == true }}
run: |
set -euo pipefail
# Checkout repo so tests/docker/network-contract.sh is available
# The script needs to run from a directory that contains docker/compose.yaml.
# We re-use the compose file from the repo rather than /tmp to avoid path drift.
REPO_ROOT="$(mktemp -d)"
git clone --depth=1 --no-tags \
"https://github.com/kaitranntt/ccs.git" "$REPO_ROOT"
cd "$REPO_ROOT"
bash tests/docker/network-contract.sh