@colony2/c2j 0.0.71 → 0.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -45
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,8 +57,6 @@ c2j submit
|
|
|
57
57
|
c2j run
|
|
58
58
|
c2j run one
|
|
59
59
|
c2j run with-lease
|
|
60
|
-
c2j run any
|
|
61
|
-
c2j run loop
|
|
62
60
|
c2j ready
|
|
63
61
|
c2j list
|
|
64
62
|
c2j test
|
|
@@ -83,6 +81,31 @@ modified at build time.
|
|
|
83
81
|
See [Execution tools](EXECUTION_TOOLS.md) for lazy pnpm, Nix, and uv tool dependencies and provider-owned cache storage.
|
|
84
82
|
See [Extension ops](EXTENSION_OPS.md) for authoring, publishing, and invoking prebuilt Nix ops.
|
|
85
83
|
|
|
84
|
+
## Nix package
|
|
85
|
+
|
|
86
|
+
The Nix package contains only the `c2j` executable, with no Node/npm wrapper or
|
|
87
|
+
bundled tool runtimes. Linux and macOS builds are published for x86-64 and ARM64
|
|
88
|
+
to the `colony2` Cachix cache after the main-branch tests pass.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
cachix use colony2
|
|
92
|
+
nix run github:colony-2/c2j/main#c2j -- version
|
|
93
|
+
# Install into your profile:
|
|
94
|
+
nix profile add github:colony-2/c2j/main#c2j
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
For reproducible, download-only deployments, replace `main` with a commit whose
|
|
98
|
+
Release workflow's Nix jobs have succeeded and use `--max-jobs 0`. A newly pushed
|
|
99
|
+
commit may not be cached yet. `main` builds report `unstable-<commit>` as their
|
|
100
|
+
version. Runtime tools such as Git, Nix, pnpm, and uv are supplied separately by
|
|
101
|
+
the execution environment when needed.
|
|
102
|
+
|
|
103
|
+
Maintainers: `nix build .#c2j` builds the executable; `nix flake check` also runs
|
|
104
|
+
its installation checks. After changing Go dependencies, update `vendorHash` in
|
|
105
|
+
`nix/package.nix` to the hash reported by a build with `lib.fakeHash`. CI checks
|
|
106
|
+
all four platforms, pushes with `CACHIX_COLONY2_AUTHKEY`, verifies downloads into
|
|
107
|
+
an empty store with builds disabled, and pins each commit's package in Cachix.
|
|
108
|
+
|
|
86
109
|
## Quick Start
|
|
87
110
|
|
|
88
111
|
### 1. Check current-cell resolution
|
|
@@ -551,56 +574,19 @@ the job becomes runnable or the wait timeout is reached.
|
|
|
551
574
|
- `4`: job not runnable under the selected policy
|
|
552
575
|
- `5`: invalid job identity or invalid run arguments
|
|
553
576
|
|
|
554
|
-
##
|
|
555
|
-
|
|
556
|
-
`c2j run loop` runs a long-lived worker for one tenant. It leases available jobs
|
|
557
|
-
from a remote JobDB runtime and executes up to the configured local concurrency.
|
|
558
|
-
|
|
559
|
-
Basic usage:
|
|
560
|
-
|
|
561
|
-
```bash
|
|
562
|
-
c2j run loop --jobdb http://localhost:9047/<tenant-id> --concurrency 4
|
|
563
|
-
```
|
|
564
|
-
|
|
565
|
-
Important behavior:
|
|
566
|
-
|
|
567
|
-
- `--concurrency <n>` controls how many jobs this process can run at once
|
|
568
|
-
- `--jobdb` must be a remote `http://host/tenant` or `https://host/tenant` URI
|
|
569
|
-
- `--embed` is not available for `run loop`
|
|
570
|
-
- `--jobdb embed:///` is rejected for `run loop`
|
|
571
|
-
- `run loop` is non-interactive; use `run` or an ops surface for jobs that need input
|
|
577
|
+
## Dispatching work
|
|
572
578
|
|
|
573
|
-
|
|
579
|
+
Run a known job with `c2j run --job-id <id>`, or let a dispatcher such as Pulse
|
|
580
|
+
claim a lease and launch [`c2j run with-lease`](GUIDE-Run-With-Lease.md).
|
|
581
|
+
`run any` and `run loop` are no longer supported.
|
|
574
582
|
|
|
575
|
-
`c2j ready` prints the number of
|
|
583
|
+
`c2j ready` prints a read-only snapshot of the number of ready recipe jobs:
|
|
576
584
|
|
|
577
585
|
```bash
|
|
578
586
|
c2j ready --jobdb http://localhost:9047/<tenant-id>
|
|
579
587
|
```
|
|
580
588
|
|
|
581
|
-
|
|
582
|
-
runs it, and exits. If no lease is available, it exits successfully after
|
|
583
|
-
printing `no jobs found`.
|
|
584
|
-
|
|
585
|
-
```bash
|
|
586
|
-
c2j run any --jobdb http://localhost:9047/<tenant-id>
|
|
587
|
-
```
|
|
588
|
-
|
|
589
|
-
These can be composed by an external scheduler:
|
|
590
|
-
|
|
591
|
-
```bash
|
|
592
|
-
count=$(c2j ready --jobdb http://localhost:9047/<tenant-id>)
|
|
593
|
-
if [ "$count" -gt 0 ]; then
|
|
594
|
-
for _ in $(seq 1 "$count"); do
|
|
595
|
-
c2j run any --jobdb http://localhost:9047/<tenant-id> &
|
|
596
|
-
done
|
|
597
|
-
wait
|
|
598
|
-
fi
|
|
599
|
-
```
|
|
600
|
-
|
|
601
|
-
`ready` is only a non-mutating snapshot and can become stale under competing
|
|
602
|
-
workers. `run any` uses JobDB polling so finding available work and acquiring the
|
|
603
|
-
lease happen in one runtime operation.
|
|
589
|
+
The count is not a reservation and may change before a dispatcher claims work.
|
|
604
590
|
|
|
605
591
|
## Listing Jobs
|
|
606
592
|
|