@firestartr/cli 2.2.2-snapshot-0 → 2.3.0-snapshot
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/build/index.js +1036 -481
- package/build/packages/catalog_common/src/types/envvars.d.ts +1 -0
- package/build/packages/cdk8s_renderer/imports/firestartr.dev.d.ts +33 -0
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/index.d.ts +36 -0
- package/build/packages/cdk8s_renderer/src/claims/github/component.labels.schema.d.ts +32 -0
- package/build/packages/cdk8s_renderer/src/claims/github/component.schema.d.ts +6 -0
- package/build/packages/cdk8s_renderer/src/claims/github/index.d.ts +36 -0
- package/build/packages/cdk8s_renderer/src/claims/github/repository.d.ts +6 -0
- package/build/packages/cdk8s_renderer/src/initializers/component_labels.d.ts +11 -0
- package/build/packages/gh_provisioner/src/entities/ghrepo/helpers/index.d.ts +1 -0
- package/build/packages/gh_provisioner/src/entities/ghrepo/helpers/labels.d.ts +1 -0
- package/build/packages/github/index.d.ts +2 -0
- package/build/packages/github/src/repository.d.ts +8 -0
- package/build/packages/operator/src/definitions.d.ts +59 -0
- package/build/packages/operator/src/informer.d.ts +4 -55
- package/build/packages/operator/src/metrics/processItem.global.metrics.d.ts +12 -0
- package/build/packages/operator/src/metrics/processItem.slot.metrics.d.ts +15 -0
- package/build/packages/operator/src/metricsServer.d.ts +1 -0
- package/build/packages/operator/src/processItem.slot.d.ts +45 -0
- package/build/packages/operator/src/signals.d.ts +1 -17
- package/build/packages/terraform_provisioner/src/process_handler.d.ts +1 -0
- package/build/packages/terraform_provisioner/src/project_tf.d.ts +0 -1
- package/build/packages/terraform_provisioner/src/utils.d.ts +2 -2
- package/package.json +1 -1
|
@@ -41,6 +41,7 @@ export declare enum envVars {
|
|
|
41
41
|
operatorDummyExec = "OPERATOR_DUMMY_EXEC",
|
|
42
42
|
operatorIgnoreLease = "OPERATOR_IGNORE_LEASE",
|
|
43
43
|
operatorDeploymentName = "OPERATOR_DEPLOYMENT_NAME",
|
|
44
|
+
operatorNumberOfMaxSlots = "OPERATOR_NUMBER_OF_MAX_SLOTS",
|
|
44
45
|
kubernetesServiceHost = "KUBERNETES_SERVICE_HOST",
|
|
45
46
|
kubernetesServicePort = "KUBERNETES_SERVICE_PORT"
|
|
46
47
|
}
|
|
@@ -1018,6 +1018,12 @@ export interface FirestartrGithubRepositorySpecRepo {
|
|
|
1018
1018
|
* @schema FirestartrGithubRepositorySpecRepo#topics
|
|
1019
1019
|
*/
|
|
1020
1020
|
readonly topics?: string[];
|
|
1021
|
+
/**
|
|
1022
|
+
* Array of labels to create in GitHub
|
|
1023
|
+
*
|
|
1024
|
+
* @schema FirestartrGithubRepositorySpecRepo#labels
|
|
1025
|
+
*/
|
|
1026
|
+
readonly labels?: FirestartrGithubRepositorySpecRepoLabels[];
|
|
1021
1027
|
/**
|
|
1022
1028
|
* @schema FirestartrGithubRepositorySpecRepo#visibility
|
|
1023
1029
|
*/
|
|
@@ -1204,6 +1210,33 @@ export interface FirestartrGithubRepositorySpecFirestartrTechnology {
|
|
|
1204
1210
|
* Converts an object of type 'FirestartrGithubRepositorySpecFirestartrTechnology' to JSON representation.
|
|
1205
1211
|
*/
|
|
1206
1212
|
export declare function toJson_FirestartrGithubRepositorySpecFirestartrTechnology(obj: FirestartrGithubRepositorySpecFirestartrTechnology | undefined): Record<string, any> | undefined;
|
|
1213
|
+
/**
|
|
1214
|
+
* @schema FirestartrGithubRepositorySpecRepoLabels
|
|
1215
|
+
*/
|
|
1216
|
+
export interface FirestartrGithubRepositorySpecRepoLabels {
|
|
1217
|
+
/**
|
|
1218
|
+
* Label name (1-50 characters, not only whitespace)
|
|
1219
|
+
*
|
|
1220
|
+
* @schema FirestartrGithubRepositorySpecRepoLabels#name
|
|
1221
|
+
*/
|
|
1222
|
+
readonly name: string;
|
|
1223
|
+
/**
|
|
1224
|
+
* Hexadecimal color without # (6 characters)
|
|
1225
|
+
*
|
|
1226
|
+
* @schema FirestartrGithubRepositorySpecRepoLabels#color
|
|
1227
|
+
*/
|
|
1228
|
+
readonly color: string;
|
|
1229
|
+
/**
|
|
1230
|
+
* Optional label description (max 100 characters)
|
|
1231
|
+
*
|
|
1232
|
+
* @schema FirestartrGithubRepositorySpecRepoLabels#description
|
|
1233
|
+
*/
|
|
1234
|
+
readonly description?: string;
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Converts an object of type 'FirestartrGithubRepositorySpecRepoLabels' to JSON representation.
|
|
1238
|
+
*/
|
|
1239
|
+
export declare function toJson_FirestartrGithubRepositorySpecRepoLabels(obj: FirestartrGithubRepositorySpecRepoLabels | undefined): Record<string, any> | undefined;
|
|
1207
1240
|
/**
|
|
1208
1241
|
* @schema FirestartrGithubRepositorySpecRepoVisibility
|
|
1209
1242
|
*/
|
|
@@ -784,6 +784,12 @@ declare const schemas: {
|
|
|
784
784
|
pattern: string;
|
|
785
785
|
};
|
|
786
786
|
};
|
|
787
|
+
labels: {
|
|
788
|
+
type: string;
|
|
789
|
+
items: {
|
|
790
|
+
$ref: string;
|
|
791
|
+
};
|
|
792
|
+
};
|
|
787
793
|
overrides: {
|
|
788
794
|
type: string;
|
|
789
795
|
properties: {};
|
|
@@ -941,6 +947,36 @@ declare const schemas: {
|
|
|
941
947
|
additionalProperties: boolean;
|
|
942
948
|
};
|
|
943
949
|
};
|
|
950
|
+
} | {
|
|
951
|
+
$schema: string;
|
|
952
|
+
$id: string;
|
|
953
|
+
definitions: {
|
|
954
|
+
GithubComponentClaimLabel: {
|
|
955
|
+
$id: string;
|
|
956
|
+
type: string;
|
|
957
|
+
required: string[];
|
|
958
|
+
properties: {
|
|
959
|
+
name: {
|
|
960
|
+
type: string;
|
|
961
|
+
minLength: number;
|
|
962
|
+
maxLength: number;
|
|
963
|
+
pattern: string;
|
|
964
|
+
description: string;
|
|
965
|
+
};
|
|
966
|
+
color: {
|
|
967
|
+
type: string;
|
|
968
|
+
pattern: string;
|
|
969
|
+
description: string;
|
|
970
|
+
};
|
|
971
|
+
description: {
|
|
972
|
+
type: string;
|
|
973
|
+
maxLength: number;
|
|
974
|
+
description: string;
|
|
975
|
+
};
|
|
976
|
+
};
|
|
977
|
+
additionalProperties: boolean;
|
|
978
|
+
};
|
|
979
|
+
};
|
|
944
980
|
})[] | {
|
|
945
981
|
$id: string;
|
|
946
982
|
definitions: {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
$schema: string;
|
|
3
|
+
$id: string;
|
|
4
|
+
definitions: {
|
|
5
|
+
GithubComponentClaimLabel: {
|
|
6
|
+
$id: string;
|
|
7
|
+
type: string;
|
|
8
|
+
required: string[];
|
|
9
|
+
properties: {
|
|
10
|
+
name: {
|
|
11
|
+
type: string;
|
|
12
|
+
minLength: number;
|
|
13
|
+
maxLength: number;
|
|
14
|
+
pattern: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
color: {
|
|
18
|
+
type: string;
|
|
19
|
+
pattern: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
description: {
|
|
23
|
+
type: string;
|
|
24
|
+
maxLength: number;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
additionalProperties: boolean;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export default _default;
|
|
@@ -315,6 +315,12 @@ export declare const GithubSchemas: ({
|
|
|
315
315
|
pattern: string;
|
|
316
316
|
};
|
|
317
317
|
};
|
|
318
|
+
labels: {
|
|
319
|
+
type: string;
|
|
320
|
+
items: {
|
|
321
|
+
$ref: string;
|
|
322
|
+
};
|
|
323
|
+
};
|
|
318
324
|
overrides: {
|
|
319
325
|
type: string;
|
|
320
326
|
properties: {};
|
|
@@ -472,4 +478,34 @@ export declare const GithubSchemas: ({
|
|
|
472
478
|
additionalProperties: boolean;
|
|
473
479
|
};
|
|
474
480
|
};
|
|
481
|
+
} | {
|
|
482
|
+
$schema: string;
|
|
483
|
+
$id: string;
|
|
484
|
+
definitions: {
|
|
485
|
+
GithubComponentClaimLabel: {
|
|
486
|
+
$id: string;
|
|
487
|
+
type: string;
|
|
488
|
+
required: string[];
|
|
489
|
+
properties: {
|
|
490
|
+
name: {
|
|
491
|
+
type: string;
|
|
492
|
+
minLength: number;
|
|
493
|
+
maxLength: number;
|
|
494
|
+
pattern: string;
|
|
495
|
+
description: string;
|
|
496
|
+
};
|
|
497
|
+
color: {
|
|
498
|
+
type: string;
|
|
499
|
+
pattern: string;
|
|
500
|
+
description: string;
|
|
501
|
+
};
|
|
502
|
+
description: {
|
|
503
|
+
type: string;
|
|
504
|
+
maxLength: number;
|
|
505
|
+
description: string;
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
additionalProperties: boolean;
|
|
509
|
+
};
|
|
510
|
+
};
|
|
475
511
|
})[];
|
|
@@ -29,6 +29,7 @@ export interface IGithubRepositoryClaim extends IComponentClaim {
|
|
|
29
29
|
orphan: boolean;
|
|
30
30
|
}[];
|
|
31
31
|
topics?: string[];
|
|
32
|
+
labels?: IComponentClaimLabel[];
|
|
32
33
|
};
|
|
33
34
|
};
|
|
34
35
|
}
|
|
@@ -53,5 +54,10 @@ interface IRepositoryPage {
|
|
|
53
54
|
path: string;
|
|
54
55
|
};
|
|
55
56
|
}
|
|
57
|
+
interface IComponentClaimLabel {
|
|
58
|
+
name: string;
|
|
59
|
+
color: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
}
|
|
56
62
|
export type IComponentClaimOwnerType = 'user' | 'group';
|
|
57
63
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InitializerPatches } from './base';
|
|
2
|
+
export declare class ComponentLabelsInitializer extends InitializerPatches {
|
|
3
|
+
applicableProviders: string[];
|
|
4
|
+
static applicableKinds: string[];
|
|
5
|
+
__validate(): Promise<boolean>;
|
|
6
|
+
__patches(claim: any, _previousCR: any): Promise<{
|
|
7
|
+
validate(cr: any): boolean;
|
|
8
|
+
apply(cr: any): any;
|
|
9
|
+
identify(): string;
|
|
10
|
+
}[]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function provisionLabels(fsGithubRepository: any, repoAlreadyExists: boolean): Promise<void>;
|
|
@@ -24,6 +24,7 @@ declare const _default: {
|
|
|
24
24
|
uploadFile: typeof import("./src/repository").uploadFile;
|
|
25
25
|
deleteFile: typeof import("./src/repository").deleteFile;
|
|
26
26
|
getRepoInfo: typeof import("./src/repository").getRepoInfo;
|
|
27
|
+
repoExists: typeof import("./src/repository").repoExists;
|
|
27
28
|
getPages: typeof import("./src/repository").getPages;
|
|
28
29
|
getBranchProtection: typeof import("./src/repository").getBranchProtection;
|
|
29
30
|
getTeams: typeof import("./src/repository").getTeams;
|
|
@@ -31,6 +32,7 @@ declare const _default: {
|
|
|
31
32
|
getOIDCRepo: typeof import("./src/repository").getOIDCRepo;
|
|
32
33
|
addStatusCheck: typeof import("./src/repository").addStatusCheck;
|
|
33
34
|
addCommitStatus: typeof import("./src/repository").addCommitStatus;
|
|
35
|
+
getRepoIssuesLabels: typeof import("./src/repository").getRepoIssuesLabels;
|
|
34
36
|
};
|
|
35
37
|
team: {
|
|
36
38
|
getTeamMembers: typeof import("./src/team").getTeamMembers;
|
|
@@ -800,6 +800,7 @@ export declare function getRepoInfo(owner: string, name: string): Promise<{
|
|
|
800
800
|
[key: string]: unknown;
|
|
801
801
|
};
|
|
802
802
|
}>;
|
|
803
|
+
export declare function repoExists(owner: string, name: string): Promise<boolean>;
|
|
803
804
|
export declare function getPages(owner: string, name: string): Promise<{
|
|
804
805
|
url: string;
|
|
805
806
|
status: "built" | "building" | "errored";
|
|
@@ -1321,6 +1322,11 @@ export declare function uploadFile(destinationPath: string, filePath: string, re
|
|
|
1321
1322
|
export declare function deleteFile(path: string, repo: string, owner?: string, branch?: string, message?: string): Promise<void>;
|
|
1322
1323
|
export declare function addStatusCheck(output: any, is_failure: boolean, head_sha: string, name: string, status: string, repo: string, owner?: string): Promise<void>;
|
|
1323
1324
|
export declare function addCommitStatus(state: commitStatusState, sha: string, repo: string, owner?: string, target_url?: string, description?: string, context?: string): Promise<void>;
|
|
1325
|
+
export declare function getRepoIssuesLabels(owner: string, repo: string): Promise<{
|
|
1326
|
+
name: string;
|
|
1327
|
+
description: string;
|
|
1328
|
+
color: string;
|
|
1329
|
+
}[]>;
|
|
1324
1330
|
declare const _default: {
|
|
1325
1331
|
listReleases: typeof listReleases;
|
|
1326
1332
|
getReleaseByTag: typeof getReleaseByTag;
|
|
@@ -1329,6 +1335,7 @@ declare const _default: {
|
|
|
1329
1335
|
uploadFile: typeof uploadFile;
|
|
1330
1336
|
deleteFile: typeof deleteFile;
|
|
1331
1337
|
getRepoInfo: typeof getRepoInfo;
|
|
1338
|
+
repoExists: typeof repoExists;
|
|
1332
1339
|
getPages: typeof getPages;
|
|
1333
1340
|
getBranchProtection: typeof getBranchProtection;
|
|
1334
1341
|
getTeams: typeof getTeams;
|
|
@@ -1336,5 +1343,6 @@ declare const _default: {
|
|
|
1336
1343
|
getOIDCRepo: typeof getOIDCRepo;
|
|
1337
1344
|
addStatusCheck: typeof addStatusCheck;
|
|
1338
1345
|
addCommitStatus: typeof addCommitStatus;
|
|
1346
|
+
getRepoIssuesLabels: typeof getRepoIssuesLabels;
|
|
1339
1347
|
};
|
|
1340
1348
|
export default _default;
|
|
@@ -1,3 +1,62 @@
|
|
|
1
1
|
export declare function getKindFromPlural(plural: string): any;
|
|
2
2
|
export declare function getPluralFromKind(kind: string): string;
|
|
3
|
+
import type { Dependencies } from './resolver';
|
|
4
|
+
export declare enum OperationType {
|
|
5
|
+
RENAMED = "RENAMED",
|
|
6
|
+
UPDATED = "UPDATED",
|
|
7
|
+
CREATED = "CREATED",
|
|
8
|
+
SYNC = "SYNC",
|
|
9
|
+
MARKED_TO_DELETION = "MARKED_TO_DELETION",
|
|
10
|
+
NOTHING = "NOTHING",
|
|
11
|
+
RETRY = "RETRY"
|
|
12
|
+
}
|
|
13
|
+
export declare enum WorkStatus {
|
|
14
|
+
PENDING = "PENDING",
|
|
15
|
+
PROCESSING = "PROCESSING",
|
|
16
|
+
FINISHED = "FINISHED"
|
|
17
|
+
}
|
|
18
|
+
export type WorkItem = {
|
|
19
|
+
item: any;
|
|
20
|
+
getItem?: Function;
|
|
21
|
+
operation: OperationType;
|
|
22
|
+
handler?: WorkItemHandler;
|
|
23
|
+
workStatus: WorkStatus;
|
|
24
|
+
onDelete: Function;
|
|
25
|
+
process?: Function;
|
|
26
|
+
upsertTime?: number;
|
|
27
|
+
isDeadLetter?: boolean;
|
|
28
|
+
isBlocked?: boolean;
|
|
29
|
+
fUnblock?: Function;
|
|
30
|
+
slotId?: number;
|
|
31
|
+
isPicked?: boolean;
|
|
32
|
+
};
|
|
33
|
+
type HandlerFinalizerFn = (kind: string, namespace: string, item: any | string, finalizer: string) => Promise<any>;
|
|
34
|
+
type HandlerInformPlanFn = (prUrl: string, planText: string) => Promise<void>;
|
|
35
|
+
type WriteTerraformOutputInTfResultFn = (item: any, output: string) => Promise<any>;
|
|
36
|
+
type WriteConnectionSecretFn = (item: any, outputsConnection: any, finalize?: boolean) => Promise<void>;
|
|
37
|
+
type ResolveReferencesFn = () => Promise<Dependencies>;
|
|
38
|
+
type DeleteSecretFn = () => Promise<null | undefined>;
|
|
39
|
+
type ItemPathFn = () => string;
|
|
40
|
+
type ErrorFn = () => Promise<void>;
|
|
41
|
+
type SuccessFn = () => Promise<void>;
|
|
42
|
+
export type WorkItemHandler = {
|
|
43
|
+
finalize: HandlerFinalizerFn;
|
|
44
|
+
pluralKind: string;
|
|
45
|
+
informPlan: HandlerInformPlanFn;
|
|
46
|
+
writeTerraformOutputInTfResult: WriteTerraformOutputInTfResultFn;
|
|
47
|
+
writeConnectionSecret: WriteConnectionSecretFn;
|
|
48
|
+
resolveReferences: ResolveReferencesFn;
|
|
49
|
+
resolveOwnOutputs: () => Promise<any | undefined>;
|
|
50
|
+
deleteSecret: DeleteSecretFn;
|
|
51
|
+
itemPath: ItemPathFn;
|
|
52
|
+
error: ErrorFn;
|
|
53
|
+
success: SuccessFn;
|
|
54
|
+
isBlocked?: boolean;
|
|
55
|
+
isPicked?: boolean;
|
|
56
|
+
needsBlocking?: (item: any, operation: OperationType) => boolean;
|
|
57
|
+
fUnblock?: Function;
|
|
58
|
+
recommendedTimeout: () => number;
|
|
59
|
+
getSlotInfo?: () => any;
|
|
60
|
+
};
|
|
3
61
|
export declare function getTimeoutForOperation(operation: string): any;
|
|
62
|
+
export {};
|
|
@@ -1,57 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
SYNC = "SYNC",
|
|
6
|
-
MARKED_TO_DELETION = "MARKED_TO_DELETION",
|
|
7
|
-
NOTHING = "NOTHING",
|
|
8
|
-
RETRY = "RETRY"
|
|
9
|
-
}
|
|
10
|
-
export declare enum WorkStatus {
|
|
11
|
-
PENDING = "PENDING",
|
|
12
|
-
PROCESSING = "PROCESSING",
|
|
13
|
-
FINISHED = "FINISHED"
|
|
14
|
-
}
|
|
15
|
-
import { Dependencies } from './resolver';
|
|
16
|
-
export type WorkItem = {
|
|
17
|
-
item: any;
|
|
18
|
-
getItem?: Function;
|
|
19
|
-
operation: OperationType;
|
|
20
|
-
handler?: WorkItemHandler;
|
|
21
|
-
workStatus: WorkStatus;
|
|
22
|
-
onDelete: Function;
|
|
23
|
-
process?: Function;
|
|
24
|
-
upsertTime?: number;
|
|
25
|
-
isDeadLetter?: boolean;
|
|
26
|
-
isBlocked?: boolean;
|
|
27
|
-
fUnblock?: Function;
|
|
28
|
-
};
|
|
29
|
-
type HandlerFinalizerFn = (kind: string, namespace: string, item: any | string, finalizer: string) => Promise<any>;
|
|
30
|
-
type HandlerInformPlanFn = (prUrl: string, planText: string) => Promise<void>;
|
|
31
|
-
type WriteTerraformOutputInTfResultFn = (item: any, output: string) => Promise<any>;
|
|
32
|
-
type WriteConnectionSecretFn = (item: any, outputsConnection: any, finalize?: boolean) => Promise<void>;
|
|
33
|
-
type ResolveReferencesFn = () => Promise<Dependencies>;
|
|
34
|
-
type DeleteSecretFn = () => Promise<null | undefined>;
|
|
35
|
-
type ItemPathFn = () => string;
|
|
36
|
-
type ErrorFn = () => Promise<void>;
|
|
37
|
-
type SuccessFn = () => Promise<void>;
|
|
38
|
-
export type WorkItemHandler = {
|
|
39
|
-
finalize: HandlerFinalizerFn;
|
|
40
|
-
pluralKind: string;
|
|
41
|
-
informPlan: HandlerInformPlanFn;
|
|
42
|
-
writeTerraformOutputInTfResult: WriteTerraformOutputInTfResultFn;
|
|
43
|
-
writeConnectionSecret: WriteConnectionSecretFn;
|
|
44
|
-
resolveReferences: ResolveReferencesFn;
|
|
45
|
-
resolveOwnOutputs: () => Promise<any | undefined>;
|
|
46
|
-
deleteSecret: DeleteSecretFn;
|
|
47
|
-
itemPath: ItemPathFn;
|
|
48
|
-
error: ErrorFn;
|
|
49
|
-
success: SuccessFn;
|
|
50
|
-
isBlocked?: boolean;
|
|
51
|
-
needsBlocking?: (item: any, operation: OperationType) => boolean;
|
|
52
|
-
fUnblock?: Function;
|
|
53
|
-
recommendedTimeout: () => number;
|
|
54
|
-
};
|
|
1
|
+
import { OperationType, WorkStatus } from './definitions';
|
|
2
|
+
import type { WorkItem, WorkItemHandler } from './definitions';
|
|
3
|
+
export { OperationType, WorkStatus };
|
|
4
|
+
export type { WorkItem, WorkItemHandler };
|
|
55
5
|
/**
|
|
56
6
|
* Observe whenever a new item is added, modified or deleted in a given kind
|
|
57
7
|
* @param {string} pluralKind - Kind to observe
|
|
@@ -61,4 +11,3 @@ export type WorkItemHandler = {
|
|
|
61
11
|
* @returns {void}
|
|
62
12
|
*/
|
|
63
13
|
export declare function observeKind(pluralKind: string, namespace: string, queue: Function, compute: Function): Promise<void>;
|
|
64
|
-
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meter } from '@opentelemetry/api';
|
|
2
|
+
export declare class ProcessorGlobalMetrics {
|
|
3
|
+
private static _instance;
|
|
4
|
+
private _processedItems;
|
|
5
|
+
private _totalRunningSeconds;
|
|
6
|
+
private _minTime;
|
|
7
|
+
private _maxTime;
|
|
8
|
+
private constructor();
|
|
9
|
+
static init(meter: Meter): void;
|
|
10
|
+
static getInstance(): ProcessorGlobalMetrics;
|
|
11
|
+
recordProcessingDuration(durationSeconds: number): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Meter } from '@opentelemetry/api';
|
|
2
|
+
export declare class ProcessItemSlotMetrics {
|
|
3
|
+
private _workItemsTotal;
|
|
4
|
+
private _runningTimeSecondsTotal;
|
|
5
|
+
private _idleTimeSecondsTotal;
|
|
6
|
+
private _uptimeSeconds;
|
|
7
|
+
private _startTime;
|
|
8
|
+
private _lastStateChangeTime;
|
|
9
|
+
private _runningSeconds;
|
|
10
|
+
private _running;
|
|
11
|
+
private _id;
|
|
12
|
+
constructor(id: number, meter: Meter);
|
|
13
|
+
runItemStarted(): void;
|
|
14
|
+
runItemFinished(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { WorkItem } from './definitions';
|
|
2
|
+
import { ProcessItemSlotMetrics } from './metrics/processItem.slot.metrics';
|
|
3
|
+
export declare function initProcessItemsSlots(nSlots: number, initMetrics?: boolean): ProcessItemSlots;
|
|
4
|
+
export declare class ProcessItemSlots {
|
|
5
|
+
_slots: ProcessItemSlot[];
|
|
6
|
+
_nSlots: number;
|
|
7
|
+
_guardRails: GuardRails;
|
|
8
|
+
constructor(nSlots: number, initMetrics: boolean);
|
|
9
|
+
getIdleSlots(): Generator<ProcessItemSlot, void, unknown>;
|
|
10
|
+
allSlotsAreIdle(): boolean;
|
|
11
|
+
isWorkItemBlocked(workItem: WorkItem): boolean;
|
|
12
|
+
}
|
|
13
|
+
declare class GuardRails {
|
|
14
|
+
_processing: Map<string, boolean>;
|
|
15
|
+
constructor();
|
|
16
|
+
block(item: any): void;
|
|
17
|
+
unblock(item: any): void;
|
|
18
|
+
isBlocked(item: any): boolean;
|
|
19
|
+
itemToGuard(item: any): string;
|
|
20
|
+
}
|
|
21
|
+
export declare class ProcessItemSlot {
|
|
22
|
+
_idle: boolean;
|
|
23
|
+
_id: number;
|
|
24
|
+
_actions: {
|
|
25
|
+
blockItem: (item: any) => void;
|
|
26
|
+
unblockItem: (item: any) => void;
|
|
27
|
+
} | undefined;
|
|
28
|
+
_metrics: ProcessItemSlotMetrics;
|
|
29
|
+
constructor(id: number);
|
|
30
|
+
set actions(actions: {
|
|
31
|
+
blockItem: (item: any) => void;
|
|
32
|
+
unblockItem: (item: any) => void;
|
|
33
|
+
});
|
|
34
|
+
get actions(): {
|
|
35
|
+
blockItem: (item: any) => void;
|
|
36
|
+
unblockItem: (item: any) => void;
|
|
37
|
+
};
|
|
38
|
+
get idle(): boolean;
|
|
39
|
+
get id(): number;
|
|
40
|
+
set metrics(metrics: ProcessItemSlotMetrics);
|
|
41
|
+
get metrics(): ProcessItemSlotMetrics;
|
|
42
|
+
runWorkItem(workItem: WorkItem): Promise<void>;
|
|
43
|
+
__run(workItem: WorkItem): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
/**
|
|
3
|
-
* Initializes process signal handlers used by the operator.
|
|
4
|
-
*
|
|
5
|
-
* Currently this sets up handling for `SIGTERM`, using the callback
|
|
6
|
-
* associated with the `"SIGTERM"` key from the provided {@link CallbacksMap}
|
|
7
|
-
* to start the shutdown sequence. The returned {@link CallbacksMap} contains
|
|
8
|
-
* handler-specific callbacks (such as `"FINISH_OK"`) that callers can invoke
|
|
9
|
-
* to indicate that it is safe for the process to exit.
|
|
10
|
-
*
|
|
11
|
-
* @param callbacks A map of signal names to shutdown callbacks. The `"SIGTERM"`
|
|
12
|
-
* entry (if present) is invoked when a `SIGTERM` signal is received to
|
|
13
|
-
* perform any necessary cleanup before process termination.
|
|
14
|
-
* @returns A {@link CallbacksMap} with control callbacks that allow the caller
|
|
15
|
-
* to signal when shutdown has completed and the process may safely exit.
|
|
16
|
-
*/
|
|
17
|
-
export declare function initSignalsHandler(callbacks: CallbacksMap): CallbacksMap;
|
|
1
|
+
export declare function initSignalsHandler(Mapper: Map<string, () => void>): void;
|
|
@@ -3,5 +3,6 @@ import { ChildProcess } from 'child_process';
|
|
|
3
3
|
export type ProcessHandler = {
|
|
4
4
|
processKilled(killed: boolean): void;
|
|
5
5
|
hardTimeout: number;
|
|
6
|
+
tfCacheDir?: string;
|
|
6
7
|
};
|
|
7
8
|
export declare function processHandler(processToHandle: ChildProcess, ctl: ProcessHandler, onTimedOut: Function): void;
|
|
@@ -24,7 +24,6 @@ export declare class TFProjectManager {
|
|
|
24
24
|
setStreamCallbacks(fnData: Function, fnEnd: (...args: any[]) => void, reopen?: boolean): void;
|
|
25
25
|
build(): Promise<void>;
|
|
26
26
|
__init(): Promise<void>;
|
|
27
|
-
__initFromModule(): Promise<void>;
|
|
28
27
|
validate(): Promise<void>;
|
|
29
28
|
plan(format: 'human' | 'json'): Promise<void>;
|
|
30
29
|
planDestroy(format: 'human' | 'json'): Promise<void>;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { PassThrough } from 'stream';
|
|
3
3
|
import type { ProcessHandler } from './process_handler';
|
|
4
4
|
export declare function validate(path: string, secrets: any[]): Promise<unknown>;
|
|
5
|
-
export declare function init(path: string, secrets: any[], stream?: PassThrough): Promise<unknown>;
|
|
6
|
-
export declare function initFromModule(path: string, source: string, secrets: any[], stream?: PassThrough): Promise<unknown>;
|
|
5
|
+
export declare function init(path: string, secrets: any[], stream?: PassThrough, ctl?: ProcessHandler): Promise<unknown>;
|
|
6
|
+
export declare function initFromModule(path: string, source: string, secrets: any[], stream?: PassThrough, ctl?: ProcessHandler): Promise<unknown>;
|
|
7
7
|
export declare function plan(path: string, secrets: any[], format: 'human' | 'json', args?: string[], stream?: PassThrough, ctl?: ProcessHandler): Promise<any>;
|
|
8
8
|
export declare function apply(path: string, secrets: any[], stream?: PassThrough, ctl?: ProcessHandler): Promise<unknown>;
|
|
9
9
|
export declare function customCommand(path: string, secrets: any[], args: any[], stream?: PassThrough): Promise<unknown>;
|