@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/esm/index.js
CHANGED
|
@@ -40001,6 +40001,7 @@ const ensureJobLogGroup = async (logGroupName, awsSettings) => {
|
|
|
40001
40001
|
var AwsBatchService_1;
|
|
40002
40002
|
const jobDefinitionName = (jobUid) => `${awsBatchSettings.value.batchResourcesPrefix}-job-${jobUid}`;
|
|
40003
40003
|
const jobInstanceName = (jobUid, instanceId) => `${awsBatchSettings.value.batchResourcesPrefix}-job-${jobUid}-${instanceId}`;
|
|
40004
|
+
const defaultJobQueueName = () => `${awsBatchSettings.value.batchResourcesPrefix}-${awsBatchSettings.value.defaultQueueName}`;
|
|
40004
40005
|
let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
40005
40006
|
constructor() {
|
|
40006
40007
|
this.logger = Log.getLogger(AwsBatchService_1.name);
|
|
@@ -40024,7 +40025,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40024
40025
|
const jobName = jobInstanceName(input.jobUid, input.instanceId);
|
|
40025
40026
|
this.logger.info(`AWS JOB -> fetching job ${jobName}`);
|
|
40026
40027
|
const result = await this.client().send(new ListJobsCommand({
|
|
40027
|
-
jobQueue:
|
|
40028
|
+
jobQueue: defaultJobQueueName(),
|
|
40028
40029
|
maxResults: 1,
|
|
40029
40030
|
filters: [
|
|
40030
40031
|
{
|
|
@@ -40036,10 +40037,10 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40036
40037
|
return result.jobSummaryList?.[0];
|
|
40037
40038
|
}
|
|
40038
40039
|
async submitJob(input) {
|
|
40039
|
-
this.logger.info(`AWS JOB -> submitting job`, {
|
|
40040
|
+
this.logger.info(`AWS JOB -> submitting job triggered`, {
|
|
40040
40041
|
input,
|
|
40041
40042
|
});
|
|
40042
|
-
const queue = await this.ensureQueue(
|
|
40043
|
+
const queue = await this.ensureQueue(defaultJobQueueName());
|
|
40043
40044
|
const jobDefName = jobDefinitionName(input.jobUid);
|
|
40044
40045
|
const jobDefinition = await this.getLatestJobDefinition(jobDefName);
|
|
40045
40046
|
const jobName = jobInstanceName(input.jobUid, input.instanceId);
|
|
@@ -40056,7 +40057,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40056
40057
|
}
|
|
40057
40058
|
: {}),
|
|
40058
40059
|
};
|
|
40059
|
-
this.logger.info(`AWS JOB ->
|
|
40060
|
+
this.logger.info(`AWS JOB -> invoking job ${jobName} ${queue.jobQueueArn}`, {
|
|
40060
40061
|
request: submitJobRequest,
|
|
40061
40062
|
});
|
|
40062
40063
|
const result = await this.client().send(new SubmitJobCommand(submitJobRequest));
|
|
@@ -40144,7 +40145,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40144
40145
|
async ensureJobLogDriver(jobName, definition) {
|
|
40145
40146
|
const logGroup = definition.infrastructureParams.logGroupName
|
|
40146
40147
|
? {
|
|
40147
|
-
name: `/aws/batch
|
|
40148
|
+
name: `/aws/batch/${awsBatchSettings.value.batchResourcesPrefix}-job-${definition.infrastructureParams.logGroupName}`,
|
|
40148
40149
|
}
|
|
40149
40150
|
: undefined;
|
|
40150
40151
|
if (!logGroup) {
|
|
@@ -40241,12 +40242,13 @@ let AwsJobsProvider = class AwsJobsProvider {
|
|
|
40241
40242
|
}
|
|
40242
40243
|
async dispatch(input) {
|
|
40243
40244
|
const { definition, schedule, instanceId, payload, commandPlaceholders } = input;
|
|
40244
|
-
const awsInvocationParams = schedule?.invocationOverrides
|
|
40245
|
+
const awsInvocationParams = schedule?.invocationOverrides ??
|
|
40246
|
+
definition.invocationParams;
|
|
40245
40247
|
await this.awsBatchService.submitJob({
|
|
40246
40248
|
instanceId,
|
|
40247
40249
|
jobUid: definition.uid,
|
|
40248
40250
|
overrides: {
|
|
40249
|
-
command: awsInvocationParams
|
|
40251
|
+
command: awsInvocationParams.startCommand?.map((x) => replacePlaceholders(replacePayload(x, payload), commandPlaceholders)),
|
|
40250
40252
|
},
|
|
40251
40253
|
});
|
|
40252
40254
|
}
|