31 Commits

Author SHA1 Message Date
Bas Nijholt
bebe5b34ba Merge snapshot into sync command
The sync command now performs both operations:
- Discovers running services and updates state.yaml
- Captures image digests and updates dockerfarm-log.toml

Removes the standalone snapshot command to keep the API simple.
v0.4.0
2025-12-13 16:53:49 -08:00
Bas Nijholt
5d21e64781 Add sync command to discover running services and update state
The sync command queries all hosts to find where services are actually
running and updates the state file to match reality. Supports --dry-run
to preview changes without modifying state. Useful for initial setup
or after manual changes.
v0.3.0
2025-12-13 15:58:29 -08:00
Bas Nijholt
114c7b6eb6 Add check_service_running for discovering running services
Adds a helper function to check if a service has running containers
on a specific host by executing `docker compose ps --status running -q`.
2025-12-13 15:58:29 -08:00
Bas Nijholt
20e281a23e Add tests for state module
Tests cover load, save, get, set, and remove operations
for service deployment state tracking.
2025-12-13 15:58:29 -08:00
Bas Nijholt
ec33d28d6c Add auto-migration support to up/down commands
- up: Detects if service is deployed on a different host and
  automatically runs down on the old host before up on the new
- down: Removes service from state tracking after successful stop
- Enables seamless service migration by just changing the config
2025-12-13 15:58:29 -08:00
Bas Nijholt
a818b7726e Add run_compose_on_host for cross-host operations
Allows running compose commands on a specific host rather than
the configured host for a service. Used for migration when
stopping a service on the old host before starting on the new.
2025-12-13 15:58:29 -08:00
Bas Nijholt
cead3904bf Add state module for tracking deployed services
Tracks which host each service is deployed on in
~/.config/compose-farm/state.yaml. This enables automatic
migration when a service's host assignment changes.
2025-12-13 15:58:29 -08:00
Bas Nijholt
8f5e14d621 Fix pre-commit issues 2025-12-13 14:54:28 -08:00
Bas Nijholt
ea220058ec Support multiple compose filename conventions
Try compose.yaml, compose.yml, docker-compose.yml, and
docker-compose.yaml when locating compose files for a service.
v0.2.0
2025-12-13 14:52:43 -08:00
basnijholt
b5773a3f7f chore(docs): update TOC v0.1.0 2025-12-13 22:43:47 +00:00
Bas Nijholt
37300b4a8d Add .DS_Store to gitignore 2025-12-13 14:43:18 -08:00
Bas Nijholt
501c69184e Add --version/-v flag to CLI 2025-12-13 14:43:12 -08:00
Bas Nijholt
8cff744c08 Add hatch-vcs for automatic version management
Version is now derived from git tags instead of hardcoded.
2025-12-13 14:42:37 -08:00
Bas Nijholt
6133174f94 Add more workflows 2025-12-13 14:39:37 -08:00
Bas Nijholt
1f34fb844d Refactor Traefik generator for clarity 2025-12-13 10:04:15 -08:00
Bas Nijholt
7d0f829895 Add Traefik file-provider generator and docs 2025-12-13 09:51:43 -08:00
Bas Nijholt
d432667584 docs(CLAUDE.md): rename Development Notes to Communication Notes in CLAUDE.md 2025-12-11 11:27:22 -08:00
Bas Nijholt
0f2499038d Organization improvements (#2) 2025-12-11 11:25:23 -08:00
Bas Nijholt
896a096ced Merge pull request #1 from basnijholt/feature/dockerfarm-snapshot-log
feature/dockerfarm snapshot log
2025-12-11 10:52:30 -08:00
Bas Nijholt
9ce930b6e3 Add .envrc 2025-12-11 10:48:53 -08:00
Bas Nijholt
8998e10179 Add snapshot command to log compose image digests 2025-12-11 10:28:25 -08:00
Bas Nijholt
f4973f7cc3 refactor(docs): add AGENTS.md and GEMINI.md symlinks to CLAUDE.md 2025-12-11 10:23:29 -08:00
Bas Nijholt
aaaf0b9323 Improve README: clarify shared storage assumption 2025-12-11 10:05:20 -08:00
Bas Nijholt
a1b16d988d Add GitHub Actions CI workflow 2025-12-11 10:03:00 -08:00
Bas Nijholt
68aab82ef9 Rename project from sdc to compose-farm
- Package: sdc → compose_farm
- CLI command: sdc → compose-farm
- Config file: sdc.yaml → compose-farm.yaml
- Config path: ~/.config/sdc/ → ~/.config/compose-farm/
- Updated all documentation, tests, and examples
2025-12-11 09:54:03 -08:00
Bas Nijholt
6feb2bbad9 Add examples/sdc.yaml config file 2025-12-11 09:30:33 -08:00
Bas Nijholt
ddcf58fb9d Add example folder with test compose files
- hello: Simple hello-world container for testing
- nginx: Nginx web server on port 8080
- sdc.yaml: Local config (no SSH needed)
- README with usage instructions
2025-12-11 09:30:06 -08:00
Bas Nijholt
f1bb33c646 Add pytest test suite
- Tests for config module (Host, Config, load_config)
- Tests for ssh module (local detection, command execution)
- 30 tests, all passing
- pytest-asyncio for async test support
2025-12-11 09:28:54 -08:00
Bas Nijholt
61aa1143a7 Add local execution support (skip SSH for localhost)
When host address is 'local', 'localhost', '127.0.0.1', or '::1',
commands run locally via subprocess instead of SSH. This is useful
when running sdc from one of the target nodes.
2025-12-11 09:26:41 -08:00
Bas Nijholt
72faa02f15 Add pre-commit with ruff, mypy, and standard hooks
- ruff check + format with ALL rules (ignoring D, ANN, FBT, T201)
- mypy strict mode with pydantic plugin
- Standard pre-commit hooks (trailing whitespace, end-of-file, etc.)
- Fix all type annotations for strict mypy compliance
2025-12-11 09:22:41 -08:00
Bas Nijholt
4baf908b36 Initial implementation of SDC (Simple Distributed Compose)
A minimal CLI tool to run docker compose commands across multiple hosts via SSH.
Features:
- Pydantic config parsing (hosts, services mapping)
- asyncssh for parallel command execution with streaming output
- Typer CLI with up, down, pull, restart, update, logs, ps commands
- Config search: ./sdc.yaml or ~/.config/sdc/sdc.yaml
2025-12-11 09:19:33 -08:00