@squiz/job-runner-lib 2.5.1 → 2.6.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/CHANGELOG.md +6 -0
- package/lib/domains/job/constants/RetryConfig.constants.d.ts +4 -0
- package/lib/domains/job/constants/RuntimeImage.constants.d.ts +11 -0
- package/lib/domains/job/index.d.ts +1 -0
- package/lib/domains/job/manifest/JobManifestTypes.d.ts +12 -0
- package/lib/domains/manifest/index.d.ts +1 -0
- package/lib/domains/manifest/services/ManifestServiceForDev.d.ts +2 -2
- package/lib/domains/manifest/utils/validateRuntimeImage.d.ts +5 -0
- package/lib/domains/manifest/utils/validateRuntimeImage.spec.d.ts +5 -0
- package/lib/index.js +9 -9
- package/lib/index.js.map +4 -4
- package/package.json +2 -2
- package/src/domains/job/constants/RetryConfig.constants.ts +5 -0
- package/src/domains/job/constants/RuntimeImage.constants.ts +22 -0
- package/src/domains/job/index.ts +1 -0
- package/src/domains/job/manifest/JobManifestTypes.ts +14 -0
- package/src/domains/job/manifest/mocks/JobManifest.mock.ts +2 -0
- package/src/domains/job/manifest/mocks/JobManifestDto.mock.ts +4 -0
- package/src/domains/job/manifest/mocks/JobManifestRecord.mock.ts +2 -0
- package/src/domains/job/manifest/mocks/JobManifestRequest.mock.ts +2 -0
- package/src/domains/job/repository/JobManifestRepository/JobManifestRepository.spec.ts +33 -1
- package/src/domains/job/repository/JobManifestRepository/JobManifestRepository.ts +9 -0
- package/src/domains/job/services/JobManifestService/JobManifestService.spec.ts +1 -0
- package/src/domains/manifest/index.ts +1 -0
- package/src/domains/manifest/services/ManifestServiceForDev.spec.ts +1 -1
- package/src/domains/manifest/services/ManifestServiceForDev.ts +3 -3
- package/src/domains/manifest/utils/validateRuntimeImage.spec.ts +40 -0
- package/src/domains/manifest/utils/validateRuntimeImage.ts +33 -0
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,10 @@ export declare const RETRY_DELAYS_SECONDS: ReadonlyArray<number>;
|
|
|
13
13
|
* Maximum number of retry attempts for container start failures.
|
|
14
14
|
*/
|
|
15
15
|
export declare const MAX_RETRY_ATTEMPTS: number;
|
|
16
|
+
/**
|
|
17
|
+
* After a job has attempted to be started this number of times alerts will start to be sent.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ALERT_AFTER_ATTEMPTS = 2;
|
|
16
20
|
/**
|
|
17
21
|
* Get the delay in seconds for a given retry attempt.
|
|
18
22
|
* @param retryAttempt - The current retry attempt (0-indexed)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Squiz Australia Pty Ltd. All Rights Reserved.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SUPPORTED_RUNTIME_IMAGES: readonly ["node:20", "node:24"];
|
|
6
|
+
export declare const LEGACY_RUNTIME_IMAGE = "node:20";
|
|
7
|
+
export declare const RECOMMENDED_RUNTIME_IMAGE = "node:24";
|
|
8
|
+
export declare const DEPRECATED_RUNTIME_IMAGES: readonly string[];
|
|
9
|
+
export declare const getRuntimeImageOrDefault: (image: string | null | undefined) => string;
|
|
10
|
+
export declare const isSupportedRuntimeImage: (image: string) => boolean;
|
|
11
|
+
export declare const isDeprecatedRuntimeImage: (image: string) => boolean;
|
|
@@ -4,6 +4,7 @@ export * from './constants/InjectTokens';
|
|
|
4
4
|
export * from './constants/JobExecutionStatus.constants';
|
|
5
5
|
export * from './constants/Repository.constants';
|
|
6
6
|
export * from './constants/RetryConfig.constants';
|
|
7
|
+
export * from './constants/RuntimeImage.constants';
|
|
7
8
|
export * from './services';
|
|
8
9
|
export * from './utils';
|
|
9
10
|
export * from './model/Base';
|
|
@@ -49,6 +49,12 @@ export interface JobManifest {
|
|
|
49
49
|
* @memberof JobManifest
|
|
50
50
|
*/
|
|
51
51
|
concurrency: number;
|
|
52
|
+
/**
|
|
53
|
+
* The runtime image the job should execute against (e.g. `node:20`, `node:24`).
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof JobManifest
|
|
56
|
+
*/
|
|
57
|
+
image: string;
|
|
52
58
|
/**
|
|
53
59
|
* The DynamoDB record type ('job').
|
|
54
60
|
* @type {EntityType}
|
|
@@ -112,6 +118,12 @@ export interface JobManifestRecord {
|
|
|
112
118
|
* @memberof JobManifestRecord
|
|
113
119
|
*/
|
|
114
120
|
concurrency: number;
|
|
121
|
+
/**
|
|
122
|
+
* The runtime image the job should execute against (e.g. `node:20`, `node:24`).
|
|
123
|
+
* @type {string}
|
|
124
|
+
* @memberof JobManifestRecord
|
|
125
|
+
*/
|
|
126
|
+
image: string;
|
|
115
127
|
}
|
|
116
128
|
export type JobManifestDto = Record<keyof JobManifestRecord, AttributeValue>;
|
|
117
129
|
/**
|
|
@@ -2,6 +2,7 @@ export * from './services/ManifestServiceForDev';
|
|
|
2
2
|
export * from './services/JobFunctionService';
|
|
3
3
|
export * from './utils/getAndAssertJobManifestVersion';
|
|
4
4
|
export * from './utils/isValidManifestVersion';
|
|
5
|
+
export * from './utils/validateRuntimeImage';
|
|
5
6
|
export * from './ManifestModel';
|
|
6
7
|
export * from '../job/manifest/JobManifestV1';
|
|
7
8
|
export * from './errors/ManifestValidationError';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JobManifestModel } from '../ManifestModel';
|
|
2
|
-
import { JobManifestV1 } from '../../job/manifest/JobManifestV1';
|
|
3
1
|
import { JsonValidationService } from '@squiz/dx-json-schema-lib';
|
|
2
|
+
import { JobManifestV1 } from '../../job/manifest/JobManifestV1';
|
|
3
|
+
import { JobManifestModel } from '../ManifestModel';
|
|
4
4
|
export declare class ManifestServiceForDev {
|
|
5
5
|
protected jobValidationService: JsonValidationService;
|
|
6
6
|
protected getJobManifest(manifestModel: JobManifestModel, manifestPath: string): JobManifestV1;
|