deployontime 0.1.0 → 0.1.1
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 +13 -6
- package/package.json +2 -1
- package/queue/README.md +15 -10
- package/queue/run.mjs +17 -1
package/README.md
CHANGED
|
@@ -101,15 +101,20 @@ not fit in half the RAM); the runner's cores and memory are recorded in the resu
|
|
|
101
101
|
|
|
102
102
|
## Install
|
|
103
103
|
|
|
104
|
-
Requirements: macOS or Linux, Node 22 or newer, git 2.31 or newer.
|
|
104
|
+
Requirements: macOS or Linux, Node 22 or newer, git 2.31 or newer. The package has no dependencies.
|
|
105
105
|
|
|
106
106
|
```
|
|
107
|
-
|
|
108
|
-
cd deployontime
|
|
109
|
-
npm link # puts the dotime-queue command on your path
|
|
107
|
+
npm install -g deployontime # puts dotime-queue and dotime-mcp on your path
|
|
110
108
|
dotime-queue status
|
|
111
109
|
```
|
|
112
110
|
|
|
111
|
+
To work from the source instead: `git clone https://github.com/Moezat220/deployontime.git`, then `npm link` in its
|
|
112
|
+
top folder.
|
|
113
|
+
|
|
114
|
+
A job waits while the computer is short of room: by default below 20% free memory or 10 GB free disk, and while the
|
|
115
|
+
CPU is overloaded. On a small machine, `dotime-queue status` shows whether that gate is shut, and the limits can be
|
|
116
|
+
lowered in `~/.dotime/config.json`, for example `{ "health": { "minFreeMemPct": 5, "minFreeDiskGB": 2 } }`.
|
|
117
|
+
|
|
113
118
|
Then tell your agents to use it. In the folder of each project they work in, run:
|
|
114
119
|
|
|
115
120
|
```
|
|
@@ -146,7 +151,7 @@ Every command, flag, exit code and setting is in the [queue manual](queue/README
|
|
|
146
151
|
## Use with an MCP client
|
|
147
152
|
|
|
148
153
|
`dotime-mcp` is an MCP server on standard input and output that offers the queue to agents as tools. It has no
|
|
149
|
-
dependencies either, and
|
|
154
|
+
dependencies either, and the install puts it on your path next to `dotime-queue`. Add one entry to your client's MCP
|
|
150
155
|
server settings:
|
|
151
156
|
|
|
152
157
|
```json
|
|
@@ -158,7 +163,9 @@ server settings:
|
|
|
158
163
|
```
|
|
159
164
|
|
|
160
165
|
Clients differ in where that file lives and in how its top level is named; see your client's documentation. Without
|
|
161
|
-
|
|
166
|
+
installing it first, `"command": "npx", "args": ["-y", "-p", "deployontime", "dotime-mcp"]` fetches the package and
|
|
167
|
+
starts the server. From a clone that was not linked, use
|
|
168
|
+
`"command": "node", "args": ["<path to the clone>/mcp/server.mjs"]`. To use another state folder, add
|
|
162
169
|
`"env": { "DOTIME_HOME": "<absolute path of the folder>" }`, as for the command. A relative path is taken from the
|
|
163
170
|
folder the server starts in, and its jobs are handed that absolute path.
|
|
164
171
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deployontime",
|
|
3
|
-
"
|
|
3
|
+
"mcpName": "io.github.Moezat220/deployontime",
|
|
4
|
+
"version": "0.1.1",
|
|
4
5
|
"description": "A shared job queue that lets several coding agents use one computer without overloading it.",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"license": "AGPL-3.0-only",
|
package/queue/README.md
CHANGED
|
@@ -35,24 +35,25 @@ Requirements: macOS or Linux (servers and desktops, x64 and arm64). Node 22 or n
|
|
|
35
35
|
the `ps` of procps, which almost every distribution installs, and a readable `/proc`.
|
|
36
36
|
|
|
37
37
|
```
|
|
38
|
-
|
|
39
|
-
cd deployontime
|
|
40
|
-
npm link
|
|
38
|
+
npm install -g deployontime
|
|
41
39
|
dotime-queue status
|
|
42
40
|
```
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
This puts `dotime-queue` and `dotime-mcp` on your path. The package has no dependencies. The first line of
|
|
43
|
+
`dotime-queue status` should read `slots: 0 of 2 taken, 0 waiting`.
|
|
46
44
|
|
|
47
|
-
On Linux the steps are the same. When
|
|
45
|
+
On Linux the steps are the same. When the install stops with a permission error, your Node was installed for all
|
|
48
46
|
users; run it with a Node from a version manager, or after `npm config set prefix ~/.local` with `~/.local/bin` on
|
|
49
47
|
your path.
|
|
50
48
|
|
|
49
|
+
To work from the source instead, clone `https://github.com/Moezat220/deployontime.git` and run `npm link` in its top
|
|
50
|
+
folder.
|
|
51
|
+
|
|
51
52
|
To tell the agents of a project to use the queue, run [`dotime-queue setup`](#setup) in that project's folder:
|
|
52
53
|
without `--write` it shows what it would add to `AGENTS.md` and `CLAUDE.md`, with `--write` it adds it.
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
outside itself. The examples below use `dotime-queue`.
|
|
55
|
+
From a clone that was not linked, call `node <path to the clone>/queue/cli.mjs` from any folder. The `queue/` folder
|
|
56
|
+
needs nothing outside itself. The examples below use `dotime-queue`.
|
|
56
57
|
|
|
57
58
|
To uninstall:
|
|
58
59
|
|
|
@@ -496,11 +497,14 @@ Every message has the same shape: clauses separated by `; `, each clause a topic
|
|
|
496
497
|
commas. Durations are written as `12 min`, percentages as `20%`, sizes as `40 GB`, clock times on a 24-hour clock
|
|
497
498
|
with the zone name.
|
|
498
499
|
|
|
499
|
-
Sample lines. Each is one line on screen;
|
|
500
|
+
Sample lines. Each is one line on screen; long lines are wrapped here, and `<date and time>` stands for a value.
|
|
500
501
|
|
|
501
502
|
```
|
|
502
503
|
dotime-queue: in line: position 2, 3 min waited, wait limit 60 min; no free slot: 2 of 2 taken, by "shop-api: e2e"
|
|
503
504
|
and "docs-site: build"
|
|
505
|
+
dotime-queue: in line: position 1, 0 min waited, wait limit 60 min; disk too low: 7.4 GB free, 10 GB needed; hint:
|
|
506
|
+
the job starts once there is more free disk; to start with less, lower health.minFreeDiskGB in
|
|
507
|
+
/home/you/.dotime/config.json
|
|
504
508
|
dotime-queue: gave up: exit 75, position 1, 60 min waited; memory too low: 9% free, 20% needed; hint: --max-wait 0
|
|
505
509
|
waits without limit
|
|
506
510
|
dotime-queue: skipped: "shop-api: unit tests" already passed on commit 0a1b2c3d (12 min ago); --no-skip runs it anyway
|
|
@@ -609,7 +613,8 @@ PATH=/usr/bin:/bin
|
|
|
609
613
|
|
|
610
614
|
Create the log folder first if it does not exist (`mkdir -p ~/.local/state`).
|
|
611
615
|
|
|
612
|
-
Replace `/path/to/node` with what `command -v node` prints, and
|
|
616
|
+
Replace `/path/to/node` with what `command -v node` prints, and `/path/to/deployontime` with the folder of the
|
|
617
|
+
package: `$(npm root -g)/deployontime` after `npm install -g`, or your clone. The
|
|
613
618
|
`PATH` line lets the reaper find the system tools it reads (`sysctl` lives in `/usr/sbin`); it applies to every
|
|
614
619
|
line below it in your crontab. If you use `DOTIME_HOME`, add a `DOTIME_HOME=...` line the same way. If the clone
|
|
615
620
|
sits in a folder that macOS protects, such as Documents, cron may be refused access to it; a clone elsewhere in your
|
package/queue/run.mjs
CHANGED
|
@@ -100,6 +100,17 @@ export function skipFor(job, rows) {
|
|
|
100
100
|
return skipStamp(rows, folder, check, { tz: job.tz, at: job.at });
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
/** The advice for a wait held by low memory or disk: free some, or lower the limit in config.json. Empty for other
|
|
104
|
+
* reasons to wait. */
|
|
105
|
+
export function lowRoomHint(blocks, configFile) {
|
|
106
|
+
const keys = { memory: "health.minFreeMemPct", disk: "health.minFreeDiskGB" };
|
|
107
|
+
const low = blocks.filter((b) => keys[b.gate]);
|
|
108
|
+
if (!low.length) return "";
|
|
109
|
+
const what = low.map((b) => b.gate).join(" or ");
|
|
110
|
+
return `; hint: the job starts once there is more free ${what}; to start with less, lower `
|
|
111
|
+
+ `${low.map((b) => keys[b.gate]).join(" and ")} in ${configFile}`;
|
|
112
|
+
}
|
|
113
|
+
|
|
103
114
|
/** Waits in line until this job holds a slot. job: { pid, label, maxWait, slotMeta, settings, files, waitFrom,
|
|
104
115
|
* tally }; waitFrom and tally, when given, carry on an earlier wait, so the wait limit counts from its start and the
|
|
105
116
|
* time is booked with it. Priority plays no part in here: it is in the job's ticket, which orders the line, and in
|
|
@@ -114,6 +125,7 @@ export async function waitForSlot(job, deps) {
|
|
|
114
125
|
const waitFrom = job.waitFrom ?? deps.now();
|
|
115
126
|
let shownPosition = 0;
|
|
116
127
|
let shownAt = 0;
|
|
128
|
+
let hinted = false;
|
|
117
129
|
for (;;) {
|
|
118
130
|
const signal = deps.leaving?.() ?? null;
|
|
119
131
|
if (signal) return { left: signal, tally };
|
|
@@ -143,7 +155,11 @@ export async function waitForSlot(job, deps) {
|
|
|
143
155
|
return { gaveUp: true, tally };
|
|
144
156
|
}
|
|
145
157
|
const limitText = maxWait ? `wait limit ${maxWait} min` : "no wait limit";
|
|
146
|
-
|
|
158
|
+
// Low memory or disk does not pass by itself as a busy CPU does, so the first time it holds the job,
|
|
159
|
+
// the line says what to do about it.
|
|
160
|
+
const hint = hinted ? "" : lowRoomHint(all, files.config);
|
|
161
|
+
if (hint) hinted = true;
|
|
162
|
+
deps.say(`in line: position ${turn.position}, ${waited}, ${limitText}; ${why}${hint}`);
|
|
147
163
|
shownPosition = turn.position;
|
|
148
164
|
shownAt = now;
|
|
149
165
|
}
|