@milaboratories/pl-deployments 1.6.1 → 1.7.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/dist/common/os_and_arch.d.ts.map +1 -1
- package/dist/common/pl_binary.d.ts.map +1 -1
- package/dist/common/pl_binary_download.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -44
- package/dist/index.mjs.map +1 -1
- package/dist/local/options.d.ts +1 -1
- package/dist/local/options.d.ts.map +1 -1
- package/dist/local/pl.d.ts +1 -1
- package/dist/local/pl.d.ts.map +1 -1
- package/dist/local/process.d.ts +1 -1
- package/dist/local/process.d.ts.map +1 -1
- package/dist/ssh/pl.d.ts.map +1 -1
- package/dist/ssh/ssh.d.ts +1 -1
- package/dist/ssh/ssh.d.ts.map +1 -1
- package/package.json +10 -6
- package/src/common/os_and_arch.ts +0 -2
- package/src/common/pl_binary.ts +2 -1
- package/src/common/pl_binary_download.ts +8 -7
- package/src/local/options.ts +1 -1
- package/src/local/pid.ts +1 -1
- package/src/local/pl.ts +8 -8
- package/src/local/process.ts +4 -3
- package/src/ssh/__tests__/common-utils.ts +4 -4
- package/src/ssh/pl.ts +1 -2
- package/src/ssh/ssh.ts +12 -11
- package/src/ssh/supervisord.ts +1 -1
package/dist/local/process.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/local/process.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/local/process.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG3D,MAAM,MAAM,cAAc,GAA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E,CAAC;IAC7C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,eAAe,CAAC,EAAE,2BAA2B,CAAC;IAC9C,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAoBF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAOxD"}
|
package/dist/ssh/ssh.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConnectConfig, SFTPWrapper, default as ssh, Client } from 'ssh2';
|
|
2
|
-
import { default as net } from 'net';
|
|
2
|
+
import { default as net } from 'node:net';
|
|
3
3
|
import { MiLogger } from '@milaboratories/ts-helpers';
|
|
4
4
|
export type SshAuthMethods = 'publickey' | 'password';
|
|
5
5
|
export type SshAuthMethodsResult = SshAuthMethods[];
|
package/dist/ssh/ssh.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssh.d.ts","sourceRoot":"","sources":["../../src/ssh/ssh.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ssh.d.ts","sourceRoot":"","sources":["../../src/ssh/ssh.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAiB,WAAW,EAAE,MAAM,MAAM,CAAC;AACtE,OAAO,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,GAAG,MAAM,UAAU,CAAC;AAK3B,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAQ7E,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,CAAC;AACtD,MAAM,MAAM,oBAAoB,GAAG,cAAc,EAAE,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CA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U,EAAE,MAAM,EAAE,IAAI,GAAE,MAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BtF;;;;;OAKG;IACU,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAalF;;OAEG;IACI,KAAK,IAAI,IAAI;CAIrB;AAED,MAAM,MAAM,aAAa,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-deployments",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"pl-version": "1.26.
|
|
3
|
+
"version": "1.7.1",
|
|
4
|
+
"pl-version": "1.26.4",
|
|
5
5
|
"description": "MiLaboratories Platforma Backend code service run wrapper",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=20.16.0"
|
|
8
|
+
},
|
|
6
9
|
"types": "./dist/index.d.ts",
|
|
7
10
|
"main": "./dist/index.js",
|
|
8
11
|
"module": "./dist/index.mjs",
|
|
@@ -39,8 +42,8 @@
|
|
|
39
42
|
"utility-types": "^3.11.0",
|
|
40
43
|
"vite": "^5.4.11",
|
|
41
44
|
"vitest": "^2.1.8",
|
|
42
|
-
"@milaboratories/
|
|
43
|
-
"@milaboratories/
|
|
45
|
+
"@milaboratories/eslint-config": "^1.0.4",
|
|
46
|
+
"@milaboratories/platforma-build-configs": "1.0.3"
|
|
44
47
|
},
|
|
45
48
|
"dependencies": {
|
|
46
49
|
"decompress": "^4.2.1",
|
|
@@ -50,12 +53,13 @@
|
|
|
50
53
|
"undici": "~7.5.0",
|
|
51
54
|
"yaml": "^2.7.0",
|
|
52
55
|
"zod": "~3.23.8",
|
|
53
|
-
"@milaboratories/
|
|
54
|
-
"@milaboratories/
|
|
56
|
+
"@milaboratories/ts-helpers": "^1.1.5",
|
|
57
|
+
"@milaboratories/pl-config": "^1.4.5"
|
|
55
58
|
},
|
|
56
59
|
"scripts": {
|
|
57
60
|
"type-check": "tsc --noEmit --composite false",
|
|
58
61
|
"build": "vite build",
|
|
62
|
+
"lint": "eslint .",
|
|
59
63
|
"test": "vitest",
|
|
60
64
|
"do-pack": "rm -rf src/.test && rm -f *.tgz && pnpm pack && mv *.tgz package.tgz",
|
|
61
65
|
"cleanup-docker": "docker container stop pl-ssh-test-pl pl-ssh-test-ssh && docker container rm pl-ssh-test-pl pl-ssh-test-ssh && docker image rm pl-ssh-test-container-ssh:1.0.0 pl-ssh-test-container-pl:1.0.0",
|
package/src/common/pl_binary.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { MiLogger } from '@milaboratories/ts-helpers';
|
|
|
2
2
|
import { assertNever } from '@milaboratories/ts-helpers';
|
|
3
3
|
import { downloadBinary } from './pl_binary_download';
|
|
4
4
|
import { getDefaultPlVersion } from './pl_version';
|
|
5
|
-
import os from 'os';
|
|
5
|
+
import os from 'node:os';
|
|
6
6
|
import upath from 'upath';
|
|
7
7
|
import type { OSType } from './os_and_arch';
|
|
8
8
|
import { newOs } from './os_and_arch';
|
|
@@ -31,6 +31,7 @@ export async function resolveLocalPlBinaryPath(
|
|
|
31
31
|
): Promise<string> {
|
|
32
32
|
switch (src.type) {
|
|
33
33
|
case 'Download':
|
|
34
|
+
// eslint-disable-next-line no-case-declarations
|
|
34
35
|
const ops = await downloadBinary(logger, downloadDir, 'pl', `pl-${src.version}`, os.arch(), os.platform());
|
|
35
36
|
return upath.join(ops.baseName, 'binaries', osToBinaryName[newOs(os.platform())]);
|
|
36
37
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import fsp from 'fs/promises';
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import fsp from 'node:fs/promises';
|
|
3
3
|
import upath from 'upath';
|
|
4
4
|
import { request } from 'undici';
|
|
5
|
-
import { Writable, Readable } from 'stream';
|
|
6
|
-
import { text } from 'stream/consumers';
|
|
5
|
+
import { Writable, Readable } from 'node:stream';
|
|
6
|
+
import { text } from 'node:stream/consumers';
|
|
7
7
|
import * as tar from 'tar';
|
|
8
8
|
import type { MiLogger } from '@milaboratories/ts-helpers';
|
|
9
9
|
import { assertNever, fileExists } from '@milaboratories/ts-helpers';
|
|
@@ -40,7 +40,7 @@ export async function downloadBinaryNoExtract(
|
|
|
40
40
|
try {
|
|
41
41
|
await downloadArchive(logger, archiveUrl, archivePath);
|
|
42
42
|
opts.wasDownloadedFrom = archiveUrl;
|
|
43
|
-
} catch (
|
|
43
|
+
} catch (_e) {
|
|
44
44
|
await downloadArchive(logger, alternativeArchiveGAUrl, archivePath);
|
|
45
45
|
opts.wasDownloadedFrom = alternativeArchiveGAUrl;
|
|
46
46
|
}
|
|
@@ -57,12 +57,12 @@ export async function downloadBinary(
|
|
|
57
57
|
platform: string,
|
|
58
58
|
): Promise<DownloadBinaryResult> {
|
|
59
59
|
const opts = getPathsForDownload(softwareName, archiveName, baseDir, newArch(arch), newOs(platform));
|
|
60
|
-
const { archiveUrl, alternativeArchiveGAUrl, archivePath, archiveType, targetFolder
|
|
60
|
+
const { archiveUrl, alternativeArchiveGAUrl, archivePath, archiveType, targetFolder } = opts;
|
|
61
61
|
|
|
62
62
|
try {
|
|
63
63
|
await downloadArchive(logger, archiveUrl, archivePath);
|
|
64
64
|
opts.wasDownloadedFrom = archiveUrl;
|
|
65
|
-
} catch (
|
|
65
|
+
} catch (_e) {
|
|
66
66
|
await downloadArchive(logger, alternativeArchiveGAUrl, archivePath);
|
|
67
67
|
opts.wasDownloadedFrom = alternativeArchiveGAUrl;
|
|
68
68
|
}
|
|
@@ -142,6 +142,7 @@ export async function downloadArchive(
|
|
|
142
142
|
|
|
143
143
|
// to prevent incomplete downloads we first write in a temp file
|
|
144
144
|
state.tmpPath = dstArchiveFile + '.tmp';
|
|
145
|
+
// eslint-disable-next-line n/no-unsupported-features/node-builtins
|
|
145
146
|
await Readable.toWeb(body).pipeTo(Writable.toWeb(fs.createWriteStream(state.tmpPath)));
|
|
146
147
|
state.wroteTmp = true;
|
|
147
148
|
state.tmpExisted = await fileExists(state.tmpPath);
|
package/src/local/options.ts
CHANGED
package/src/local/pid.ts
CHANGED
package/src/local/pl.ts
CHANGED
|
@@ -10,12 +10,12 @@ import type { PlBinarySource } from '../common/pl_binary';
|
|
|
10
10
|
import { newDefaultPlBinarySource, resolveLocalPlBinaryPath } from '../common/pl_binary';
|
|
11
11
|
import type { MiLogger } from '@milaboratories/ts-helpers';
|
|
12
12
|
import { notEmpty } from '@milaboratories/ts-helpers';
|
|
13
|
-
import type { ChildProcess, SpawnOptions } from 'child_process';
|
|
13
|
+
import type { ChildProcess, SpawnOptions } from 'node:child_process';
|
|
14
14
|
import { filePid, readPid, writePid } from './pid';
|
|
15
15
|
import type { Trace } from './trace';
|
|
16
16
|
import { withTrace } from './trace';
|
|
17
17
|
import upath from 'upath';
|
|
18
|
-
import fsp from 'fs/promises';
|
|
18
|
+
import fsp from 'node:fs/promises';
|
|
19
19
|
import type { Required } from 'utility-types';
|
|
20
20
|
|
|
21
21
|
export const LocalConfigYaml = 'config-local.yaml';
|
|
@@ -53,19 +53,19 @@ export class LocalPl {
|
|
|
53
53
|
);
|
|
54
54
|
|
|
55
55
|
// keep in mind there are no awaits here, it will be asynchronous
|
|
56
|
-
if (this.onError !== undefined) this.onError(this);
|
|
57
|
-
if (this.onCloseAndError !== undefined) this.onCloseAndError(this);
|
|
56
|
+
if (this.onError !== undefined) void this.onError(this);
|
|
57
|
+
if (this.onCloseAndError !== undefined) void this.onCloseAndError(this);
|
|
58
58
|
if (this.onCloseAndErrorNoStop !== undefined && !this.wasStopped)
|
|
59
|
-
this.onCloseAndErrorNoStop(this);
|
|
59
|
+
void this.onCloseAndErrorNoStop(this);
|
|
60
60
|
});
|
|
61
61
|
instance.on('close', () => {
|
|
62
62
|
this.logger.warn(`platforma was closed, started opts: ${JSON.stringify(this.debugInfo())}`);
|
|
63
63
|
|
|
64
64
|
// keep in mind there are no awaits here, it will be asynchronous
|
|
65
|
-
if (this.onClose !== undefined) this.onClose(this);
|
|
66
|
-
if (this.onCloseAndError !== undefined) this.onCloseAndError(this);
|
|
65
|
+
if (this.onClose !== undefined) void this.onClose(this);
|
|
66
|
+
if (this.onCloseAndError !== undefined) void this.onCloseAndError(this);
|
|
67
67
|
if (this.onCloseAndErrorNoStop !== undefined && !this.wasStopped)
|
|
68
|
-
this.onCloseAndErrorNoStop(this);
|
|
68
|
+
void this.onCloseAndErrorNoStop(this);
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
trace('started', true);
|
package/src/local/process.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SpawnOptions, ChildProcess } from 'child_process';
|
|
2
|
-
import { spawn } from 'child_process';
|
|
1
|
+
import type { SpawnOptions, ChildProcess } from 'node:child_process';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
3
|
import type { MiLogger } from '@milaboratories/ts-helpers';
|
|
4
4
|
import { sleep } from '@milaboratories/ts-helpers';
|
|
5
5
|
|
|
@@ -18,11 +18,12 @@ wd: ${opts.opts.cwd}`);
|
|
|
18
18
|
return spawn(opts.cmd, opts.args, opts.opts);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
21
22
|
export async function isProcessAlive(pid: number) {
|
|
22
23
|
try {
|
|
23
24
|
process.kill(pid, 0);
|
|
24
25
|
return true;
|
|
25
|
-
} catch (
|
|
26
|
+
} catch (_e) {
|
|
26
27
|
return false;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { StartedTestContainer } from 'testcontainers';
|
|
2
2
|
import { GenericContainer } from 'testcontainers';
|
|
3
|
-
import { writeFileSync, readFileSync, unlinkSync, existsSync } from 'fs';
|
|
4
|
-
import { mkdir, rm } from 'fs/promises';
|
|
5
|
-
import path from 'path';
|
|
3
|
+
import { writeFileSync, readFileSync, unlinkSync, existsSync } from 'node:fs';
|
|
4
|
+
import { mkdir, rm } from 'node:fs/promises';
|
|
5
|
+
import path from 'node:path';
|
|
6
6
|
import type { ConnectConfig } from 'ssh2';
|
|
7
7
|
import ssh from 'ssh2';
|
|
8
|
-
import fs from 'fs';
|
|
8
|
+
import fs from 'node:fs';
|
|
9
9
|
|
|
10
10
|
const SSH_PORT = [22, 3001];
|
|
11
11
|
|
package/src/ssh/pl.ts
CHANGED
|
@@ -8,7 +8,7 @@ import upath from 'upath';
|
|
|
8
8
|
import * as plpath from './pl_paths';
|
|
9
9
|
import { getDefaultPlVersion } from '../common/pl_version';
|
|
10
10
|
|
|
11
|
-
import net from 'net';
|
|
11
|
+
import net from 'node:net';
|
|
12
12
|
import type { PlConfig, PlLicenseMode, SshPlConfigGenerationResult } from '@milaboratories/pl-config';
|
|
13
13
|
import { generateSshPlConfigs, getFreePort } from '@milaboratories/pl-config';
|
|
14
14
|
import type { SupervisorStatus } from './supervisord';
|
|
@@ -488,7 +488,6 @@ export type SshPlConfig = {
|
|
|
488
488
|
useGlobalAccess?: boolean;
|
|
489
489
|
plBinary?: PlBinarySourceDownload;
|
|
490
490
|
|
|
491
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
492
491
|
onProgress?: (...args: any) => Promise<any>;
|
|
493
492
|
plConfigPostprocessing?: (config: PlConfig) => PlConfig;
|
|
494
493
|
};
|
package/src/ssh/ssh.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-misused-promises */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-base-to-string */
|
|
1
3
|
import type { ConnectConfig, ClientChannel, SFTPWrapper } from 'ssh2';
|
|
2
4
|
import ssh, { Client } from 'ssh2';
|
|
3
|
-
import net from 'net';
|
|
4
|
-
import dns from 'dns';
|
|
5
|
-
import fs from 'fs';
|
|
6
|
-
import { readFile } from 'fs/promises';
|
|
5
|
+
import net from 'node:net';
|
|
6
|
+
import dns from 'node:dns';
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import { readFile } from 'node:fs/promises';
|
|
7
9
|
import upath from 'upath';
|
|
8
10
|
import { RetryablePromise, type MiLogger } from '@milaboratories/ts-helpers';
|
|
9
|
-
import { randomBytes } from 'crypto';
|
|
11
|
+
import { randomBytes } from 'node:crypto';
|
|
10
12
|
|
|
11
13
|
const defaultConfig: ConnectConfig = {
|
|
12
14
|
keepaliveInterval: 60000,
|
|
@@ -76,10 +78,9 @@ export class SshClient {
|
|
|
76
78
|
*/
|
|
77
79
|
public async exec(command: string): Promise<SshExecResult> {
|
|
78
80
|
return new Promise((resolve, reject) => {
|
|
79
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
80
81
|
this.client.exec(command, (err: any, stream: ClientChannel) => {
|
|
81
82
|
if (err) {
|
|
82
|
-
return reject(`ssh.exec: ${command}: ${err}`);
|
|
83
|
+
return reject(new Error(`ssh.exec: ${command}: ${err}`));
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
let stdout = '';
|
|
@@ -361,7 +362,7 @@ export class SshClient {
|
|
|
361
362
|
try {
|
|
362
363
|
await this.getForderStructure(sftp, itemPath, data);
|
|
363
364
|
} catch (error) {
|
|
364
|
-
return reject(error);
|
|
365
|
+
return reject(error instanceof Error ? error : new Error(String(error)));
|
|
365
366
|
}
|
|
366
367
|
} else {
|
|
367
368
|
data.files.push(itemPath);
|
|
@@ -489,8 +490,8 @@ export class SshClient {
|
|
|
489
490
|
|
|
490
491
|
public uploadFileUsingExistingSftp(sftp: SFTPWrapper, localPath: string, remotePath: string, mode: number = 0o660) {
|
|
491
492
|
return new Promise((resolve, reject) => {
|
|
492
|
-
readFile(localPath).then(async (result: Buffer) => {
|
|
493
|
-
this.writeFile(sftp, remotePath, result, mode)
|
|
493
|
+
void readFile(localPath).then(async (result: Buffer) => {
|
|
494
|
+
return this.writeFile(sftp, remotePath, result, mode)
|
|
494
495
|
.then(() => {
|
|
495
496
|
resolve(undefined);
|
|
496
497
|
})
|
|
@@ -541,7 +542,7 @@ export class SshClient {
|
|
|
541
542
|
*/
|
|
542
543
|
public async uploadDirectory(localDir: string, remoteDir: string, mode: number = 0o660): Promise<void> {
|
|
543
544
|
return new Promise((resolve, reject) => {
|
|
544
|
-
this.withSftp(async (sftp: SFTPWrapper) => {
|
|
545
|
+
void this.withSftp(async (sftp: SFTPWrapper) => {
|
|
545
546
|
try {
|
|
546
547
|
await this.__uploadDirectory(sftp, localDir, remoteDir, mode);
|
|
547
548
|
resolve();
|
package/src/ssh/supervisord.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { MiLogger } from '@milaboratories/ts-helpers';
|
|
4
4
|
import * as plpath from './pl_paths';
|
|
5
5
|
import type { SshClient, SshExecResult } from './ssh';
|
|
6
|
-
import { randomBytes } from 'crypto';
|
|
6
|
+
import { randomBytes } from 'node:crypto';
|
|
7
7
|
|
|
8
8
|
export async function supervisorCtlStart(
|
|
9
9
|
sshClient: SshClient,
|