@punks/backend-entity-manager 0.0.312 → 0.0.314
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/cjs/index.js +9 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +9 -7
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -40016,6 +40016,7 @@ const ensureJobLogGroup = async (logGroupName, awsSettings) => {
|
|
|
40016
40016
|
var AwsBatchService_1;
|
|
40017
40017
|
const jobDefinitionName = (jobUid) => `${awsBatchSettings.value.batchResourcesPrefix}-job-${jobUid}`;
|
|
40018
40018
|
const jobInstanceName = (jobUid, instanceId) => `${awsBatchSettings.value.batchResourcesPrefix}-job-${jobUid}-${instanceId}`;
|
|
40019
|
+
const defaultJobQueueName = () => `${awsBatchSettings.value.batchResourcesPrefix}-${awsBatchSettings.value.defaultQueueName}`;
|
|
40019
40020
|
let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
40020
40021
|
constructor() {
|
|
40021
40022
|
this.logger = backendCore.Log.getLogger(AwsBatchService_1.name);
|
|
@@ -40039,7 +40040,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40039
40040
|
const jobName = jobInstanceName(input.jobUid, input.instanceId);
|
|
40040
40041
|
this.logger.info(`AWS JOB -> fetching job ${jobName}`);
|
|
40041
40042
|
const result = await this.client().send(new clientBatch.ListJobsCommand({
|
|
40042
|
-
jobQueue:
|
|
40043
|
+
jobQueue: defaultJobQueueName(),
|
|
40043
40044
|
maxResults: 1,
|
|
40044
40045
|
filters: [
|
|
40045
40046
|
{
|
|
@@ -40051,10 +40052,10 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40051
40052
|
return result.jobSummaryList?.[0];
|
|
40052
40053
|
}
|
|
40053
40054
|
async submitJob(input) {
|
|
40054
|
-
this.logger.info(`AWS JOB -> submitting job`, {
|
|
40055
|
+
this.logger.info(`AWS JOB -> submitting job triggered`, {
|
|
40055
40056
|
input,
|
|
40056
40057
|
});
|
|
40057
|
-
const queue = await this.ensureQueue(
|
|
40058
|
+
const queue = await this.ensureQueue(defaultJobQueueName());
|
|
40058
40059
|
const jobDefName = jobDefinitionName(input.jobUid);
|
|
40059
40060
|
const jobDefinition = await this.getLatestJobDefinition(jobDefName);
|
|
40060
40061
|
const jobName = jobInstanceName(input.jobUid, input.instanceId);
|
|
@@ -40071,7 +40072,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40071
40072
|
}
|
|
40072
40073
|
: {}),
|
|
40073
40074
|
};
|
|
40074
|
-
this.logger.info(`AWS JOB ->
|
|
40075
|
+
this.logger.info(`AWS JOB -> invoking job ${jobName} ${queue.jobQueueArn}`, {
|
|
40075
40076
|
request: submitJobRequest,
|
|
40076
40077
|
});
|
|
40077
40078
|
const result = await this.client().send(new clientBatch.SubmitJobCommand(submitJobRequest));
|
|
@@ -40159,7 +40160,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40159
40160
|
async ensureJobLogDriver(jobName, definition) {
|
|
40160
40161
|
const logGroup = definition.infrastructureParams.logGroupName
|
|
40161
40162
|
? {
|
|
40162
|
-
name: `/aws/batch
|
|
40163
|
+
name: `/aws/batch/${awsBatchSettings.value.batchResourcesPrefix}-job-${definition.infrastructureParams.logGroupName}`,
|
|
40163
40164
|
}
|
|
40164
40165
|
: undefined;
|
|
40165
40166
|
if (!logGroup) {
|
|
@@ -40256,12 +40257,13 @@ let AwsJobsProvider = class AwsJobsProvider {
|
|
|
40256
40257
|
}
|
|
40257
40258
|
async dispatch(input) {
|
|
40258
40259
|
const { definition, schedule, instanceId, payload, commandPlaceholders } = input;
|
|
40259
|
-
const awsInvocationParams = schedule?.invocationOverrides
|
|
40260
|
+
const awsInvocationParams = schedule?.invocationOverrides ??
|
|
40261
|
+
definition.invocationParams;
|
|
40260
40262
|
await this.awsBatchService.submitJob({
|
|
40261
40263
|
instanceId,
|
|
40262
40264
|
jobUid: definition.uid,
|
|
40263
40265
|
overrides: {
|
|
40264
|
-
command: awsInvocationParams
|
|
40266
|
+
command: awsInvocationParams.startCommand?.map((x) => replacePlaceholders(replacePayload(x, payload), commandPlaceholders)),
|
|
40265
40267
|
},
|
|
40266
40268
|
});
|
|
40267
40269
|
}
|