@plexus-ms/lib 0.122.1 → 0.124.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/dist/bookkeeping.d.ts +0 -8
- package/dist/bookkeeping.d.ts.map +1 -1
- package/dist/bookkeeping.js +5 -16
- package/dist/bookkeeping.js.map +1 -1
- package/dist/compose.d.ts +41 -0
- package/dist/compose.d.ts.map +1 -0
- package/dist/compose.js +169 -0
- package/dist/compose.js.map +1 -0
- package/dist/consumers.d.ts +3 -18
- package/dist/consumers.d.ts.map +1 -1
- package/dist/consumers.js +13 -42
- package/dist/consumers.js.map +1 -1
- package/dist/context.d.ts +6 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +14 -5
- package/dist/context.js.map +1 -1
- package/dist/deploy.d.ts +11 -3
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +185 -120
- package/dist/deploy.js.map +1 -1
- package/dist/deployTargets.d.ts.map +1 -1
- package/dist/deployTargets.js +8 -7
- package/dist/deployTargets.js.map +1 -1
- package/dist/doctor.d.ts +121 -15
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +512 -71
- package/dist/doctor.js.map +1 -1
- package/dist/effects.d.ts +3 -0
- package/dist/effects.d.ts.map +1 -1
- package/dist/effects.js.map +1 -1
- package/dist/frontmatter.js +1 -1
- package/dist/frontmatter.js.map +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/io.d.ts +28 -0
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js +86 -4
- package/dist/io.js.map +1 -1
- package/dist/marker.d.ts +22 -5
- package/dist/marker.d.ts.map +1 -1
- package/dist/marker.js +100 -13
- package/dist/marker.js.map +1 -1
- package/dist/model.d.ts +48 -4
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +59 -11
- package/dist/model.js.map +1 -1
- package/dist/need.d.ts +11 -34
- package/dist/need.d.ts.map +1 -1
- package/dist/need.js +92 -54
- package/dist/need.js.map +1 -1
- package/dist/overview.d.ts +25 -0
- package/dist/overview.d.ts.map +1 -1
- package/dist/overview.js +106 -14
- package/dist/overview.js.map +1 -1
- package/dist/propagate.d.ts +3 -3
- package/dist/propagate.d.ts.map +1 -1
- package/dist/propagate.js +8 -6
- package/dist/propagate.js.map +1 -1
- package/dist/requirements.d.ts +1 -1
- package/dist/requirements.d.ts.map +1 -1
- package/dist/requirements.js +6 -5
- package/dist/requirements.js.map +1 -1
- package/dist/standard-index.json +90 -6
- package/dist/take.d.ts +1 -1
- package/dist/take.d.ts.map +1 -1
- package/dist/take.js +6 -25
- package/dist/take.js.map +1 -1
- package/dist/templates.d.ts +21 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +55 -0
- package/dist/templates.js.map +1 -0
- package/dist/update.d.ts +3 -3
- package/dist/update.d.ts.map +1 -1
- package/dist/update.js +58 -71
- package/dist/update.js.map +1 -1
- package/dist/version.d.ts +7 -2
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +17 -2
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/dist/catalog.d.ts +0 -23
- package/dist/catalog.d.ts.map +0 -1
- package/dist/catalog.js +0 -38
- package/dist/catalog.js.map +0 -1
- package/dist/manifest.d.ts +0 -20
- package/dist/manifest.d.ts.map +0 -1
- package/dist/manifest.js +0 -59
- package/dist/manifest.js.map +0 -1
package/dist/deploy.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// render compose.yaml from the invoking checkout, pinning the image ref (§§ 2 and 3 PLX-App)
|
|
5
5
|
// → stage it on the host → docker compose pull → compose run --rm migrate (if declared),
|
|
6
6
|
// both against the staged file → swap the file into place → docker compose up -d --remove-orphans
|
|
7
|
-
// →
|
|
7
|
+
// → wait for web's healthcheck → on failure: restore the previous file, up -d --remove-orphans (no pull), fail
|
|
8
8
|
//
|
|
9
9
|
// Run from a checkout of the app's SOURCE repo (§ 2 PLX-App): an app repo's
|
|
10
10
|
// CI, or the operations repo for third-party software the tenant merely
|
|
@@ -14,13 +14,14 @@
|
|
|
14
14
|
// swapped into place only once pull and migrate have succeeded, so the compose
|
|
15
15
|
// file on the host always names the image it serves, and a failed deploy
|
|
16
16
|
// leaves the host exactly as it was. Three files in the app dir, one writer
|
|
17
|
-
// each (PLX-Secrets): the
|
|
18
|
-
// verb owns compose.yaml. Compose
|
|
19
|
-
// and by a human is a bare
|
|
17
|
+
// each (PLX-Secrets): the platform playbook owns .env (its `apps` role) and
|
|
18
|
+
// .env.secret (its `secrets` role), this verb owns compose.yaml. Compose
|
|
19
|
+
// reads .env implicitly, so every command here and by a human is a bare
|
|
20
|
+
// `docker compose …` in the app dir.
|
|
20
21
|
//
|
|
21
22
|
// Every command sent to the host is one line of shell over ssh, carried in
|
|
22
23
|
// the plan and printed verbatim by the dry run, so a stranded operator copies
|
|
23
|
-
// the lines; the host needs bash
|
|
24
|
+
// the lines; the host needs bash and docker and nothing else. The ssh
|
|
24
25
|
// calls share one connection (ControlMaster), opened by the first and closed
|
|
25
26
|
// at the end. Reality is the source of truth: the previous image is read from
|
|
26
27
|
// the running container, never from a file this verb owns.
|
|
@@ -29,11 +30,12 @@
|
|
|
29
30
|
// has them declares a one-shot `migrate` service (same image, migrate command,
|
|
30
31
|
// `profiles: ["migrate"]` so plain `up` never starts it). The `web` service is
|
|
31
32
|
// the app service by convention; it is the one the live image and the
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
// the
|
|
36
|
-
//
|
|
33
|
+
// health status are read from, and the one that must declare a healthcheck
|
|
34
|
+
// (PLX-App/Healthcheck); every other service rides along with pull and up.
|
|
35
|
+
// A third-party app pins its image inside compose.yaml and passes no image
|
|
36
|
+
// ref; the file is then placed as is. Where the host already serves the same
|
|
37
|
+
// file with `web` running and healthy, with or without a ref, the verb ends
|
|
38
|
+
// there: nothing is pulled, migrated or restarted.
|
|
37
39
|
//
|
|
38
40
|
// plx deploy deploy@1.2.3.4 website --image ghcr.io/org/website:<sha>
|
|
39
41
|
// plx deploy deploy@1.2.3.4 website --environment staging --image … # into /opt/stacks/website-staging
|
|
@@ -41,11 +43,11 @@
|
|
|
41
43
|
import { randomBytes } from 'node:crypto';
|
|
42
44
|
import { tmpdir } from 'node:os';
|
|
43
45
|
import { join } from 'node:path';
|
|
46
|
+
import { declaresHealthcheck, healthcheckOf, IMAGE_PLACEHOLDER, parseCompose } from "./compose.js";
|
|
44
47
|
import { DEFAULT_ENVIRONMENT, deploymentSlug } from "./deployTargets.js";
|
|
45
48
|
import { run } from "./effects.js";
|
|
46
49
|
import { orAbsent } from "./io.js";
|
|
47
50
|
import { UsageError } from "./version.js";
|
|
48
|
-
const PLACEHOLDER = /\$\{PLEXUS_DEPLOYMENT_IMAGE(:[^}]*)?\}/g;
|
|
49
51
|
const INCOMING = '.incoming';
|
|
50
52
|
/**
|
|
51
53
|
* Pin the image ref in place of the ${PLEXUS_DEPLOYMENT_IMAGE} placeholder
|
|
@@ -55,12 +57,12 @@ const INCOMING = '.incoming';
|
|
|
55
57
|
* would ship an empty image; both are errors here, never on the host.
|
|
56
58
|
*/
|
|
57
59
|
export function renderCompose(text, image, path) {
|
|
58
|
-
const has =
|
|
59
|
-
|
|
60
|
+
const has = IMAGE_PLACEHOLDER.test(text);
|
|
61
|
+
IMAGE_PLACEHOLDER.lastIndex = 0;
|
|
60
62
|
if (image) {
|
|
61
63
|
if (!has)
|
|
62
64
|
throw new UsageError(`${path} does not reference \${PLEXUS_DEPLOYMENT_IMAGE}; an image ref was given but nothing would use it (§ 3 PLX-App)`);
|
|
63
|
-
return text.replace(
|
|
65
|
+
return text.replace(IMAGE_PLACEHOLDER, image);
|
|
64
66
|
}
|
|
65
67
|
if (has)
|
|
66
68
|
throw new UsageError(`${path} references \${PLEXUS_DEPLOYMENT_IMAGE} but no image ref was given`);
|
|
@@ -123,6 +125,30 @@ class Remote {
|
|
|
123
125
|
return this.ctx.apply([run('ssh', ['-o', `ControlPath=${this.socket}`, '-O', 'exit', this.host])]);
|
|
124
126
|
}
|
|
125
127
|
}
|
|
128
|
+
/** A compose duration (Go's syntax: `1m30s`, `500ms`) in seconds, or undefined when it is not one. */
|
|
129
|
+
export function seconds(duration) {
|
|
130
|
+
if (typeof duration !== 'string' || !/^((\d+\.?\d*|\.\d+)(ns|us|µs|ms|s|m|h))+$/.test(duration))
|
|
131
|
+
return undefined;
|
|
132
|
+
const unit = { ns: 1e-9, us: 1e-6, µs: 1e-6, ms: 1e-3, s: 1, m: 60, h: 3600 };
|
|
133
|
+
let total = 0;
|
|
134
|
+
for (const [, n, u] of duration.matchAll(/(\d+\.?\d*|\.\d+)(ns|us|µs|ms|s|m|h)/g))
|
|
135
|
+
total += Number(n) * (unit[u] ?? 0);
|
|
136
|
+
return total;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Why the healthcheck would be seen healthy late, or not at all within a
|
|
140
|
+
* wait of `budget` seconds: without `start_interval`, or once a short
|
|
141
|
+
* `start_period` is over, Docker probes only every `interval`. Undefined when
|
|
142
|
+
* the timing keys cover the wait; a value the verb cannot read is left to compose.
|
|
143
|
+
*/
|
|
144
|
+
export function slowStart(check, budget) {
|
|
145
|
+
if (check.start_interval == null)
|
|
146
|
+
return 'sets no start_interval';
|
|
147
|
+
const period = check.start_period == null ? 0 : seconds(check.start_period);
|
|
148
|
+
if (period !== undefined && period < budget)
|
|
149
|
+
return `has a start_period of ${period}s, under the deploy's ${budget}s wait`;
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
126
152
|
/** Deploy from the checkout at `dir`: read, render, then the host-side steps in order. */
|
|
127
153
|
export async function deploy(ctx, options) {
|
|
128
154
|
const { host, app } = options;
|
|
@@ -146,142 +172,181 @@ export async function deploy(ctx, options) {
|
|
|
146
172
|
if (compose === undefined)
|
|
147
173
|
throw new UsageError(`no compose.yaml under ${source}; run from the app's source repo (§ 2 PLX-App)`);
|
|
148
174
|
const rendered = renderCompose(text, image, compose);
|
|
175
|
+
// The wait's budget: `retries` looks, two seconds apart.
|
|
176
|
+
const budget = retries * 2;
|
|
177
|
+
const check = healthcheckOf(parseCompose(rendered, compose));
|
|
178
|
+
if (!declaresHealthcheck(check))
|
|
179
|
+
throw new UsageError(`${compose}: the web service declares no healthcheck with a test of its own, and the deploy waits for it to turn healthy (PLX-App/Healthcheck); ` +
|
|
180
|
+
`the files an \`include\` names are not read, nor a service an \`extends\` takes from another file (\`file:\`), and an image's own HEALTHCHECK does not count; to use it, declare it here:\n` +
|
|
181
|
+
` healthcheck: { test: [CMD, <the image's check command>], start_period: ${budget}s, start_interval: 1s }`);
|
|
182
|
+
const slow = slowStart(check, budget);
|
|
149
183
|
ctx.say(`→ deploying ${image ?? '<image pinned in compose.yaml>'}`);
|
|
150
184
|
ctx.say(` host: ${host}`);
|
|
151
185
|
ctx.say(` dir: ${appDir}`);
|
|
152
186
|
ctx.say(` compose: ${compose}`);
|
|
153
|
-
ctx.say(
|
|
154
|
-
|
|
187
|
+
ctx.say(' health: the healthcheck of service web, as Docker reports it');
|
|
188
|
+
if (slow)
|
|
189
|
+
ctx.say(`⚠ ${compose}: the web healthcheck ${slow}, so Docker may probe it only every interval while the deploy waits, which then sees it healthy late or rolls it back; set start_interval: 1s and start_period: ${budget}s`);
|
|
155
190
|
const D = q(appDir);
|
|
156
191
|
// The staged compose file, read in place: --project-directory keeps .env and
|
|
157
192
|
// relative paths resolving against the app dir, so pull and migrate run
|
|
158
193
|
// against the new run shape while the host keeps serving from the old one.
|
|
159
194
|
const dc = `cd ${D} && docker compose`;
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
195
|
+
const s = {
|
|
196
|
+
ctx,
|
|
197
|
+
remote: new Remote(ctx, host),
|
|
198
|
+
D,
|
|
199
|
+
dc,
|
|
200
|
+
dci: `${dc} --project-directory . -f ${INCOMING}/compose.yaml`,
|
|
201
|
+
// One `web` container is assumed, hence `head -1`: the app contract binds
|
|
202
|
+
// one fixed loopback port (§ 4 PLX-App), which a second replica could not.
|
|
203
|
+
liveImage: `${dc} ps -q web 2>/dev/null | head -1 | xargs -r docker inspect --format '{{.Config.Image}}' 2>/dev/null || true`,
|
|
204
|
+
image,
|
|
205
|
+
result: { host, appDir, compose, image, healthy: false, rolledBack: false },
|
|
206
|
+
};
|
|
207
|
+
const { result } = s;
|
|
163
208
|
let staged = false;
|
|
164
209
|
try {
|
|
165
|
-
|
|
166
|
-
// never the dir's own mode, which the playbook set. Nothing the host runs
|
|
167
|
-
// from is touched until the checks below have passed.
|
|
168
|
-
await remote.exec(`rm -rf ${D}/${INCOMING} && mkdir -p ${D}/${INCOMING} && cat > ${D}/${INCOMING}/compose.yaml`, rendered);
|
|
210
|
+
await stage(s, rendered);
|
|
169
211
|
staged = true;
|
|
170
|
-
result.previous = (await remote.read(liveImage)) || undefined;
|
|
212
|
+
result.previous = (await s.remote.read(s.liveImage)) || undefined;
|
|
171
213
|
ctx.say(` previous: ${result.previous ?? (ctx.dryRun ? '<read on host>' : '<none>')}`);
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
let resolvedUrl;
|
|
177
|
-
const url = () => {
|
|
178
|
-
if (resolvedUrl === undefined)
|
|
179
|
-
throw new Error('health URL read before it was resolved');
|
|
180
|
-
return resolvedUrl;
|
|
181
|
-
};
|
|
182
|
-
if (ctx.dryRun)
|
|
183
|
-
ctx.say(' (nothing more runs when the host already serves this image from this file, healthy)');
|
|
184
|
-
else if (image ? result.previous === image : result.previous !== undefined) {
|
|
185
|
-
// A third-party app passes no ref: its file pins the image, so the same
|
|
186
|
-
// file with `web` running is the same deployment, and a platform repo
|
|
187
|
-
// can deploy every app on every push without restarting any.
|
|
188
|
-
const sameFile = await remote.test(`cd ${D} && cmp -s compose.yaml ${INCOMING}/compose.yaml`);
|
|
189
|
-
if (sameFile) {
|
|
190
|
-
resolvedUrl = options.healthUrl || (await resolveHealthUrl(remote, D, dc, ctx));
|
|
191
|
-
if (await remote.test(poll(1))) {
|
|
192
|
-
result.live = result.previous;
|
|
193
|
-
result.healthy = true;
|
|
194
|
-
result.unchanged = true;
|
|
195
|
-
ctx.done(`${result.previous} is already live and healthy; nothing to do`);
|
|
196
|
-
return result;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
// Pull → migrate (idempotent; runs only if compose.yaml declares it), both
|
|
201
|
-
// against the STAGED run shape: a failure here leaves the host exactly as
|
|
202
|
-
// it was. Every non-profiled service is pulled, not just `web`.
|
|
203
|
-
await remote.exec(`${dci} pull`);
|
|
204
|
-
// `compose run` targets the service regardless of its profile; the --profile
|
|
205
|
-
// flag is only needed for the existence check, since `config --services`
|
|
206
|
-
// hides profiled services by default. stdin from /dev/null: `compose run`
|
|
207
|
-
// is interactive by default and would wait on a terminal that is not there.
|
|
208
|
-
const migrate = await remote.test(`${dci} --profile migrate config --services 2>/dev/null | grep -qx migrate`);
|
|
209
|
-
if (migrate === undefined)
|
|
210
|
-
ctx.say(' (if compose.yaml declares a migrate service:)');
|
|
211
|
-
if (migrate !== false)
|
|
212
|
-
await remote.exec(`${dci} run --rm migrate </dev/null`);
|
|
213
|
-
// Swap the run shape into place; the previous one is kept for rollback
|
|
214
|
-
// until this run ends.
|
|
215
|
-
const hadPrev = await remote.test(`test -f ${D}/compose.yaml`);
|
|
216
|
-
if (hadPrev !== false)
|
|
217
|
-
await remote.exec(`cd ${D} && cp -p compose.yaml ${INCOMING}/compose.yaml.prev`);
|
|
218
|
-
await remote.exec(`cd ${D} && mv ${INCOMING}/compose.yaml compose.yaml`);
|
|
219
|
-
// No pull here: the new image was pulled above, the previous one is in the
|
|
220
|
-
// host's cache; a rollback must never depend on the registry answering.
|
|
221
|
-
// --remove-orphans: a service the new shape dropped goes with it, and a
|
|
222
|
-
// rollback drops the containers a failed shape started (a dependency the
|
|
223
|
-
// migrate step brought up), which would otherwise keep a stale network
|
|
224
|
-
// and break the next attempt.
|
|
225
|
-
await remote.exec(`${dc} up -d --remove-orphans`);
|
|
226
|
-
// Readiness path: /healthz by contract (§ 5 PLX-App); a third-party image
|
|
227
|
-
// that cannot serve it declares its own via the `plexus.healthz` label,
|
|
228
|
-
// read from the running container, reality, not a parse of the compose
|
|
229
|
-
// file. Each attempt is bounded, so a container that accepts connections
|
|
230
|
-
// but never answers cannot hang the deploy.
|
|
231
|
-
resolvedUrl ??= options.healthUrl || (await resolveHealthUrl(remote, D, dc, ctx));
|
|
214
|
+
if (await alreadyServing(s))
|
|
215
|
+
return result;
|
|
216
|
+
await pullAndMigrate(s);
|
|
217
|
+
const hadPrev = await swapAndUp(s);
|
|
232
218
|
const started = Date.now();
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
result.live = (await remote.read(liveImage)) || image;
|
|
219
|
+
if ((await awaitHealthy(s, retries, true)) !== false) {
|
|
220
|
+
result.live = (await s.remote.read(s.liveImage)) || image;
|
|
236
221
|
result.healthy = true;
|
|
237
222
|
if (ctx.dryRun)
|
|
238
|
-
ctx.say(' (on failure: restore the previous compose.yaml, up -d --remove-orphans,
|
|
223
|
+
ctx.say(' (on failure: restore the previous compose.yaml, up -d --remove-orphans, wait again)');
|
|
239
224
|
else
|
|
240
225
|
ctx.done(`${result.live ?? 'the app'} is live and healthy`);
|
|
241
226
|
return result;
|
|
242
227
|
}
|
|
243
228
|
ctx.say(`✗ healthcheck failed after ${Math.round((Date.now() - started) / 1000)}s; last lines from the app:`);
|
|
244
|
-
const logs = await remote.read(`${dc} logs --no-color --tail 50 web 2>&1 || true`);
|
|
229
|
+
const logs = await s.remote.read(`${dc} logs --no-color --tail 50 web 2>&1 || true`);
|
|
245
230
|
if (logs)
|
|
246
231
|
ctx.say(logs.replace(/^/gm, ' '));
|
|
247
|
-
|
|
248
|
-
// combination that was actually serving. There is something to go back to
|
|
249
|
-
// when the file changed with a container running; a first deploy, or a
|
|
250
|
-
// re-deploy of the very same run shape, has no previous state and fails
|
|
251
|
-
// loudly instead.
|
|
252
|
-
const differs = hadPrev && (await remote.test(`cd ${D} && ! cmp -s compose.yaml ${INCOMING}/compose.yaml.prev`));
|
|
253
|
-
if (!differs) {
|
|
254
|
-
ctx.done('nothing to roll back to (first deploy, or the same run shape re-deployed); manual intervention needed', false);
|
|
255
|
-
return result;
|
|
256
|
-
}
|
|
257
|
-
await remote.exec(`cd ${D} && cp -p ${INCOMING}/compose.yaml.prev compose.yaml`);
|
|
258
|
-
ctx.say(`↩ rolling back to ${result.previous ?? 'the previous compose.yaml'}`);
|
|
259
|
-
await remote.exec(`${dc} up -d --remove-orphans`);
|
|
260
|
-
result.rolledBack = true;
|
|
261
|
-
if (await remote.test(poll(retries))) {
|
|
262
|
-
result.live = result.previous;
|
|
263
|
-
ctx.done(`rolled back to ${result.previous ?? 'the previous compose.yaml'}`);
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
ctx.done('rollback also unhealthy; manual intervention needed', false);
|
|
267
|
-
}
|
|
232
|
+
await rollback(s, hadPrev, retries);
|
|
268
233
|
return result;
|
|
269
234
|
}
|
|
270
235
|
finally {
|
|
271
236
|
// The staged run shape and the rollback copy are gone on exit, whatever
|
|
272
237
|
// happened; the shared connection with them.
|
|
273
238
|
if (staged)
|
|
274
|
-
await remote.exec(`rm -rf ${D}/${INCOMING}`).catch(() => undefined);
|
|
275
|
-
await remote.close().catch(() => undefined);
|
|
239
|
+
await s.remote.exec(`rm -rf ${D}/${INCOMING}`).catch(() => undefined);
|
|
240
|
+
await s.remote.close().catch(() => undefined);
|
|
276
241
|
}
|
|
277
242
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
243
|
+
/**
|
|
244
|
+
* Stage the rendered file into a verb-owned dir inside the app dir; only the
|
|
245
|
+
* file is written, never the dir's own mode, which the playbook set. Nothing
|
|
246
|
+
* the host runs from is touched until pull and migrate have passed.
|
|
247
|
+
*/
|
|
248
|
+
async function stage(s, rendered) {
|
|
249
|
+
const { D } = s;
|
|
250
|
+
await s.remote.exec(`rm -rf ${D}/${INCOMING} && mkdir -p ${D}/${INCOMING} && cat > ${D}/${INCOMING}/compose.yaml`, rendered);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* The same image from the same run shape, healthy: nothing to do, and a
|
|
254
|
+
* promotion that changed another app leaves this one running. Decided from
|
|
255
|
+
* the host (the live container, the file it serves), never from a record.
|
|
256
|
+
*/
|
|
257
|
+
async function alreadyServing(s) {
|
|
258
|
+
const { ctx, result } = s;
|
|
259
|
+
if (ctx.dryRun) {
|
|
260
|
+
ctx.say(' (nothing more runs when the host already serves this image from this file, healthy)');
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
// A third-party app passes no ref: its file pins the image, so the same
|
|
264
|
+
// file with `web` running is the same deployment, and a platform repo can
|
|
265
|
+
// deploy every app on every push without restarting any.
|
|
266
|
+
if (!(s.image ? result.previous === s.image : result.previous !== undefined))
|
|
267
|
+
return false;
|
|
268
|
+
if (!(await s.remote.test(`cd ${s.D} && cmp -s compose.yaml ${INCOMING}/compose.yaml`)))
|
|
269
|
+
return false;
|
|
270
|
+
if (!(await awaitHealthy(s, 1)))
|
|
271
|
+
return false;
|
|
272
|
+
result.live = result.previous;
|
|
273
|
+
result.healthy = true;
|
|
274
|
+
result.unchanged = true;
|
|
275
|
+
ctx.done(`${result.previous} is already live and healthy; nothing to do`);
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Pull → migrate (idempotent; runs only if compose.yaml declares it), both
|
|
280
|
+
* against the STAGED run shape: a failure here leaves the host exactly as it
|
|
281
|
+
* was. Every non-profiled service is pulled, not just `web`.
|
|
282
|
+
*/
|
|
283
|
+
async function pullAndMigrate(s) {
|
|
284
|
+
await s.remote.exec(`${s.dci} pull`);
|
|
285
|
+
// `compose run` targets the service regardless of its profile; the --profile
|
|
286
|
+
// flag is only needed for the existence check, since `config --services`
|
|
287
|
+
// hides profiled services by default. stdin from /dev/null: `compose run`
|
|
288
|
+
// is interactive by default and would wait on a terminal that is not there.
|
|
289
|
+
const migrate = await s.remote.test(`${s.dci} --profile migrate config --services 2>/dev/null | grep -qx migrate`);
|
|
290
|
+
if (migrate === undefined)
|
|
291
|
+
s.ctx.say(' (if compose.yaml declares a migrate service:)');
|
|
292
|
+
if (migrate !== false)
|
|
293
|
+
await s.remote.exec(`${s.dci} run --rm migrate </dev/null`);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Swap the run shape into place, keeping the previous one for rollback until
|
|
297
|
+
* this run ends, and bring it up. Whether there was a previous file (undefined
|
|
298
|
+
* under --dry-run).
|
|
299
|
+
*/
|
|
300
|
+
async function swapAndUp(s) {
|
|
301
|
+
const { D } = s;
|
|
302
|
+
const hadPrev = await s.remote.test(`test -f ${D}/compose.yaml`);
|
|
303
|
+
if (hadPrev !== false)
|
|
304
|
+
await s.remote.exec(`cd ${D} && cp -p compose.yaml ${INCOMING}/compose.yaml.prev`);
|
|
305
|
+
await s.remote.exec(`cd ${D} && mv ${INCOMING}/compose.yaml compose.yaml`);
|
|
306
|
+
// No pull here: the new image was pulled above, the previous one is in the
|
|
307
|
+
// host's cache; a rollback must never depend on the registry answering.
|
|
308
|
+
// --remove-orphans: a service the new shape dropped goes with it, and a
|
|
309
|
+
// rollback drops the containers a failed shape started (a dependency the
|
|
310
|
+
// migrate step brought up), which would otherwise keep a stale network
|
|
311
|
+
// and break the next attempt.
|
|
312
|
+
await s.remote.exec(`${s.dc} up -d --remove-orphans`);
|
|
313
|
+
return hadPrev;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Wait for the `web` container to turn healthy, as Docker reports it from the
|
|
317
|
+
* healthcheck the compose file declares (PLX-App/Healthcheck): reality, read
|
|
318
|
+
* from the running container, two seconds between looks. Whether it did
|
|
319
|
+
* (undefined under --dry-run, where `show` prints the line).
|
|
320
|
+
*/
|
|
321
|
+
function awaitHealthy(s, attempts, show = false) {
|
|
322
|
+
// One `web` container is assumed, hence `head -1`: the app contract binds
|
|
323
|
+
// one fixed loopback port (§ 4 PLX-App), which a second replica could not.
|
|
324
|
+
const status = `docker compose ps -q web 2>/dev/null | head -1 | xargs -r docker inspect --format '{{if .State.Health}}{{.State.Health.Status}}{{end}}' 2>/dev/null`;
|
|
325
|
+
return s.remote.test(`cd ${s.D} && for _ in $(seq 1 ${attempts}); do [ "$(${status})" = healthy ] && exit 0; sleep 2; done; exit 1`, show);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Rollback: the previous compose file, image pinned, so it is the combination
|
|
329
|
+
* that was actually serving. There is something to go back to when the file
|
|
330
|
+
* changed with a container running; a first deploy, or a re-deploy of the
|
|
331
|
+
* very same run shape, has no previous state and fails loudly instead.
|
|
332
|
+
*/
|
|
333
|
+
async function rollback(s, hadPrev, retries) {
|
|
334
|
+
const { ctx, D, result } = s;
|
|
335
|
+
const differs = hadPrev && (await s.remote.test(`cd ${D} && ! cmp -s compose.yaml ${INCOMING}/compose.yaml.prev`));
|
|
336
|
+
if (!differs) {
|
|
337
|
+
ctx.done('nothing to roll back to (first deploy, or the same run shape re-deployed); manual intervention needed', false);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
await s.remote.exec(`cd ${D} && cp -p ${INCOMING}/compose.yaml.prev compose.yaml`);
|
|
341
|
+
ctx.say(`↩ rolling back to ${result.previous ?? 'the previous compose.yaml'}`);
|
|
342
|
+
await s.remote.exec(`${s.dc} up -d --remove-orphans`);
|
|
343
|
+
result.rolledBack = true;
|
|
344
|
+
if (await awaitHealthy(s, retries)) {
|
|
345
|
+
result.live = result.previous;
|
|
346
|
+
ctx.done(`rolled back to ${result.previous ?? 'the previous compose.yaml'}`);
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
ctx.done('rollback also unhealthy; manual intervention needed', false);
|
|
350
|
+
}
|
|
286
351
|
}
|
|
287
352
|
//# sourceMappingURL=deploy.js.map
|
package/dist/deploy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,sDAAsD;AACtD,EAAE;AACF,+FAA+F;AAC/F,2FAA2F;AAC3F,sGAAsG;AACtG,gHAAgH;AAChH,EAAE;AACF,4EAA4E;AAC5E,wEAAwE;AACxE,8DAA8D;AAC9D,2EAA2E;AAC3E,4EAA4E;AAC5E,+EAA+E;AAC/E,yEAAyE;AACzE,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,8DAA8D;AAC9D,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,2DAA2D;AAC3D,EAAE;AACF,2EAA2E;AAC3E,+EAA+E;AAC/E,+EAA+E;AAC/E,sEAAsE;AACtE,0EAA0E;AAC1E,6EAA6E;AAC7E,0EAA0E;AAC1E,2EAA2E;AAC3E,6DAA6D;AAC7D,EAAE;AACF,wEAAwE;AACxE,2GAA2G;AAC3G,2EAA2E;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAsC1C,MAAM,WAAW,GAAG,yCAAyC,CAAC;AAC9D,MAAM,QAAQ,GAAG,WAAW,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY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AK,CAAC,CAAC;IACzE,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployTargets.d.ts","sourceRoot":"","sources":["../src/deployTargets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deployTargets.d.ts","sourceRoot":"","sources":["../src/deployTargets.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAK5C,kDAAkD;AAClD,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAEhD,8CAA8C;AAC9C,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEnE,qDAAqD;AACrD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExD,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,GAAE,MAA4B,GAAG,MAAM,CAE7F;AAED,uFAAuF;AACvF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAY5E;AAED,gGAAgG;AAChG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,aAAa,CAsBzE;AAED,iGAAiG;AACjG,wBAAgB,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,GAAG,kBAAkB,CAOzF;AAED,2DAA2D;AAC3D,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAShH;AAED,sGAAsG;AACtG,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAiB/F"}
|
package/dist/deployTargets.js
CHANGED
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
// An inventory file, host_vars for a VM or group_vars for a group, carries
|
|
5
5
|
// `plexus_deploy_target` (ssh://<deploy user>@<address>[:<port>]) and the
|
|
6
6
|
// `plexus_apps` records it hosts, each with a `name` and an optional
|
|
7
|
-
// `environment` (`production` when absent). The verb maps every deployment,
|
|
8
|
-
// an environment, of a file that names a target to that target
|
|
9
|
-
// whose file carries no target is left out
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
7
|
+
// `environment` (`production` when absent). The verb maps every deployment,
|
|
8
|
+
// an app in an environment, of a file that names a target to that target. A
|
|
9
|
+
// deployment whose file carries no target is left out of the map, so the app
|
|
10
|
+
// has no target in that environment: `--apps` gives it no leg and says it has
|
|
11
|
+
// no deployment there, as `plx-ci plan` does, and no mount deploys it. The
|
|
12
|
+
// same app may have one record per environment, on the same VM or on two;
|
|
13
|
+
// the same app in the same environment declared in two files that both name
|
|
14
|
+
// a target has no one place to deploy to, and that is an error, never a pick.
|
|
14
15
|
//
|
|
15
16
|
// plx deploy-targets [inventory] # {"app": {"production": "ssh://...", "staging": "ssh://..."}, ...}
|
|
16
17
|
// plx deploy-targets --environment production [inventory] # {"app": "ssh://...", ...}, one environment, flat
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployTargets.js","sourceRoot":"","sources":["../src/deployTargets.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,qEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"deployTargets.js","sourceRoot":"","sources":["../src/deployTargets.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,qEAAqE;AACrE,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,2EAA2E;AAC3E,0EAA0E;AAC1E,4EAA4E;AAC5E,8EAA8E;AAC9E,EAAE;AACF,0HAA0H;AAC1H,+GAA+G;AAC/G,wIAAwI;AACxI,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,SAAS,GAAG,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;AAE9C,kDAAkD;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAoBhD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,cAAsB,mBAAmB;IACnF,OAAO,WAAW,KAAK,mBAAmB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAC7E,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,IAAY;IAC3D,MAAM,IAAI,GAAY,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,IAAgC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChG,MAAM,MAAM,GAAG,OAAO,IAA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