Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
82a2115
docs: design for job suspension and enhanced run-job
prathamesh0 May 28, 2026
c90634a
docs: implementation plan for job suspension and enhanced run-job
prathamesh0 May 28, 2026
683b0a2
feat: _is_suspended helper for compose laconic.suspend label
prathamesh0 May 28, 2026
e875ae7
feat: stamp laconic.suspend label on built V1Job when present in compose
prathamesh0 May 28, 2026
633859c
feat: get_jobs accepts name_suffix for repeatable Job creation
prathamesh0 May 28, 2026
97aa227
feat: get_jobs accepts extra_env to layer per-invocation vars
prathamesh0 May 28, 2026
eb5728f
feat: skip suspended jobs in _create_jobs()
prathamesh0 May 28, 2026
2aea9bf
feat: _wait_and_stream helper for run-job blocking log stream
prathamesh0 May 28, 2026
13d7f18
test: remove unused _watch_events helper
prathamesh0 May 28, 2026
8664424
feat: K8sDeployer.run_job adds timestamp suffix, extra_env, wait/stream
prathamesh0 May 28, 2026
e9b7274
fix: drop run_job base-name fallback; use suffixed names in test mocks
prathamesh0 May 28, 2026
1be3f77
fix: helm run_job raises on no-wait/timeout; tighten wait_and_stream …
prathamesh0 May 28, 2026
eef441d
refactor: extend Deployer.run_job abstract signature
prathamesh0 May 28, 2026
b8137b5
feat: DockerDeployer.run_job accepts new kwargs (warn/raise)
prathamesh0 May 28, 2026
96cc350
feat: run_job_operation parses --env KEY=VAL and forwards kwargs
prathamesh0 May 28, 2026
8133856
feat: run-job CLI accepts --env, --no-wait, --timeout
prathamesh0 May 28, 2026
8293950
docs: document laconic.suspend label and run-job flags
prathamesh0 May 28, 2026
a4cb002
fix: docker run_job return, init_containers scope note, lint cleanup
prathamesh0 May 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,55 @@ Push deployment images to a registry:
$ laconic-so deployment --dir <deployment-dir> push-images
```

### deployment run-job
### `laconic-so deployment run-job`

Run a one-time job in the deployment:
Run a one-time job from a deployed stack. Each invocation creates a
fresh Kubernetes Job whose name is suffixed with a unix timestamp
(`{app}-job-{name}-{ts}`), so repeated calls do not collide.

```
laconic-so deployment --dir <deploy-dir> run-job <job-name> \
[--env KEY=VAL ...] \
[--no-wait] \
[--timeout SECONDS]
```
$ laconic-so deployment --dir <deployment-dir> run-job <job-name>

**Flags:**

- `--env KEY=VAL` (repeatable) — layer per-invocation env vars on the
job's container, overriding any same-named entries from compose
`environment:` or spec `config:`.
- `--no-wait` — return immediately after the Job object is accepted;
do not stream logs or wait for completion.
- `--timeout SECONDS` — give up waiting after this many seconds
(default `0` = no timeout). Ignored with `--no-wait`. Note: in v1
this only bounds the pod-startup phase; once log streaming begins
the command blocks until the pod terminates.

**Default behavior:** the command blocks until the Job's pod
terminates, streaming the pod's logs to stdout. Exit code is `0` if
the Job succeeded, non-zero otherwise.

#### Suspending jobs at `deployment start`

A job whose compose service is labeled `laconic.suspend: "true"` is
skipped by `deployment start` — it is only triggered via `run-job`.

```yaml
# compose-jobs/docker-compose-ism-update.yml
services:
ism-update:
image: ghcr.io/example/ops:latest
labels:
laconic.suspend: "true"
# …
```

Calling `run-job <name>` on a non-suspended job prints a warning to
stderr (it may race with the auto-create path) but still proceeds.

**Limitations:**
- Helm-based deployments don't support `--env`, `--no-wait`, or
`--timeout`.
- Docker-compose deployments don't support `--no-wait` or `--timeout`;
`--env` is ignored with a warning.
Loading
Loading