@r5n/hydra 0.12.0 → 1.0.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/README.md +56 -29
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/dist/cli.js +496 -107
- package/package.json +5 -5
- package/schema.json +242 -14
package/package.json
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
"bin": {
|
|
4
4
|
"hydra": "dist/cli.js"
|
|
5
5
|
},
|
|
6
|
-
"description": "
|
|
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,9 @@
|
|
|
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
38
|
"types": "src/cli.ts",
|
|
39
|
-
"version": "0.
|
|
39
|
+
"version": "1.0.0"
|
|
40
40
|
}
|
package/schema.json
CHANGED
|
@@ -1,14 +1,71 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "Add this to your
|
|
2
|
+
"$comment": "Add this to config.json in your Hydra home (~/.hydra by default): \"$schema\": \"https://raw.githubusercontent.com/r5n-labs/clis/refs/heads/develop/packages/hydra/schema.json\"",
|
|
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": {
|
|
@@ -37,17 +94,176 @@
|
|
|
37
94
|
},
|
|
38
95
|
"type": "object"
|
|
39
96
|
},
|
|
97
|
+
"credentials": {
|
|
98
|
+
"description": "How Hydra authenticates to the GitHub API; the gh login when absent",
|
|
99
|
+
"oneOf": [
|
|
100
|
+
{
|
|
101
|
+
"additionalProperties": false,
|
|
102
|
+
"properties": {
|
|
103
|
+
"mode": { "const": "gh", "description": "Use the operator's gh login (gh auth token)", "type": "string" }
|
|
104
|
+
},
|
|
105
|
+
"required": ["mode"],
|
|
106
|
+
"type": "object"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"additionalProperties": false,
|
|
110
|
+
"properties": {
|
|
111
|
+
"appId": { "description": "The GitHub App's id", "minimum": 1, "type": "integer" },
|
|
112
|
+
"installationId": {
|
|
113
|
+
"description": "The id of the App's installation on the organisation or repository",
|
|
114
|
+
"minimum": 1,
|
|
115
|
+
"type": "integer"
|
|
116
|
+
},
|
|
117
|
+
"mode": { "const": "app", "description": "Mint installation tokens as a GitHub App", "type": "string" },
|
|
118
|
+
"privateKeyPath": {
|
|
119
|
+
"description": "Absolute path to the App's PEM private key, owned by the user running Hydra with mode 0600",
|
|
120
|
+
"minLength": 1,
|
|
121
|
+
"pattern": "^/",
|
|
122
|
+
"type": "string"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"required": ["mode", "appId", "installationId", "privateKeyPath"],
|
|
126
|
+
"type": "object"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
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
|
+
},
|
|
40
256
|
"profile": {
|
|
41
257
|
"additionalProperties": false,
|
|
42
258
|
"properties": {
|
|
43
259
|
"directory": {
|
|
44
|
-
"
|
|
45
|
-
"
|
|
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",
|
|
261
|
+
"minLength": 1,
|
|
46
262
|
"type": "string"
|
|
47
263
|
},
|
|
48
264
|
"jobHooks": {
|
|
49
265
|
"additionalProperties": false,
|
|
50
|
-
"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",
|
|
51
267
|
"properties": {
|
|
52
268
|
"dns": {
|
|
53
269
|
"additionalProperties": false,
|
|
@@ -85,7 +301,7 @@
|
|
|
85
301
|
"properties": {
|
|
86
302
|
"enabled": {
|
|
87
303
|
"default": false,
|
|
88
|
-
"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",
|
|
89
305
|
"type": "boolean"
|
|
90
306
|
},
|
|
91
307
|
"keepToolCache": {
|
|
@@ -100,7 +316,11 @@
|
|
|
100
316
|
"type": "object"
|
|
101
317
|
},
|
|
102
318
|
"labels": { "description": "Comma-separated list of labels for the runners", "type": "string" },
|
|
103
|
-
"name": {
|
|
319
|
+
"name": {
|
|
320
|
+
"description": "Base name for the runners; hydra legacy init uses runner unless --name is given",
|
|
321
|
+
"minLength": 1,
|
|
322
|
+
"type": "string"
|
|
323
|
+
},
|
|
104
324
|
"numberOfMachines": {
|
|
105
325
|
"default": 1,
|
|
106
326
|
"description": "Number of runner machines to create",
|
|
@@ -108,15 +328,13 @@
|
|
|
108
328
|
"type": "integer"
|
|
109
329
|
},
|
|
110
330
|
"os": {
|
|
111
|
-
"
|
|
112
|
-
"description": "Operating system for the runners",
|
|
331
|
+
"description": "Operating system for the runners; hydra legacy init detects it from the host",
|
|
113
332
|
"enum": ["osx", "linux", "windows"],
|
|
114
333
|
"type": "string"
|
|
115
334
|
},
|
|
116
335
|
"overwrite": { "default": false, "description": "Whether to overwrite existing runners", "type": "boolean" },
|
|
117
336
|
"provider": {
|
|
118
|
-
"
|
|
119
|
-
"description": "Runner provider backing this profile",
|
|
337
|
+
"description": "Runner provider backing this profile; hydra legacy init writes github",
|
|
120
338
|
"enum": ["github", "gitlab"],
|
|
121
339
|
"type": "string"
|
|
122
340
|
},
|
|
@@ -132,9 +350,11 @@
|
|
|
132
350
|
"url": {
|
|
133
351
|
"description": "GitHub repository URL (https://github.com/<owner>/<repo>) or organization URL (https://github.com/<org>)",
|
|
134
352
|
"format": "uri",
|
|
353
|
+
"minLength": 1,
|
|
135
354
|
"type": "string"
|
|
136
355
|
}
|
|
137
356
|
},
|
|
357
|
+
"required": ["url", "name", "directory", "os", "provider"],
|
|
138
358
|
"type": "object"
|
|
139
359
|
},
|
|
140
360
|
"runnerEntry": {
|
|
@@ -159,14 +379,23 @@
|
|
|
159
379
|
"description": "Configuration for Hydra GitHub self-hosted runner manager",
|
|
160
380
|
"properties": {
|
|
161
381
|
"$schema": { "description": "JSON Schema reference for IDE support", "type": "string" },
|
|
382
|
+
"alerts": { "$ref": "#/definitions/alerts" },
|
|
162
383
|
"cleanup": {
|
|
163
384
|
"$ref": "#/definitions/cleanup",
|
|
164
|
-
"description": "Disk cleanup behavior for hydra cleanup and automatic cleanup"
|
|
385
|
+
"description": "Disk cleanup behavior for hydra legacy cleanup and automatic cleanup"
|
|
165
386
|
},
|
|
387
|
+
"credentials": { "$ref": "#/definitions/credentials" },
|
|
166
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
|
+
},
|
|
167
396
|
"profiles": {
|
|
168
397
|
"additionalProperties": { "$ref": "#/definitions/profile" },
|
|
169
|
-
"description": "Named profiles
|
|
398
|
+
"description": "Named 0.x profiles of persistent runners, deprecated in favour of pools; the hydra legacy commands read them",
|
|
170
399
|
"type": "object"
|
|
171
400
|
},
|
|
172
401
|
"runners": {
|
|
@@ -175,7 +404,6 @@
|
|
|
175
404
|
"type": "array"
|
|
176
405
|
}
|
|
177
406
|
},
|
|
178
|
-
"required": ["profiles"],
|
|
179
407
|
"title": "Hydra Configuration",
|
|
180
408
|
"type": "object"
|
|
181
409
|
}
|