mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 08:17:11 +00:00
* fix(docker): parameterize image with CCS_IMAGE env so smoke-test exercises new digest
docker/compose.yaml hardcoded image: ghcr.io/kaitranntt/ccs:latest, causing
network-contract.sh to always use the old published image regardless of what
IMAGE_OVERRIDE was passed. Switching to \${CCS_IMAGE:-ghcr.io/kaitranntt/ccs:latest}
lets CI pass CCS_IMAGE=<digest> so the smoke-test actually exercises the
just-built image. Default end-user behaviour is unchanged.
Resolves REV4 (reviewer loop 2, PR #1261).
* fix(test): image-size.sh fails loudly on manifest inspection failure
The --platform branch previously exited 0 when imagetools inspect returned
empty or zero bytes, silently passing the budget check. A broken image
could reach production undetected if buildx had any inspection issue.
Changed to exit 1 with a clear diagnostic message explaining possible causes
(old buildx, manifest format mismatch, image not yet pushed). No --allow-inspect-failure
escape hatch is provided; CI must fix the root cause.
Resolves REV5 (reviewer loop 2, PR #1261).
* test(docker): cover --platform branch in image-size-logic tests
Prior tests only exercised the local docker image inspect path. The
--platform branch (imagetools inspect) had zero coverage, meaning the
REV5 silent-pass regression would not have been caught by CI.
Added 5 mock-based test cases for the --platform branch:
- pass when platform-scoped compressed size < budget
- fail when platform-scoped compressed size > budget
- fail (exit 1) when imagetools inspect errors (REV5 guard)
- fail (exit 1) when reported size is "0" (REV5 guard)
- fail (exit 1) when size output is empty (REV5 guard)
Mocks follow the existing pattern (override docker in PATH with a temp
wrapper), extended to handle buildx imagetools inspect subcommand.
Resolves REV6 (reviewer loop 2, PR #1261).
* fix(test): compose-parity image_name() handles \${VAR:-default} syntax
After parameterizing compose.yaml's image field with \${CCS_IMAGE:-...},
the image_name() sed pipeline cut at the first colon in the shell variable
syntax (:-) instead of the tag separator, returning '\${CCS_IMAGE' and
failing the kaitranntt/ccs grep.
Added a sed step to unwrap \${VAR:-default} by extracting just the default
value before stripping the tag. Existing plain image: name:tag references
are unaffected.
61 lines
2.0 KiB
YAML
61 lines
2.0 KiB
YAML
# Canonical CCS docker-compose. Served at https://ccs.kaitran.ca/docker-compose.yaml.
|
|
# Source of truth: kaitranntt/ccs:docker/compose.yaml
|
|
#
|
|
# Quick start:
|
|
# curl -fsSL https://ccs.kaitran.ca/docker-compose.yaml -o compose.yaml
|
|
# docker compose up -d
|
|
#
|
|
# Ports:
|
|
# 3000 — CCS Dashboard
|
|
# 8317 — CLIProxy API
|
|
#
|
|
# restart: unless-stopped ensures the container restarts automatically on
|
|
# system reboot or crash, but honours a deliberate `docker compose stop`.
|
|
|
|
services:
|
|
ccs:
|
|
image: ${CCS_IMAGE:-ghcr.io/kaitranntt/ccs:latest}
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:3000"
|
|
- "8317:8317"
|
|
volumes:
|
|
# /root/.ccs matches the HOME used inside the integrated image.
|
|
# entrypoint-integrated.sh runs as root (supervisord user=root) and
|
|
# explicitly mkdir -p /root/.ccs, so state always lands here.
|
|
# Note: docker/entrypoint.sh (legacy dashboard image) uses a different
|
|
# default — it does NOT apply to this integrated image.
|
|
- ccs_home:/root/.ccs
|
|
- ccs_logs:/var/log/ccs
|
|
networks:
|
|
- ccs-net
|
|
healthcheck:
|
|
# Probes both Dashboard (:3000) and CLIProxy (:8317) before reporting
|
|
# healthy — a container with only one service running is not considered
|
|
# ready. Uses a 4.5s internal timeout to stay well within the 5s Docker
|
|
# timeout budget.
|
|
test:
|
|
- "CMD-SHELL"
|
|
- >
|
|
node -e "
|
|
const http = require('http');
|
|
let pending = 2; let ok = true;
|
|
const check = (port) => http.get('http://127.0.0.1:'+port+'/', r => {
|
|
if (r.statusCode >= 500) ok = false;
|
|
if (--pending === 0) process.exit(ok ? 0 : 1);
|
|
}).on('error', () => { ok = false; if (--pending === 0) process.exit(1); });
|
|
check(3000); check(8317);
|
|
setTimeout(() => process.exit(1), 4500);
|
|
"
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
volumes:
|
|
ccs_home:
|
|
ccs_logs:
|
|
|
|
networks:
|
|
ccs-net:
|
|
name: ccs-net
|