@milaboratories/pl-deployments 1.1.10 → 1.1.12
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/pl_binary.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +485 -421
- package/dist/index.mjs.map +1 -1
- package/dist/ssh/__tests__/common-utils.d.ts.map +1 -1
- package/dist/ssh/connection_info.d.ts +266 -0
- package/dist/ssh/connection_info.d.ts.map +1 -0
- package/dist/ssh/pl.d.ts +26 -37
- package/dist/ssh/pl.d.ts.map +1 -1
- package/dist/ssh/pl_paths.d.ts +1 -0
- package/dist/ssh/pl_paths.d.ts.map +1 -1
- package/dist/ssh/ssh.d.ts +0 -1
- package/dist/ssh/ssh.d.ts.map +1 -1
- package/dist/ssh/supervisord.d.ts +11 -2
- package/dist/ssh/supervisord.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/common/pl_binary.ts +2 -1
- package/src/index.ts +1 -0
- package/src/ssh/__tests__/common-utils.ts +5 -3
- package/src/ssh/__tests__/pl-docker.test.ts +33 -14
- package/src/ssh/__tests__/ssh-docker.test.ts +1 -1
- package/src/ssh/connection_info.ts +62 -0
- package/src/ssh/pl.ts +78 -76
- package/src/ssh/pl_paths.ts +6 -2
- package/src/ssh/ssh.ts +8 -10
- package/src/ssh/supervisord.ts +26 -12
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PortPair: z.ZodObject<{
|
|
3
|
+
local: z.ZodNumber;
|
|
4
|
+
remote: z.ZodNumber;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
local: number;
|
|
7
|
+
remote: number;
|
|
8
|
+
}, {
|
|
9
|
+
local: number;
|
|
10
|
+
remote: number;
|
|
11
|
+
}>;
|
|
12
|
+
/** The pair of ports for forwarding. */
|
|
13
|
+
export type PortPair = z.infer<typeof PortPair>;
|
|
14
|
+
export declare const SshPlPorts: z.ZodObject<{
|
|
15
|
+
grpc: z.ZodObject<{
|
|
16
|
+
local: z.ZodNumber;
|
|
17
|
+
remote: z.ZodNumber;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
local: number;
|
|
20
|
+
remote: number;
|
|
21
|
+
}, {
|
|
22
|
+
local: number;
|
|
23
|
+
remote: number;
|
|
24
|
+
}>;
|
|
25
|
+
monitoring: z.ZodObject<{
|
|
26
|
+
local: z.ZodNumber;
|
|
27
|
+
remote: z.ZodNumber;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
local: number;
|
|
30
|
+
remote: number;
|
|
31
|
+
}, {
|
|
32
|
+
local: number;
|
|
33
|
+
remote: number;
|
|
34
|
+
}>;
|
|
35
|
+
debug: z.ZodObject<{
|
|
36
|
+
local: z.ZodNumber;
|
|
37
|
+
remote: z.ZodNumber;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
local: number;
|
|
40
|
+
remote: number;
|
|
41
|
+
}, {
|
|
42
|
+
local: number;
|
|
43
|
+
remote: number;
|
|
44
|
+
}>;
|
|
45
|
+
minioPort: z.ZodObject<{
|
|
46
|
+
local: z.ZodNumber;
|
|
47
|
+
remote: z.ZodNumber;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
local: number;
|
|
50
|
+
remote: number;
|
|
51
|
+
}, {
|
|
52
|
+
local: number;
|
|
53
|
+
remote: number;
|
|
54
|
+
}>;
|
|
55
|
+
minioConsolePort: z.ZodObject<{
|
|
56
|
+
local: z.ZodNumber;
|
|
57
|
+
remote: z.ZodNumber;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
local: number;
|
|
60
|
+
remote: number;
|
|
61
|
+
}, {
|
|
62
|
+
local: number;
|
|
63
|
+
remote: number;
|
|
64
|
+
}>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
grpc: {
|
|
67
|
+
local: number;
|
|
68
|
+
remote: number;
|
|
69
|
+
};
|
|
70
|
+
monitoring: {
|
|
71
|
+
local: number;
|
|
72
|
+
remote: number;
|
|
73
|
+
};
|
|
74
|
+
debug: {
|
|
75
|
+
local: number;
|
|
76
|
+
remote: number;
|
|
77
|
+
};
|
|
78
|
+
minioPort: {
|
|
79
|
+
local: number;
|
|
80
|
+
remote: number;
|
|
81
|
+
};
|
|
82
|
+
minioConsolePort: {
|
|
83
|
+
local: number;
|
|
84
|
+
remote: number;
|
|
85
|
+
};
|
|
86
|
+
}, {
|
|
87
|
+
grpc: {
|
|
88
|
+
local: number;
|
|
89
|
+
remote: number;
|
|
90
|
+
};
|
|
91
|
+
monitoring: {
|
|
92
|
+
local: number;
|
|
93
|
+
remote: number;
|
|
94
|
+
};
|
|
95
|
+
debug: {
|
|
96
|
+
local: number;
|
|
97
|
+
remote: number;
|
|
98
|
+
};
|
|
99
|
+
minioPort: {
|
|
100
|
+
local: number;
|
|
101
|
+
remote: number;
|
|
102
|
+
};
|
|
103
|
+
minioConsolePort: {
|
|
104
|
+
local: number;
|
|
105
|
+
remote: number;
|
|
106
|
+
};
|
|
107
|
+
}>;
|
|
108
|
+
/** All info about ports that are forwarded. */
|
|
109
|
+
export type SshPlPorts = z.infer<typeof SshPlPorts>;
|
|
110
|
+
export declare const ConnectionInfo: z.ZodObject<{
|
|
111
|
+
plUser: z.ZodString;
|
|
112
|
+
plPassword: z.ZodString;
|
|
113
|
+
ports: z.ZodObject<{
|
|
114
|
+
grpc: z.ZodObject<{
|
|
115
|
+
local: z.ZodNumber;
|
|
116
|
+
remote: z.ZodNumber;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
local: number;
|
|
119
|
+
remote: number;
|
|
120
|
+
}, {
|
|
121
|
+
local: number;
|
|
122
|
+
remote: number;
|
|
123
|
+
}>;
|
|
124
|
+
monitoring: z.ZodObject<{
|
|
125
|
+
local: z.ZodNumber;
|
|
126
|
+
remote: z.ZodNumber;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
local: number;
|
|
129
|
+
remote: number;
|
|
130
|
+
}, {
|
|
131
|
+
local: number;
|
|
132
|
+
remote: number;
|
|
133
|
+
}>;
|
|
134
|
+
debug: z.ZodObject<{
|
|
135
|
+
local: z.ZodNumber;
|
|
136
|
+
remote: z.ZodNumber;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
local: number;
|
|
139
|
+
remote: number;
|
|
140
|
+
}, {
|
|
141
|
+
local: number;
|
|
142
|
+
remote: number;
|
|
143
|
+
}>;
|
|
144
|
+
minioPort: z.ZodObject<{
|
|
145
|
+
local: z.ZodNumber;
|
|
146
|
+
remote: z.ZodNumber;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
local: number;
|
|
149
|
+
remote: number;
|
|
150
|
+
}, {
|
|
151
|
+
local: number;
|
|
152
|
+
remote: number;
|
|
153
|
+
}>;
|
|
154
|
+
minioConsolePort: z.ZodObject<{
|
|
155
|
+
local: z.ZodNumber;
|
|
156
|
+
remote: z.ZodNumber;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
local: number;
|
|
159
|
+
remote: number;
|
|
160
|
+
}, {
|
|
161
|
+
local: number;
|
|
162
|
+
remote: number;
|
|
163
|
+
}>;
|
|
164
|
+
}, "strip", z.ZodTypeAny, {
|
|
165
|
+
grpc: {
|
|
166
|
+
local: number;
|
|
167
|
+
remote: number;
|
|
168
|
+
};
|
|
169
|
+
monitoring: {
|
|
170
|
+
local: number;
|
|
171
|
+
remote: number;
|
|
172
|
+
};
|
|
173
|
+
debug: {
|
|
174
|
+
local: number;
|
|
175
|
+
remote: number;
|
|
176
|
+
};
|
|
177
|
+
minioPort: {
|
|
178
|
+
local: number;
|
|
179
|
+
remote: number;
|
|
180
|
+
};
|
|
181
|
+
minioConsolePort: {
|
|
182
|
+
local: number;
|
|
183
|
+
remote: number;
|
|
184
|
+
};
|
|
185
|
+
}, {
|
|
186
|
+
grpc: {
|
|
187
|
+
local: number;
|
|
188
|
+
remote: number;
|
|
189
|
+
};
|
|
190
|
+
monitoring: {
|
|
191
|
+
local: number;
|
|
192
|
+
remote: number;
|
|
193
|
+
};
|
|
194
|
+
debug: {
|
|
195
|
+
local: number;
|
|
196
|
+
remote: number;
|
|
197
|
+
};
|
|
198
|
+
minioPort: {
|
|
199
|
+
local: number;
|
|
200
|
+
remote: number;
|
|
201
|
+
};
|
|
202
|
+
minioConsolePort: {
|
|
203
|
+
local: number;
|
|
204
|
+
remote: number;
|
|
205
|
+
};
|
|
206
|
+
}>;
|
|
207
|
+
useGlobalAccess: z.ZodDefault<z.ZodBoolean>;
|
|
208
|
+
}, "strip", z.ZodTypeAny, {
|
|
209
|
+
plUser: string;
|
|
210
|
+
plPassword: string;
|
|
211
|
+
ports: {
|
|
212
|
+
grpc: {
|
|
213
|
+
local: number;
|
|
214
|
+
remote: number;
|
|
215
|
+
};
|
|
216
|
+
monitoring: {
|
|
217
|
+
local: number;
|
|
218
|
+
remote: number;
|
|
219
|
+
};
|
|
220
|
+
debug: {
|
|
221
|
+
local: number;
|
|
222
|
+
remote: number;
|
|
223
|
+
};
|
|
224
|
+
minioPort: {
|
|
225
|
+
local: number;
|
|
226
|
+
remote: number;
|
|
227
|
+
};
|
|
228
|
+
minioConsolePort: {
|
|
229
|
+
local: number;
|
|
230
|
+
remote: number;
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
useGlobalAccess: boolean;
|
|
234
|
+
}, {
|
|
235
|
+
plUser: string;
|
|
236
|
+
plPassword: string;
|
|
237
|
+
ports: {
|
|
238
|
+
grpc: {
|
|
239
|
+
local: number;
|
|
240
|
+
remote: number;
|
|
241
|
+
};
|
|
242
|
+
monitoring: {
|
|
243
|
+
local: number;
|
|
244
|
+
remote: number;
|
|
245
|
+
};
|
|
246
|
+
debug: {
|
|
247
|
+
local: number;
|
|
248
|
+
remote: number;
|
|
249
|
+
};
|
|
250
|
+
minioPort: {
|
|
251
|
+
local: number;
|
|
252
|
+
remote: number;
|
|
253
|
+
};
|
|
254
|
+
minioConsolePort: {
|
|
255
|
+
local: number;
|
|
256
|
+
remote: number;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
useGlobalAccess?: boolean | undefined;
|
|
260
|
+
}>;
|
|
261
|
+
/** The content of the file that holds all the info about the connection on the remote server. */
|
|
262
|
+
export type ConnectionInfo = z.infer<typeof ConnectionInfo>;
|
|
263
|
+
export declare function newConnectionInfo(plUser: string, plPassword: string, ports: SshPlPorts, useGlobalAccess: boolean): ConnectionInfo;
|
|
264
|
+
export declare function parseConnectionInfo(content: string): ConnectionInfo;
|
|
265
|
+
export declare function stringifyConnectionInfo(conn: ConnectionInfo): string;
|
|
266
|
+
//# sourceMappingURL=connection_info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection_info.d.ts","sourceRoot":"","sources":["../../src/ssh/connection_info.ts"],"names":[],"mappings":"AAAA;kFACkF;AAClF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,QAAQ;;;;;;;;;EAGnB,CAAC;AACH,wCAAwC;AACxC,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMrB,CAAC;AACH,+CAA+C;AAC/C,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQzB,CAAC;AACH,iGAAiG;AACjG,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAM5D,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,GACvB,cAAc,CAOhB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAEnE;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAEpE"}
|
package/dist/ssh/pl.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { SshClient } from './ssh';
|
|
|
2
2
|
import { MiLogger } from '@milaboratories/ts-helpers';
|
|
3
3
|
import { DownloadBinaryResult } from '../common/pl_binary_download';
|
|
4
4
|
import { PlLicenseMode, SshPlConfigGenerationResult } from '@milaboratories/pl-config';
|
|
5
|
+
import { SupervisorStatus } from './supervisord';
|
|
6
|
+
import { ConnectionInfo, SshPlPorts } from './connection_info';
|
|
5
7
|
import type * as ssh from 'ssh2';
|
|
6
8
|
export declare class SshPl {
|
|
7
9
|
readonly logger: MiLogger;
|
|
@@ -15,11 +17,22 @@ export declare class SshPl {
|
|
|
15
17
|
};
|
|
16
18
|
static init(logger: MiLogger, config: ssh.ConnectConfig): Promise<SshPl>;
|
|
17
19
|
cleanUp(): void;
|
|
18
|
-
|
|
20
|
+
/** Provides an info if the platforma and minio are running along with the debug info. */
|
|
21
|
+
isAlive(): Promise<SupervisorStatus>;
|
|
22
|
+
/** Starts all the services on the server.
|
|
23
|
+
* Idempotent semantic: we could call it several times. */
|
|
19
24
|
start(): Promise<void>;
|
|
25
|
+
/** Stops all the services on the server.
|
|
26
|
+
* Idempotent semantic: we could call it several times. */
|
|
20
27
|
stop(): Promise<void>;
|
|
28
|
+
/** Stops the services, deletes a directory with the state and closes SSH connection. */
|
|
21
29
|
reset(): Promise<boolean>;
|
|
22
|
-
|
|
30
|
+
/** Stops platforma and deletes its state. */
|
|
31
|
+
stopAndClean(): Promise<void>;
|
|
32
|
+
/** Downloads binaries and untar them on the server,
|
|
33
|
+
* generates all the configs, creates necessary dirs,
|
|
34
|
+
* and finally starts all the services. */
|
|
35
|
+
platformaInit(options: SshPlConfig): Promise<ConnectionInfo>;
|
|
23
36
|
downloadBinariesAndUploadToTheServer(localWorkdir: string, remoteHome: string, arch: Arch): Promise<{
|
|
24
37
|
history: DownloadAndUntarState[];
|
|
25
38
|
minioRelPath: string;
|
|
@@ -27,40 +40,20 @@ export declare class SshPl {
|
|
|
27
40
|
}>;
|
|
28
41
|
/** We have to extract pl in the remote server,
|
|
29
42
|
* because Windows doesn't support symlinks
|
|
30
|
-
* that are found in
|
|
31
|
-
* For this reason, we extract all to the remote server.
|
|
43
|
+
* that are found in Linux pl binaries tgz archive.
|
|
44
|
+
* For this reason, we extract all to the remote server.
|
|
45
|
+
* It requires `tar` to be installed on the server
|
|
46
|
+
* (it's not installed for Rocky Linux for example). */
|
|
32
47
|
downloadAndUntar(localWorkdir: string, remoteHome: string, arch: Arch, softwareName: string, tgzName: string): Promise<DownloadAndUntarState>;
|
|
33
48
|
needDownload(remoteHome: string, arch: Arch): Promise<boolean>;
|
|
34
49
|
checkIsAliveWithInterval(interval?: number, count?: number, shouldStart?: boolean): Promise<void>;
|
|
35
|
-
getUserCredentials(remoteHome: string): Promise<
|
|
36
|
-
fetchPorts(remoteHome: string, arch: Arch): Promise<
|
|
50
|
+
getUserCredentials(remoteHome: string): Promise<ConnectionInfo>;
|
|
51
|
+
fetchPorts(remoteHome: string, arch: Arch): Promise<SshPlPorts>;
|
|
37
52
|
getLocalFreePort(): Promise<number>;
|
|
38
53
|
getFreePortForPlatformaOnServer(remoteHome: string, arch: Arch): Promise<number>;
|
|
39
54
|
getArch(): Promise<Arch>;
|
|
40
55
|
getUserHomeDirectory(): Promise<string>;
|
|
41
56
|
}
|
|
42
|
-
export type SshPlatformaPorts = {
|
|
43
|
-
grpc: {
|
|
44
|
-
local: number;
|
|
45
|
-
remote: number;
|
|
46
|
-
};
|
|
47
|
-
monitoring: {
|
|
48
|
-
local: number;
|
|
49
|
-
remote: number;
|
|
50
|
-
};
|
|
51
|
-
debug: {
|
|
52
|
-
local: number;
|
|
53
|
-
remote: number;
|
|
54
|
-
};
|
|
55
|
-
minioPort: {
|
|
56
|
-
local: number;
|
|
57
|
-
remote: number;
|
|
58
|
-
};
|
|
59
|
-
minioConsolePort: {
|
|
60
|
-
local: number;
|
|
61
|
-
remote: number;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
57
|
type Arch = {
|
|
65
58
|
platform: string;
|
|
66
59
|
arch: string;
|
|
@@ -68,12 +61,8 @@ type Arch = {
|
|
|
68
61
|
export type SshPlConfig = {
|
|
69
62
|
localWorkdir: string;
|
|
70
63
|
license: PlLicenseMode;
|
|
64
|
+
useGlobalAccess?: boolean;
|
|
71
65
|
};
|
|
72
|
-
export type SshInitReturnTypes = {
|
|
73
|
-
plUser: string;
|
|
74
|
-
plPassword: string;
|
|
75
|
-
ports: SshPlatformaPorts;
|
|
76
|
-
} | null;
|
|
77
66
|
type BinPaths = {
|
|
78
67
|
history?: DownloadAndUntarState[];
|
|
79
68
|
minioRelPath: string;
|
|
@@ -94,13 +83,13 @@ type PlatformaInitState = {
|
|
|
94
83
|
localWorkdir?: string;
|
|
95
84
|
arch?: Arch;
|
|
96
85
|
remoteHome?: string;
|
|
97
|
-
|
|
98
|
-
userCredentials?:
|
|
86
|
+
alive?: SupervisorStatus;
|
|
87
|
+
userCredentials?: ConnectionInfo;
|
|
99
88
|
downloadedBinaries?: DownloadAndUntarState[];
|
|
100
89
|
binPaths?: BinPaths;
|
|
101
|
-
ports?:
|
|
90
|
+
ports?: SshPlPorts;
|
|
102
91
|
generatedConfig?: SshPlConfigGenerationResult;
|
|
103
|
-
connectionInfo?:
|
|
92
|
+
connectionInfo?: ConnectionInfo;
|
|
104
93
|
started?: boolean;
|
|
105
94
|
};
|
|
106
95
|
export {};
|
package/dist/ssh/pl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pl.d.ts","sourceRoot":"","sources":["../../src/ssh/pl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAOzE,OAAO,KAAK,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"pl.d.ts","sourceRoot":"","sources":["../../src/ssh/pl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAOzE,OAAO,KAAK,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAE5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpE,qBAAa,KAAK;aAGE,MAAM,EAAE,QAAQ;aAChB,SAAS,EAAE,SAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJ3B,OAAO,CAAC,SAAS,CAA0B;gBAEzB,MAAM,EAAE,QAAQ,EAChB,SAAS,EAAE,SAAS,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ChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC"}
|
package/dist/ssh/pl_paths.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare function binariesDir(remoteHome: string): string;
|
|
|
7
7
|
export declare function platformaBaseDir(remoteHome: string, arch: string): string;
|
|
8
8
|
export declare function platformaDir(remoteHome: string, arch: string): string;
|
|
9
9
|
export declare function platformaBin(remoteHome: string, arch: string): string;
|
|
10
|
+
export declare function platformaConf(remoteHome: string): string;
|
|
10
11
|
export declare function platformaFreePortBin(remoteHome: string, arch: string): string;
|
|
11
12
|
export declare function minioDir(remoteHome: string, arch: string): string;
|
|
12
13
|
export declare function minioBin(remoteHome: string, arch: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pl_paths.d.ts","sourceRoot":"","sources":["../../src/ssh/pl_paths.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAMnE,eAAO,MAAM,YAAY,+BAA+B,CAAC;AACzD,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AACtD,eAAO,MAAM,qBAAqB,mCAAmC,CAAC;AAEtE,wBAAgB,OAAO,CAAC,UAAU,EAAE,MAAM,UAEzC;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,UAE7C;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAEhE;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAE5D;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAE5D;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAExD;AAED,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EA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CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,UAEhD;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,UAEhD"}
|
package/dist/ssh/ssh.d.ts
CHANGED
|
@@ -83,7 +83,6 @@ export declare class SshClient {
|
|
|
83
83
|
* @returns A promise resolving with `true` if the file was successfully uploaded.
|
|
84
84
|
*/
|
|
85
85
|
uploadFile(localPath: string, remotePath: string): Promise<boolean>;
|
|
86
|
-
delay(delay: number): Promise<void>;
|
|
87
86
|
withSftp<R>(callback: (sftp: SFTPWrapper) => Promise<R>): Promise<R>;
|
|
88
87
|
writeFileOnTheServer(remotePath: string, data: string | Buffer, mode?: number): Promise<boolean>;
|
|
89
88
|
getForderStructure(sftp: SFTPWrapper, remotePath: string, data?: SshDirContent): Promise<SshDirContent>;
|
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":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAiB,WAAW,EAAE,MAAM,MAAM,CAAC;AACtE,OAAO,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,GAAG,MAAM,KAAK,CAAC;AAKtB,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,CAAC;AAEF,qBAAa,SAAS;IAMlB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,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M,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC;YAoBhG,SAAS;IAWhB,2BAA2B,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE,MAAc;YAgBnG,iBAAiB;IA8B/B;;;;;OAKG;IACU,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,MAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAatG;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IA8B/B;;;;;OAKG;IACI,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE,MAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BrF;;;;;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"}
|
|
@@ -2,7 +2,16 @@ import { MiLogger } from '@milaboratories/ts-helpers';
|
|
|
2
2
|
import { SshClient, SshExecResult } from './ssh';
|
|
3
3
|
export declare function supervisorCtlStart(sshClient: SshClient, remoteHome: string, arch: string): Promise<void>;
|
|
4
4
|
export declare function supervisorStop(sshClient: SshClient, remoteHome: string, arch: string): Promise<void>;
|
|
5
|
-
|
|
5
|
+
/** Provides a simple true/false response got from supervisord status
|
|
6
|
+
* along with a debug info that could be showed in error logs (raw response from the command, parsed response etc). */
|
|
7
|
+
export type SupervisorStatus = {
|
|
8
|
+
platforma?: boolean;
|
|
9
|
+
minio?: boolean;
|
|
10
|
+
allAlive: boolean;
|
|
11
|
+
rawResult?: SshExecResult;
|
|
12
|
+
execError?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function supervisorStatus(logger: MiLogger, sshClient: SshClient, remoteHome: string, arch: string): Promise<SupervisorStatus>;
|
|
6
15
|
export declare function generateSupervisordConfig(minioStorageDir: string, minioEnvs: Record<string, string>, supervisorRemotePort: number, remoteWorkDir: string, platformaConfigPath: string, minioPath: string, plPath: string): string;
|
|
7
|
-
export declare function supervisorExec(sshClient: SshClient, remoteHome: string, arch: string, command: string): Promise<
|
|
16
|
+
export declare function supervisorExec(sshClient: SshClient, remoteHome: string, arch: string, command: string): Promise<SshExecResult>;
|
|
8
17
|
//# sourceMappingURL=supervisord.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisord.d.ts","sourceRoot":"","sources":["../../src/ssh/supervisord.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"supervisord.d.ts","sourceRoot":"","sources":["../../src/ssh/supervisord.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtD,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAOjC;AAED,wBAAsB,cAAc,CAClC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAOjC;AAED;sHACsH;AACtH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,QAAQ,EAChB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAC/B,OAAO,CAAC,gBAAgB,CAAC,CAoC3B;AAED,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,oBAAoB,EAAE,MAAM,EAC5B,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,MAAM,EAE3B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,UAoCf;AAED,wBAAsB,cAAc,CAClC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAChC,OAAO,EAAE,MAAM,0BAOhB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-deployments",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.12",
|
|
4
4
|
"pl-version": "1.18.3",
|
|
5
5
|
"description": "MiLaboratories Platforma Backend code service run wrapper",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"undici": "^7.2.3",
|
|
51
51
|
"yaml": "^2.6.1",
|
|
52
52
|
"zod": "~3.23.8",
|
|
53
|
-
"@milaboratories/pl-config": "^1.4.
|
|
53
|
+
"@milaboratories/pl-config": "^1.4.2",
|
|
54
54
|
"@milaboratories/ts-helpers": "^1.1.4"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
package/src/common/pl_binary.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { downloadBinary } from './pl_binary_download';
|
|
|
4
4
|
import { getDefaultPlVersion } from './pl_version';
|
|
5
5
|
import os from 'os';
|
|
6
6
|
import upath from 'upath';
|
|
7
|
-
import {
|
|
7
|
+
import type { OSType } from './os_and_arch';
|
|
8
|
+
import { newOs } from './os_and_arch';
|
|
8
9
|
|
|
9
10
|
/** Shows how the binary should be got. */
|
|
10
11
|
export type PlBinarySource = PlBinarySourceDownload | PlBinarySourceLocal;
|
package/src/index.ts
CHANGED
|
@@ -60,18 +60,20 @@ export function initPrivateKey(): string {
|
|
|
60
60
|
export async function initContainer(name: string): Promise<StartedTestContainer> {
|
|
61
61
|
await createTestDirForRecursiveUpload();
|
|
62
62
|
|
|
63
|
-
const
|
|
63
|
+
const image = `pl-ssh-test-container-${name}:1.0.0`;
|
|
64
|
+
|
|
65
|
+
const fromCacheContainer = await new GenericContainer(image)
|
|
64
66
|
.withExposedPorts(...SSH_PORT)
|
|
65
67
|
.withReuse()
|
|
66
68
|
.withName(`pl-ssh-test-${name}`)
|
|
67
69
|
.start()
|
|
68
|
-
.catch((
|
|
70
|
+
.catch(() => console.log('No worries, creating a new container'));
|
|
69
71
|
|
|
70
72
|
if (!fromCacheContainer) {
|
|
71
73
|
generateKeys();
|
|
72
74
|
const container1 = await GenericContainer.fromDockerfile(path.resolve(__dirname, '..', '..', '..'))
|
|
73
75
|
.withCache(true)
|
|
74
|
-
.build(
|
|
76
|
+
.build(image, { deleteOnExit: false });
|
|
75
77
|
|
|
76
78
|
return container1.withExposedPorts(...SSH_PORT).withReuse().start();
|
|
77
79
|
}
|
|
@@ -39,28 +39,29 @@ describe('SshPl', async () => {
|
|
|
39
39
|
expect(platformInfo).toHaveProperty('platform');
|
|
40
40
|
expect(platformInfo).toHaveProperty('arch');
|
|
41
41
|
|
|
42
|
-
expect(['x86_64', 'aarch64']).toContain(platformInfo.arch)
|
|
42
|
+
expect(['x86_64', 'aarch64']).toContain(platformInfo.arch);
|
|
43
43
|
expect(platformInfo?.platform).toBe('Linux');
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
it('Check start/stop cmd', async () => {
|
|
46
|
+
it('Check start/stop cmd, and stopAndClean', async () => {
|
|
47
47
|
await sshPl.platformaInit({
|
|
48
48
|
localWorkdir: downloadDestination,
|
|
49
|
-
license: {type: 'env'},
|
|
49
|
+
license: { type: 'env' },
|
|
50
50
|
});
|
|
51
|
-
expect(await sshPl.isAlive()).toBe(true);
|
|
51
|
+
expect((await sshPl.isAlive()).allAlive).toBe(true);
|
|
52
52
|
|
|
53
53
|
await sshPl.stop();
|
|
54
|
-
expect(await sshPl.isAlive()).toBe(false);
|
|
54
|
+
expect((await sshPl.isAlive()).allAlive).toBe(false);
|
|
55
55
|
|
|
56
|
-
// FIXME: it
|
|
56
|
+
// FIXME: it's not working in CI
|
|
57
57
|
// await sshPl.start();
|
|
58
|
-
// expect(await sshPl.isAlive()).toBe(true);
|
|
58
|
+
// expect((await sshPl.isAlive()).allAlive).toBe(true);
|
|
59
|
+
|
|
60
|
+
await sshPl.stopAndClean();
|
|
61
|
+
expect((await sshPl.isAlive()).allAlive).toBe(false);
|
|
59
62
|
});
|
|
60
63
|
|
|
61
64
|
it('downloadBinariesAndUploadToServer', async () => {
|
|
62
|
-
await sshPl.stop();
|
|
63
|
-
|
|
64
65
|
const arch = await sshPl.getArch();
|
|
65
66
|
const remoteHome = await sshPl.getUserHomeDirectory();
|
|
66
67
|
await sshPl.stop(); // ensure stopped
|
|
@@ -81,10 +82,11 @@ describe('SshPl', async () => {
|
|
|
81
82
|
|
|
82
83
|
const remoteHome = await sshPl.getUserHomeDirectory();
|
|
83
84
|
|
|
84
|
-
expect(await sshPl?.sshClient.checkFileExists(
|
|
85
|
+
expect(await sshPl?.sshClient.checkFileExists(plpath.platformaConf(remoteHome))).toBe(true);
|
|
85
86
|
expect(typeof result?.ports).toBe('object');
|
|
86
87
|
expect(result?.plPassword).toBeTruthy();
|
|
87
88
|
expect(result?.plUser).toBeTruthy();
|
|
89
|
+
expect(result?.useGlobalAccess).toBeFalsy();
|
|
88
90
|
});
|
|
89
91
|
|
|
90
92
|
it('Transfer Platforma to server', async () => {
|
|
@@ -113,9 +115,9 @@ describe('SshPl', async () => {
|
|
|
113
115
|
await sshPl.platformaInit({
|
|
114
116
|
localWorkdir: downloadDestination,
|
|
115
117
|
license: { type: 'env' },
|
|
116
|
-
})
|
|
118
|
+
});
|
|
117
119
|
const isAlive = await sshPl?.isAlive();
|
|
118
|
-
expect(isAlive).toBe(true);
|
|
120
|
+
expect(isAlive.allAlive).toBe(true);
|
|
119
121
|
|
|
120
122
|
const arch = await sshPl.getArch();
|
|
121
123
|
const remoteHome = await sshPl.getUserHomeDirectory();
|
|
@@ -157,9 +159,26 @@ describe('SshPl', async () => {
|
|
|
157
159
|
remote: expect.anything(),
|
|
158
160
|
});
|
|
159
161
|
});
|
|
160
|
-
});
|
|
161
162
|
|
|
162
|
-
|
|
163
|
+
it('Start ssh without global access, restart it with global access', async () => {
|
|
164
|
+
const remoteHome = await sshPl.getUserHomeDirectory();
|
|
165
|
+
|
|
166
|
+
await sshPl.platformaInit({ localWorkdir: downloadDestination, license: { type: 'env' } });
|
|
167
|
+
let isAlive = await sshPl?.isAlive();
|
|
168
|
+
expect(isAlive.allAlive).toBe(true);
|
|
169
|
+
|
|
170
|
+
await sshPl.platformaInit({
|
|
171
|
+
localWorkdir: downloadDestination,
|
|
172
|
+
license: { type: 'env' },
|
|
173
|
+
useGlobalAccess: true,
|
|
174
|
+
});
|
|
175
|
+
isAlive = await sshPl?.isAlive();
|
|
176
|
+
expect(isAlive.allAlive).toBe(true);
|
|
177
|
+
|
|
178
|
+
const config = await sshPl.sshClient.readFile(plpath.platformaConf(remoteHome));
|
|
179
|
+
expect(config).contain('bin-ga');
|
|
180
|
+
});
|
|
181
|
+
|
|
163
182
|
it('Download pl. We have archive and extracted data', async () => {
|
|
164
183
|
const arch = await sshPl.getArch();
|
|
165
184
|
|
|
@@ -117,7 +117,7 @@ describe('SSH Tests', () => {
|
|
|
117
117
|
it('Simple server should forward remote SSH port to a local port', async () => {
|
|
118
118
|
const localPort = 3001;
|
|
119
119
|
|
|
120
|
-
const resFailed = await fetch(`http://127.0.0.1:${localPort}`).catch((err) => console.log(
|
|
120
|
+
const resFailed = await fetch(`http://127.0.0.1:${localPort}`).catch((err) => console.log(`Must fail: ${err}`));
|
|
121
121
|
expect(resFailed).toBe(undefined);
|
|
122
122
|
|
|
123
123
|
const { server } = await client.forwardPort({
|