@r5n/hydra 0.13.0 → 1.1.0

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/package.json CHANGED
@@ -3,11 +3,12 @@
3
3
  "bin": {
4
4
  "hydra": "dist/cli.js"
5
5
  },
6
- "description": "A tool for spawning multiple local GitHub self-hosted runners",
6
+ "description": "Self-hosted GitHub Actions runners that run each job in a fresh guest",
7
7
  "files": [
8
8
  "dist",
9
9
  "schema.json",
10
- "LICENSE"
10
+ "LICENSE",
11
+ "THIRD_PARTY_NOTICES.md"
11
12
  ],
12
13
  "keywords": [
13
14
  "github",
@@ -31,10 +32,8 @@
31
32
  "dev": "bun --bun src/cli.ts",
32
33
  "package:dryRun": "bun ../../tools/scripts/publish-package.ts . --dry-run",
33
34
  "package:prepare": "NODE_ENV=production bun run build && bun ../../tools/scripts/prepare-publish.ts .",
34
- "package:publish": "bun ../../tools/scripts/publish-package.ts .",
35
- "type-check": "bun --bun tsc --noEmit"
35
+ "package:publish": "bun ../../tools/scripts/publish-package.ts ."
36
36
  },
37
37
  "type": "module",
38
- "types": "src/cli.ts",
39
- "version": "0.13.0"
38
+ "version": "1.1.0"
40
39
  }
package/schema.json CHANGED
@@ -3,12 +3,69 @@
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "additionalProperties": false,
5
5
  "definitions": {
6
+ "alerts": {
7
+ "additionalProperties": false,
8
+ "description": "Where Hydra sends alerts; pools need at least one sink",
9
+ "minProperties": 1,
10
+ "properties": {
11
+ "command": {
12
+ "additionalProperties": false,
13
+ "description": "Run a fixed command, without a shell, with the alert on standard input",
14
+ "properties": {
15
+ "argv": {
16
+ "description": "The program and its arguments; the first is an absolute path",
17
+ "items": { "maxLength": 1024, "type": "string" },
18
+ "maxItems": 32,
19
+ "minItems": 1,
20
+ "type": "array"
21
+ }
22
+ },
23
+ "required": ["argv"],
24
+ "type": "object"
25
+ },
26
+ "discord": {
27
+ "description": "Post alerts to Discord through a webhook, or as a bot to a channel",
28
+ "oneOf": [
29
+ {
30
+ "additionalProperties": false,
31
+ "properties": {
32
+ "webhookFile": {
33
+ "description": "Absolute path of a 0600 file holding the webhook URL",
34
+ "pattern": "^/",
35
+ "type": "string"
36
+ }
37
+ },
38
+ "required": ["webhookFile"],
39
+ "type": "object"
40
+ },
41
+ {
42
+ "additionalProperties": false,
43
+ "properties": {
44
+ "botTokenFile": {
45
+ "description": "Absolute path of a 0600 file holding the bot token",
46
+ "pattern": "^/",
47
+ "type": "string"
48
+ },
49
+ "channelId": {
50
+ "description": "The channel the bot posts to",
51
+ "pattern": "^[1-9][0-9]{15,19}$",
52
+ "type": "string"
53
+ }
54
+ },
55
+ "required": ["botTokenFile", "channelId"],
56
+ "type": "object"
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ "type": "object"
62
+ },
6
63
  "cleanup": {
7
64
  "additionalProperties": false,
8
65
  "properties": {
9
66
  "auto": {
10
67
  "default": false,
11
- "description": "Run cleanup automatically after hydra start and hydra update",
68
+ "description": "Run cleanup automatically after hydra legacy start and hydra legacy update",
12
69
  "type": "boolean"
13
70
  },
14
71
  "intervalHours": {
@@ -70,17 +127,143 @@
70
127
  }
71
128
  ]
72
129
  },
130
+ "fleet": {
131
+ "additionalProperties": false,
132
+ "description": "The fleet this home runs; pools need it",
133
+ "properties": {
134
+ "dns": {
135
+ "description": "Public IPv4 DNS servers for the fleet's Linux guests (default 1.1.1.1)",
136
+ "items": { "type": "string" },
137
+ "minItems": 1,
138
+ "type": "array"
139
+ },
140
+ "id": {
141
+ "description": "Names the fleet's guests and scale sets: lowercase letters and digits, without hyphens",
142
+ "maxLength": 16,
143
+ "pattern": "^[a-z0-9]+$",
144
+ "type": "string"
145
+ },
146
+ "networks": {
147
+ "additionalProperties": false,
148
+ "description": "The private IPv4 range split into the persistent network pool of the fleet's container guests",
149
+ "properties": {
150
+ "range": { "description": "A private IPv4 CIDR block, such as 10.64.0.0/22", "type": "string" },
151
+ "subnetPrefix": {
152
+ "description": "The prefix length of each guest network",
153
+ "maximum": 28,
154
+ "minimum": 16,
155
+ "type": "integer"
156
+ }
157
+ },
158
+ "required": ["range", "subnetPrefix"],
159
+ "type": "object"
160
+ }
161
+ },
162
+ "required": ["id"],
163
+ "type": "object"
164
+ },
165
+ "pool": {
166
+ "additionalProperties": false,
167
+ "description": "A pool runs each job it takes in a fresh guest created for that job and destroyed afterwards",
168
+ "properties": {
169
+ "allowWeakerIsolation": {
170
+ "default": false,
171
+ "description": "Let a secret-bearing pool use a driver that isolates jobs with a user-space kernel rather than a VM",
172
+ "type": "boolean"
173
+ },
174
+ "ceiling": {
175
+ "description": "The most jobs the pool runs at once, or none; a macOS guest pool on a VM driver stays within the driver's macOS guest limit",
176
+ "oneOf": [{ "minimum": 1, "type": "integer" }, { "const": "none", "type": "string" }]
177
+ },
178
+ "demand": {
179
+ "description": "Where the pool learns about jobs: a runner scale set that GitHub fills with the jobs its labels and runner group admit, or polling for queued jobs",
180
+ "enum": ["scaleset", "poll"],
181
+ "type": "string"
182
+ },
183
+ "docker": {
184
+ "default": "none",
185
+ "description": "The Docker the pool's jobs need inside their guest",
186
+ "enum": ["none", "limited", "full"],
187
+ "type": "string"
188
+ },
189
+ "driver": {
190
+ "description": "The slot driver that runs the pool's guests, or auto to pick one for the host",
191
+ "enum": ["auto", "apple-container", "tart", "firecracker", "podman-gvisor", "native"],
192
+ "type": "string"
193
+ },
194
+ "foreignArch": {
195
+ "default": false,
196
+ "description": "The jobs run binaries built for another architecture, such as amd64 on arm64",
197
+ "type": "boolean"
198
+ },
199
+ "guestOs": {
200
+ "description": "The operating system of the pool's guests",
201
+ "enum": ["linux", "macos"],
202
+ "type": "string"
203
+ },
204
+ "guiSession": { "default": false, "description": "The runner needs a desktop session", "type": "boolean" },
205
+ "labels": {
206
+ "description": "The pool's full label set, self-hosted and the system and architecture labels included",
207
+ "items": { "minLength": 1, "pattern": "^[^,\\s](?:[^,]*[^,\\s])?$", "type": "string" },
208
+ "minItems": 1,
209
+ "type": "array",
210
+ "uniqueItems": true
211
+ },
212
+ "maxJobMinutes": {
213
+ "default": 120,
214
+ "description": "The longest a job may run, in minutes, before its guest is stopped",
215
+ "maximum": 7200,
216
+ "minimum": 1,
217
+ "type": "integer"
218
+ },
219
+ "priority": {
220
+ "default": 50,
221
+ "description": "Higher priorities get capacity first when pools wait for it",
222
+ "maximum": 100,
223
+ "minimum": 0,
224
+ "type": "integer"
225
+ },
226
+ "resources": {
227
+ "additionalProperties": false,
228
+ "description": "What each guest gets",
229
+ "properties": {
230
+ "cpus": { "description": "Virtual CPUs", "minimum": 1, "type": "integer" },
231
+ "diskGiB": { "description": "Disk in GiB", "minimum": 1, "type": "integer" },
232
+ "memoryMiB": { "description": "Memory in MiB", "minimum": 1, "type": "integer" }
233
+ },
234
+ "required": ["cpus", "memoryMiB", "diskGiB"],
235
+ "type": "object"
236
+ },
237
+ "runnerGroup": {
238
+ "description": "The organisation's runner group the pool's runners join; required for an organisation URL, refused for a repository URL",
239
+ "minLength": 1,
240
+ "type": "string"
241
+ },
242
+ "secretBearing": {
243
+ "default": false,
244
+ "description": "The pool's jobs may hold secrets; drivers that run jobs as a host user never serve it",
245
+ "type": "boolean"
246
+ },
247
+ "url": {
248
+ "description": "GitHub organisation URL (https://github.com/<org>) or repository URL (https://github.com/<owner>/<repo>)",
249
+ "pattern": "^https://github\\.com/[A-Za-z0-9_-]+(?:/[A-Za-z0-9._-]+)?$",
250
+ "type": "string"
251
+ }
252
+ },
253
+ "required": ["url", "guestOs", "driver", "demand", "ceiling", "labels", "resources"],
254
+ "type": "object"
255
+ },
73
256
  "profile": {
74
257
  "additionalProperties": false,
75
258
  "properties": {
76
259
  "directory": {
77
- "description": "Directory where runners will be created; hydra init writes runners/ in the Hydra home. A relative path resolves against the home, or against the directory that holds it when the home is named .hydra",
260
+ "description": "Directory where runners will be created; hydra legacy init writes runners/ in the Hydra home. A relative path resolves against the home, or against the directory that holds it when the home is named .hydra",
78
261
  "minLength": 1,
79
262
  "type": "string"
80
263
  },
81
264
  "jobHooks": {
82
265
  "additionalProperties": false,
83
- "description": "Scripts Hydra installs as each runner's job hooks; hydra create and hydra update write them",
266
+ "description": "Scripts Hydra installs as each runner's job hooks; hydra legacy create and hydra legacy update write them",
84
267
  "properties": {
85
268
  "dns": {
86
269
  "additionalProperties": false,
@@ -118,7 +301,7 @@
118
301
  "properties": {
119
302
  "enabled": {
120
303
  "default": false,
121
- "description": "Install the cleanup hook; hydra init turns it on for new profiles",
304
+ "description": "Install the cleanup hook; hydra legacy init turns it on for new profiles",
122
305
  "type": "boolean"
123
306
  },
124
307
  "keepToolCache": {
@@ -134,7 +317,7 @@
134
317
  },
135
318
  "labels": { "description": "Comma-separated list of labels for the runners", "type": "string" },
136
319
  "name": {
137
- "description": "Base name for the runners; hydra init uses runner unless --name is given",
320
+ "description": "Base name for the runners; hydra legacy init uses runner unless --name is given",
138
321
  "minLength": 1,
139
322
  "type": "string"
140
323
  },
@@ -145,13 +328,13 @@
145
328
  "type": "integer"
146
329
  },
147
330
  "os": {
148
- "description": "Operating system for the runners; hydra init detects it from the host",
331
+ "description": "Operating system for the runners; hydra legacy init detects it from the host",
149
332
  "enum": ["osx", "linux", "windows"],
150
333
  "type": "string"
151
334
  },
152
335
  "overwrite": { "default": false, "description": "Whether to overwrite existing runners", "type": "boolean" },
153
336
  "provider": {
154
- "description": "Runner provider backing this profile; hydra init writes github",
337
+ "description": "Runner provider backing this profile; hydra legacy init writes github",
155
338
  "enum": ["github", "gitlab"],
156
339
  "type": "string"
157
340
  },
@@ -196,15 +379,23 @@
196
379
  "description": "Configuration for Hydra GitHub self-hosted runner manager",
197
380
  "properties": {
198
381
  "$schema": { "description": "JSON Schema reference for IDE support", "type": "string" },
382
+ "alerts": { "$ref": "#/definitions/alerts" },
199
383
  "cleanup": {
200
384
  "$ref": "#/definitions/cleanup",
201
- "description": "Disk cleanup behavior for hydra cleanup and automatic cleanup"
385
+ "description": "Disk cleanup behavior for hydra legacy cleanup and automatic cleanup"
202
386
  },
203
387
  "credentials": { "$ref": "#/definitions/credentials" },
204
388
  "defaultProfile": { "description": "The default profile to use when no profile is specified", "type": "string" },
389
+ "fleet": { "$ref": "#/definitions/fleet" },
390
+ "pools": {
391
+ "additionalProperties": { "$ref": "#/definitions/pool" },
392
+ "description": "Named pools; a name is lowercase letters and digits in hyphen-separated words, at most 24 characters",
393
+ "propertyNames": { "maxLength": 24, "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
394
+ "type": "object"
395
+ },
205
396
  "profiles": {
206
397
  "additionalProperties": { "$ref": "#/definitions/profile" },
207
- "description": "Named profiles for different runner configurations",
398
+ "description": "Named 0.x profiles of persistent runners, deprecated in favour of pools; the hydra legacy commands read them",
208
399
  "type": "object"
209
400
  },
210
401
  "runners": {
@@ -213,7 +404,6 @@
213
404
  "type": "array"
214
405
  }
215
406
  },
216
- "required": ["profiles"],
217
407
  "title": "Hydra Configuration",
218
408
  "type": "object"
219
409
  }