@reventlessdev/reventless-core 3.0.0-alpha.169 → 3.0.0-alpha.171
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 +16 -0
- package/package.json +16 -16
- package/src/admin/Platform_Admin.res +5 -2
- package/src/admin/Platform_Admin.res.mjs +4 -4
- package/src/components/Aggregate/Aggregate.res +5 -1
- package/src/components/Aggregate/Aggregate_Builder.res +21 -6
- package/src/components/Aggregate/Aggregate_Builder.res.mjs +10 -7
- package/src/components/AutomationSlice/AutomationSlice.res +1 -0
- package/src/components/AutomationSlice/AutomationSlice_Builder.res +13 -2
- package/src/components/AutomationSlice/AutomationSlice_Builder.res.mjs +5 -2
- package/src/components/Builder_Helpers.res +16 -2
- package/src/components/Builder_Helpers.res.mjs +6 -6
- package/src/components/Dcb/Dcb_Builder.res +46 -4
- package/src/components/Dcb/Dcb_Builder.res.mjs +13 -9
- package/src/components/ExtensionPoint/ExtensionPoint.res +2 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Builder.res +10 -0
- package/src/components/ExtensionPoint/ExtensionPoint_Builder.res.mjs +6 -4
- package/src/components/InboundTranslationSlice/InboundTranslationSlice.res +1 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res +8 -1
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res.mjs +1 -1
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice.res +1 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res +12 -3
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res.mjs +5 -2
- package/src/components/ReadModel/ReadModel.res +1 -0
- package/src/components/ReadModel/ReadModel_Builder.res +9 -1
- package/src/components/ReadModel/ReadModel_Builder.res.mjs +5 -2
- package/src/components/StateChangeSlice/StateChangeSlice.res +1 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Builder.res +6 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Builder.res.mjs +1 -1
- package/src/components/StateViewSlice/StateViewSlice.res +1 -0
- package/src/components/StateViewSlice/StateViewSlice_Builder.res +11 -3
- package/src/components/StateViewSlice/StateViewSlice_Builder.res.mjs +5 -2
- package/src/components/Task/Task.res +1 -0
- package/src/components/Task/Task_Builder.res +11 -2
- package/src/components/Task/Task_Builder.res.mjs +7 -4
- package/src/plugin/component/Plugin.res +5 -0
- package/src/plugin/component/Plugin_Builder.res +10 -2
- package/src/plugin/component/Plugin_Builder.res.mjs +7 -6
- package/src/plugin/component/Plugin_Helpers.res +2 -0
- package/src/plugin/component/Plugin_Helpers.res.mjs +2 -2
- package/src/plugin/connect/PluginExtensionPoint_Builder.res +2 -0
- package/src/plugin/connect/PluginExtensionPoint_Builder.res.mjs +3 -3
- package/tests/plugin/ManifestVisibilityTest.res +2 -2
- package/tests/plugin/PluginStructureTest.res +6 -6
- package/tests/IdentityTest.res.mjs +0 -174
- package/tests/adapter/MonitoringTest.res.mjs +0 -82
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res.mjs +0 -356
- package/tests/admin/Platform_UIFragmentsApiTest.res.mjs +0 -101
- package/tests/aggregate/AggregateCacheTest.res.mjs +0 -433
- package/tests/aggregate/AggregateCallbackTest.res.mjs +0 -143
- package/tests/aggregate/AggregateCausationTest.res.mjs +0 -47
- package/tests/aggregate/AggregateConflictTest.res.mjs +0 -386
- package/tests/aggregate/AggregateFixtures.res.mjs +0 -308
- package/tests/aggregate/AggregateRejectionTest.res.mjs +0 -166
- package/tests/aggregate/AggregateSnapshotTest.res.mjs +0 -645
- package/tests/api/ApiNoApiTest.res.mjs +0 -90
- package/tests/api/GraphQL_StitcherTest.res.mjs +0 -112
- package/tests/api/SimpleTest.res.mjs +0 -10
- package/tests/api/SuryToJsonSchemaTest.res.mjs +0 -674
- package/tests/commandgenerator/CommandGeneratorCallbackTest.res.mjs +0 -160
- package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +0 -197
- package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +0 -152
- package/tests/commandtopic/CommandTopicCallbackTest.res.mjs +0 -106
- package/tests/commandtopic/CommandTopicHelpersRejectionTest.res.mjs +0 -109
- package/tests/counter/CounterCallbackTest.res.mjs +0 -140
- package/tests/counter/CounterFixtures.res.mjs +0 -67
- package/tests/dcb/DcbDecodeTest.res.mjs +0 -194
- package/tests/dcb/DcbEventLogOperationsTest.res.mjs +0 -268
- package/tests/dcb/DcbFixtures.res.mjs +0 -534
- package/tests/dcb/DcbScopeInferenceTest.res.mjs +0 -480
- package/tests/dcb/DcbStateChangeSliceTest.res.mjs +0 -540
- package/tests/dcb/DcbTagTest.res.mjs +0 -867
- package/tests/dcb/DcbValidationTest.res.mjs +0 -476
- package/tests/eventlog/EventLogFixtures.res.mjs +0 -196
- package/tests/eventlog/EventLogOperationsTest.res.mjs +0 -192
- package/tests/eventlog/EventLogRetryTest.res.mjs +0 -195
- package/tests/eventmapper/EventMapperCallbackTest.res.mjs +0 -141
- package/tests/eventmapper/EventMapperFixtures.res.mjs +0 -440
- package/tests/eventmapper/EventMapperTest.res.mjs +0 -83
- package/tests/eventtopic/EventTopicFixtures.res.mjs +0 -65
- package/tests/eventtopic/EventTopicOperationsTest.res.mjs +0 -71
- package/tests/extensionpoint/ExtensionPointCallbackTest.res.mjs +0 -94
- package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +0 -205
- package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +0 -304
- package/tests/ftp/FTPTest.res.mjs +0 -88
- package/tests/logger/LogFormatTest.res.mjs +0 -309
- package/tests/logger/LoggerLazyTest.res.mjs +0 -40
- package/tests/message/MessageTest.res.mjs +0 -218
- package/tests/message/MetaEnvelopeTest.res.mjs +0 -188
- package/tests/plugin/ManifestVisibilityTest.res.mjs +0 -215
- package/tests/plugin/PluginSpecExperiment.res.mjs +0 -31
- package/tests/plugin/PluginStructureTest.res.mjs +0 -419
- package/tests/plugin/PluginVersionTest.res.mjs +0 -30
- package/tests/plugin/SchemaWalkerTest.res.mjs +0 -160
- package/tests/plugin/StateChangeSlice/PsPlaceOrder.res.mjs +0 -62
- package/tests/plugin/StateChangeSlice/PsShipOrder.res.mjs +0 -69
- package/tests/plugin/StateViewSlice/PsAnnotatedView.res.mjs +0 -95
- package/tests/plugin/StateViewSlice/PsAvailableProductsView.res.mjs +0 -69
- package/tests/plugin/StateViewSlice/PsCustomersView.res.mjs +0 -69
- package/tests/plugin/StateViewSlice/PsOrdersView.res.mjs +0 -81
- package/tests/poc/StructuralSubtypingPoc.res.mjs +0 -61
- package/tests/projection/ProjectionOptimizeTest.res.mjs +0 -75
- package/tests/querydb/QueryDbFixtures.res.mjs +0 -135
- package/tests/querydb/QueryDbOperationsTest.res.mjs +0 -168
- package/tests/sideeffecthandler/SideEffectHandlerCallbackTest.res.mjs +0 -77
- package/tests/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +0 -139
- package/tests/util/CommandPublisherTest.res.mjs +0 -78
- package/tests/util/CsvStreamTest.res.mjs +0 -51
- package/tests/util/LruTest.res.mjs +0 -105
- package/tests/util/MetricsTest.res.mjs +0 -53
|
@@ -16,6 +16,7 @@ import * as Component$ReventlessCore from "../Component.res.mjs";
|
|
|
16
16
|
import * as DcbValidation$Reventless from "@reventlessdev/reventless-spec/src/components/DcbValidation.res.mjs";
|
|
17
17
|
import * as Api_Naming$ReventlessCore from "../Api/Api_Naming.res.mjs";
|
|
18
18
|
import * as DcbScopeInference$Reventless from "@reventlessdev/reventless-spec/src/components/DcbScopeInference.res.mjs";
|
|
19
|
+
import * as RuntimeHints$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/RuntimeHints.res.mjs";
|
|
19
20
|
import * as Plugin_Helpers$ReventlessCore from "../../plugin/component/Plugin_Helpers.res.mjs";
|
|
20
21
|
import * as ApiNoApiHelpers$ReventlessCore from "../Api/ApiNoApiHelpers.res.mjs";
|
|
21
22
|
import * as Plugin_Structure$ReventlessCore from "../../plugin/component/Plugin_Structure.res.mjs";
|
|
@@ -81,13 +82,14 @@ let emptyResult = {
|
|
|
81
82
|
|
|
82
83
|
function Make(DcbEventLogStorage) {
|
|
83
84
|
return DcbEventTopicPublisher => (DcbCommandTopicChannel => (DcbCommandTopicChannelAsync => (RuntimeBuilder => (HooksConfig => {
|
|
84
|
-
let construct = (name, childName, apiNamePrefixOpt, onAdminApiOpt, environmentOpt, platformNameOpt, aggregateEventTopicsOpt, stateChangeSlices, stateViewSlices, automationSlices, outboundTranslationSlices, inboundTranslationSlices, systemCallableComponentsOpt, pluginStructure, opts) => {
|
|
85
|
+
let construct = (name, childName, apiNamePrefixOpt, onAdminApiOpt, environmentOpt, platformNameOpt, aggregateEventTopicsOpt, stateChangeSlices, stateViewSlices, automationSlices, outboundTranslationSlices, inboundTranslationSlices, systemCallableComponentsOpt, componentRuntimeOpt, pluginStructure, opts) => {
|
|
85
86
|
let apiNamePrefix = apiNamePrefixOpt !== undefined ? apiNamePrefixOpt : name;
|
|
86
87
|
let onAdminApi = onAdminApiOpt !== undefined ? onAdminApiOpt : false;
|
|
87
88
|
let environment = environmentOpt !== undefined ? environmentOpt : "";
|
|
88
89
|
let platformName = platformNameOpt !== undefined ? platformNameOpt : "";
|
|
89
90
|
let aggregateEventTopics = aggregateEventTopicsOpt !== undefined ? aggregateEventTopicsOpt : ({});
|
|
90
91
|
let systemCallableComponents = systemCallableComponentsOpt !== undefined ? systemCallableComponentsOpt : [];
|
|
92
|
+
let componentRuntime = componentRuntimeOpt !== undefined ? componentRuntimeOpt : ({});
|
|
91
93
|
let hasDcb = stateChangeSlices.length !== 0;
|
|
92
94
|
if (!hasDcb) {
|
|
93
95
|
return emptyResult;
|
|
@@ -206,7 +208,7 @@ function Make(DcbEventLogStorage) {
|
|
|
206
208
|
asyncDcbCommandTopicOpt = undefined;
|
|
207
209
|
}
|
|
208
210
|
let stateChangeSlicesOutputs = Object.fromEntries(syncSlices.map(StateChangeSlice => {
|
|
209
|
-
let ch = StateChangeSlice.make(dcbEventLog, publishJsons, effectiveTagKeysByEventType, effectiveCrossPartitionTagKeys, opts);
|
|
211
|
+
let ch = StateChangeSlice.make(dcbEventLog, publishJsons, effectiveTagKeysByEventType, effectiveCrossPartitionTagKeys, componentRuntime[StateChangeSlice.Spec.name], opts);
|
|
210
212
|
return [
|
|
211
213
|
StateChangeSlice.Spec.name,
|
|
212
214
|
Component$ReventlessCore.outputs(ch)
|
|
@@ -216,7 +218,7 @@ function Make(DcbEventLogStorage) {
|
|
|
216
218
|
if (asyncDcbCommandTopicOpt !== undefined) {
|
|
217
219
|
let asyncPublishJsons = Component$ReventlessCore.operations(Primitive_option.valFromOption(asyncDcbCommandTopicOpt)).apply(ops => ops.publishJsons);
|
|
218
220
|
asyncStateChangeSlicesOutputs = Object.fromEntries(asyncSlices.map(StateChangeSlice => {
|
|
219
|
-
let ch = StateChangeSlice.make(dcbEventLog, asyncPublishJsons, effectiveTagKeysByEventType, effectiveCrossPartitionTagKeys, opts);
|
|
221
|
+
let ch = StateChangeSlice.make(dcbEventLog, asyncPublishJsons, effectiveTagKeysByEventType, effectiveCrossPartitionTagKeys, componentRuntime[StateChangeSlice.Spec.name], opts);
|
|
220
222
|
return [
|
|
221
223
|
StateChangeSlice.Spec.name,
|
|
222
224
|
Component$ReventlessCore.outputs(ch)
|
|
@@ -297,7 +299,7 @@ function Make(DcbEventLogStorage) {
|
|
|
297
299
|
Plugin_Helpers$ReventlessCore.queryFieldNamesRegistry[I.queryDbName] = qn;
|
|
298
300
|
});
|
|
299
301
|
let stateViewSlicesOutputs = Object.fromEntries(stateViewSlices.map(StateViewSlice => {
|
|
300
|
-
let sv = StateViewSlice.make(dcbEventLog, opts);
|
|
302
|
+
let sv = StateViewSlice.make(dcbEventLog, componentRuntime[StateViewSlice.Spec.name], opts);
|
|
301
303
|
return [
|
|
302
304
|
StateViewSlice.Spec.name,
|
|
303
305
|
Component$ReventlessCore.outputs(sv)
|
|
@@ -313,21 +315,21 @@ function Make(DcbEventLogStorage) {
|
|
|
313
315
|
pluginName: name,
|
|
314
316
|
sliceName: context_sliceName
|
|
315
317
|
};
|
|
316
|
-
let as_ = AutoSlice.make(allEventTopics, publishJsons, context, opts);
|
|
318
|
+
let as_ = AutoSlice.make(allEventTopics, publishJsons, context, componentRuntime[AutoSlice.Spec.name], opts);
|
|
317
319
|
return [
|
|
318
320
|
AutoSlice.Spec.name,
|
|
319
321
|
Component$ReventlessCore.outputs(as_)
|
|
320
322
|
];
|
|
321
323
|
}));
|
|
322
324
|
let outboundTranslationSlicesOutputs = Object.fromEntries(outboundTranslationSlices.map(OTS => {
|
|
323
|
-
let ots = OTS.make(dcbEventLog, publishJsons, opts);
|
|
325
|
+
let ots = OTS.make(dcbEventLog, publishJsons, componentRuntime[OTS.Spec.name], opts);
|
|
324
326
|
return [
|
|
325
327
|
OTS.Spec.name,
|
|
326
328
|
Component$ReventlessCore.outputs(ots)
|
|
327
329
|
];
|
|
328
330
|
}));
|
|
329
331
|
let inboundTranslationSliceData = inboundTranslationSlices.map(ITS => {
|
|
330
|
-
let its = ITS.make(publishJsons, opts);
|
|
332
|
+
let its = ITS.make(publishJsons, componentRuntime[ITS.Spec.name], opts);
|
|
331
333
|
let fieldName = Api_Naming$ReventlessCore.sliceMutationField(name, ITS.Spec.name);
|
|
332
334
|
let registerResolver = HooksConfig.hooks.inboundMutationResolverHook;
|
|
333
335
|
if (registerResolver !== undefined) {
|
|
@@ -435,12 +437,14 @@ function Make(DcbEventLogStorage) {
|
|
|
435
437
|
}
|
|
436
438
|
};
|
|
437
439
|
Stdlib_Option.forEach(HooksConfig.hooks.onDcbSlicesCreated, hook => hook(dcbEventLog));
|
|
440
|
+
let sliceMemoryFloor = slices => Stdlib_Array.reduce(slices, 0, (acc, M) => Math.max(acc, RuntimeHints$ReventlessInfra.resolveMemory(componentRuntime[M.Spec.name], 0)));
|
|
441
|
+
let sliceTimeoutFloor = slices => Stdlib_Array.reduce(slices, 0, (acc, M) => Math.max(acc, RuntimeHints$ReventlessInfra.resolveTimeout(componentRuntime[M.Spec.name], 0)));
|
|
438
442
|
let dcbRuntimeSetup = () => {
|
|
439
|
-
RuntimeBuilder.forDcbCommandTopic(dcbHandler, dcbConnectFn,
|
|
443
|
+
RuntimeBuilder.forDcbCommandTopic(dcbHandler, dcbConnectFn, sliceMemoryFloor(syncSlices), sliceTimeoutFloor(syncSlices), dcbCommandTopic);
|
|
440
444
|
Stdlib_Option.forEach(asyncDcbCommandTopicOpt, asyncDcbCommandTopic => {
|
|
441
445
|
let asyncDcbHandler = DcbAsyncCommandTopic.makeFilteringHandler(asyncDcbCommandTopic);
|
|
442
446
|
let asyncDcbConnectFn = runtime => DcbAsyncCommandTopic.connect(runtime, asyncDcbResources, asyncDcbCommandTopic);
|
|
443
|
-
RuntimeBuilder.forDcbCommandTopic(asyncDcbHandler, asyncDcbConnectFn,
|
|
447
|
+
RuntimeBuilder.forDcbCommandTopic(asyncDcbHandler, asyncDcbConnectFn, sliceMemoryFloor(asyncSlices), sliceTimeoutFloor(asyncSlices), asyncDcbCommandTopic);
|
|
444
448
|
});
|
|
445
449
|
};
|
|
446
450
|
let permissionForFirstConstructor = (commandSchema, commandAuthorization) => {
|
|
@@ -11,12 +11,14 @@ module type T = {
|
|
|
11
11
|
type operations = operations
|
|
12
12
|
type component = component<operations>
|
|
13
13
|
|
|
14
|
+
let name: string
|
|
14
15
|
let make: (
|
|
15
16
|
~aggregateResources: dict<array<ReventlessInfra.Adapter.resource>>,
|
|
16
17
|
~publishToAggregates: dict<CommandTopic.publishJsons>,
|
|
17
18
|
~scheduler: Scheduler.operations,
|
|
18
19
|
~queryEngine: Reventless.QueryEngine.operations,
|
|
19
20
|
~resourceNaming: ReventlessInfra.ResourceNaming.operations,
|
|
21
|
+
~runtime: ReventlessInfra.RuntimeHints.t=?,
|
|
20
22
|
~opts: option<Pulumi.ComponentResource.options>,
|
|
21
23
|
) => component
|
|
22
24
|
let outputs: component => outputs
|
|
@@ -7,12 +7,15 @@ module Make = (
|
|
|
7
7
|
EventTopicAdapter: EventTopic_Adapter.Publisher,
|
|
8
8
|
ExtensionPointRuntimeBuilder: ExtensionPointRuntime_Builder.T
|
|
9
9
|
with module CommandTopicChannel := CommandTopicChannel,
|
|
10
|
+
Defaults: ReventlessInfra.RuntimeDefaults.T,
|
|
10
11
|
): ExtensionPoint.T => {
|
|
11
12
|
module Spec = Spec
|
|
12
13
|
|
|
13
14
|
type operations = ExtensionPoint.operations
|
|
14
15
|
type component = ExtensionPoint.component<operations>
|
|
15
16
|
|
|
17
|
+
let name = Spec.name
|
|
18
|
+
|
|
16
19
|
module SpecWithId: Reventless.ExtensionPoint.Spec
|
|
17
20
|
with type command = Spec.command
|
|
18
21
|
and type event = Spec.event
|
|
@@ -36,6 +39,7 @@ module Make = (
|
|
|
36
39
|
~scheduler: Scheduler.operations,
|
|
37
40
|
~queryEngine: Reventless.QueryEngine.operations,
|
|
38
41
|
~resourceNaming: ReventlessInfra.ResourceNaming.operations,
|
|
42
|
+
~runtime: option<ReventlessInfra.RuntimeHints.t>,
|
|
39
43
|
self,
|
|
40
44
|
name,
|
|
41
45
|
) => {
|
|
@@ -89,6 +93,10 @@ module Make = (
|
|
|
89
93
|
commandTopic->ExtensionPointRuntimeBuilder.forCommandTopic(
|
|
90
94
|
~handler,
|
|
91
95
|
~connect=SpecificCommandTopic.connect(commandTopic, ~resources, ...),
|
|
96
|
+
~memorySize=runtime->ReventlessInfra.RuntimeHints.resolveMemory(
|
|
97
|
+
~default=Defaults.memorySize,
|
|
98
|
+
),
|
|
99
|
+
~timeout=runtime->ReventlessInfra.RuntimeHints.resolveTimeout(~default=Defaults.timeout),
|
|
92
100
|
~specModulePath=Spec.moduleUrl,
|
|
93
101
|
~mappingsModulePath=Mappings.moduleUrl,
|
|
94
102
|
~publishToAggregatesQueueUrls,
|
|
@@ -142,6 +150,7 @@ module Make = (
|
|
|
142
150
|
~scheduler,
|
|
143
151
|
~queryEngine,
|
|
144
152
|
~resourceNaming,
|
|
153
|
+
~runtime=?,
|
|
145
154
|
~opts,
|
|
146
155
|
) =>
|
|
147
156
|
Component.make(
|
|
@@ -153,6 +162,7 @@ module Make = (
|
|
|
153
162
|
~scheduler,
|
|
154
163
|
~queryEngine,
|
|
155
164
|
~resourceNaming,
|
|
165
|
+
~runtime,
|
|
156
166
|
...
|
|
157
167
|
),
|
|
158
168
|
~opts,
|
|
@@ -9,6 +9,7 @@ import * as Pulumi from "@pulumi/pulumi";
|
|
|
9
9
|
import * as Adapter$ReventlessCore from "../../adapter/Adapter.res.mjs";
|
|
10
10
|
import * as Component$ReventlessCore from "../Component.res.mjs";
|
|
11
11
|
import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
|
|
12
|
+
import * as RuntimeHints$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/RuntimeHints.res.mjs";
|
|
12
13
|
import * as ExtensionPoint$ReventlessCore from "./ExtensionPoint.res.mjs";
|
|
13
14
|
import * as EventTopic_Builder$ReventlessCore from "../EventTopic/EventTopic_Builder.res.mjs";
|
|
14
15
|
import * as CommandTopic_Builder$ReventlessCore from "../CommandTopic/CommandTopic_Builder.res.mjs";
|
|
@@ -16,7 +17,7 @@ import * as ExtensionPoint_Callback$ReventlessCore from "./ExtensionPoint_Callba
|
|
|
16
17
|
import * as ExtensionPoint_Operations$ReventlessCore from "./ExtensionPoint_Operations.res.mjs";
|
|
17
18
|
|
|
18
19
|
function Make(Spec) {
|
|
19
|
-
return Mappings => (RuntimeEnvironment => (CommandTopicChannel => (EventTopicAdapter => (ExtensionPointRuntimeBuilder => {
|
|
20
|
+
return Mappings => (RuntimeEnvironment => (CommandTopicChannel => (EventTopicAdapter => (ExtensionPointRuntimeBuilder => (Defaults => {
|
|
20
21
|
let name = Spec.name;
|
|
21
22
|
let commandSchema = Spec.commandSchema;
|
|
22
23
|
let eventSchema = Spec.eventSchema;
|
|
@@ -24,7 +25,7 @@ function Make(Spec) {
|
|
|
24
25
|
let name = param[0];
|
|
25
26
|
return aggregateNames.some(aggregateName => aggregateName === name);
|
|
26
27
|
}).map(param => param[1]).flat();
|
|
27
|
-
let make = (aggregateResources, publishToAggregates, scheduler, queryEngine, resourceNaming, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(ExtensionPoint$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
28
|
+
let make = (aggregateResources, publishToAggregates, scheduler, queryEngine, resourceNaming, runtime, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(ExtensionPoint$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
28
29
|
let opts_parent = Component$ReventlessCore.toPulumiResource(extra);
|
|
29
30
|
let opts = {
|
|
30
31
|
parent: opts_parent
|
|
@@ -58,7 +59,7 @@ function Make(Spec) {
|
|
|
58
59
|
return Pulumi.output("");
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
|
-
ExtensionPointRuntimeBuilder.forCommandTopic(handler, none => SpecificCommandTopic.connect(none, resources, commandTopic),
|
|
62
|
+
ExtensionPointRuntimeBuilder.forCommandTopic(handler, none => SpecificCommandTopic.connect(none, resources, commandTopic), RuntimeHints$ReventlessInfra.resolveMemory(runtime, Defaults.memorySize), RuntimeHints$ReventlessInfra.resolveTimeout(runtime, Defaults.timeout), Spec.moduleUrl, Mappings.moduleUrl, publishToAggregatesQueueUrls, commandTopic);
|
|
62
63
|
let SpecificEventTopic = EventTopic_Builder$ReventlessCore.Make({
|
|
63
64
|
Id: Id$Reventless.$$String,
|
|
64
65
|
name: name,
|
|
@@ -100,11 +101,12 @@ function Make(Spec) {
|
|
|
100
101
|
return Component$ReventlessCore.setOutputs(extra, epOutputs);
|
|
101
102
|
}, opts);
|
|
102
103
|
return {
|
|
104
|
+
name: Spec.name,
|
|
103
105
|
make: make,
|
|
104
106
|
outputs: Component$ReventlessCore.outputs,
|
|
105
107
|
operations: Component$ReventlessCore.operations
|
|
106
108
|
};
|
|
107
|
-
}))));
|
|
109
|
+
})))));
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
export {
|
|
@@ -87,7 +87,14 @@ module Make = (
|
|
|
87
87
|
self->Component.setOutputs(outputs)
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
// InboundTranslationSlice publishes commands + syncs its QueryDb inline; it
|
|
91
|
+
// provisions no per-slice runtime environment, so the runtime hint is accepted
|
|
92
|
+
// (for composition-surface parity) and discarded.
|
|
93
|
+
let make = (
|
|
94
|
+
~publishJsons,
|
|
95
|
+
~runtime as _=?,
|
|
96
|
+
~opts=?,
|
|
97
|
+
): InboundTranslationSlice.component =>
|
|
91
98
|
Component.make(
|
|
92
99
|
~componentType=InboundTranslationSlice.componentType->ComponentType.toString,
|
|
93
100
|
~name=Spec.name,
|
|
@@ -34,7 +34,7 @@ function Make(QueryDbStorage) {
|
|
|
34
34
|
await queryDbOps.save(Id$Reventless.$$String.makeFromString(param[0]), param[1], "Overwrite", undefined);
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
-
let make = (publishJsons, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(InboundTranslationSlice$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
37
|
+
let make = (publishJsons, param, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(InboundTranslationSlice$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
38
38
|
let opts_parent = Component$ReventlessCore.toPulumiResource(extra);
|
|
39
39
|
let opts = {
|
|
40
40
|
parent: opts_parent
|
|
@@ -67,8 +67,10 @@ module Make = (
|
|
|
67
67
|
})
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
let construct = (~dcbEventLog: DcbEventLog.component, ~publishJsons, self, _name) => {
|
|
70
|
+
let construct = (~dcbEventLog: DcbEventLog.component, ~publishJsons, ~runtime, self, _name) => {
|
|
71
71
|
let opts = {Pulumi.ComponentResource.parent: self->Component.toPulumiResource}
|
|
72
|
+
let memorySize = ReventlessInfra.RuntimeHints.resolveMemory(runtime, ~default=1024)
|
|
73
|
+
let timeout = ReventlessInfra.RuntimeHints.resolveTimeout(runtime, ~default=30)
|
|
72
74
|
|
|
73
75
|
let queryDb = SpecificQueryDb.make(~api=Api.api(), ~apiRole=Api.apiRole(), ~opts)
|
|
74
76
|
|
|
@@ -147,6 +149,8 @@ module Make = (
|
|
|
147
149
|
~handler,
|
|
148
150
|
~eventTopics=allEventTopics,
|
|
149
151
|
~resources,
|
|
152
|
+
~memorySize,
|
|
153
|
+
~timeout,
|
|
150
154
|
)
|
|
151
155
|
ec
|
|
152
156
|
})
|
|
@@ -170,11 +174,16 @@ module Make = (
|
|
|
170
174
|
self->Component.setOutputs(outputs)
|
|
171
175
|
}
|
|
172
176
|
|
|
173
|
-
let make = (
|
|
177
|
+
let make = (
|
|
178
|
+
~dcbEventLog,
|
|
179
|
+
~publishJsons,
|
|
180
|
+
~runtime=?,
|
|
181
|
+
~opts=?,
|
|
182
|
+
): OutboundTranslationSlice.component =>
|
|
174
183
|
Component.make(
|
|
175
184
|
~componentType=OutboundTranslationSlice.componentType->ComponentType.toString,
|
|
176
185
|
~name=Spec.name,
|
|
177
|
-
~construct=construct(~dcbEventLog, ~publishJsons, ...),
|
|
186
|
+
~construct=construct(~dcbEventLog, ~publishJsons, ~runtime, ...),
|
|
178
187
|
~opts,
|
|
179
188
|
)
|
|
180
189
|
}
|
|
@@ -18,6 +18,7 @@ import * as Message$ReventlessCore from "../../Message.res.mjs";
|
|
|
18
18
|
import * as Component$ReventlessCore from "../Component.res.mjs";
|
|
19
19
|
import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
|
|
20
20
|
import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
|
|
21
|
+
import * as RuntimeHints$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/RuntimeHints.res.mjs";
|
|
21
22
|
import * as QueryDb_Builder$ReventlessCore from "../QueryDb/QueryDb_Builder.res.mjs";
|
|
22
23
|
import * as EventCollector_Builder$ReventlessCore from "../EventCollector/EventCollector_Builder.res.mjs";
|
|
23
24
|
import * as OutboundTranslationSlice$ReventlessCore from "./OutboundTranslationSlice.res.mjs";
|
|
@@ -51,11 +52,13 @@ function Make(RuntimeEnvironment) {
|
|
|
51
52
|
await queryDbOps.save(Id$Reventless.$$String.makeFromString(param[0]), param[1], "Overwrite", undefined);
|
|
52
53
|
});
|
|
53
54
|
};
|
|
54
|
-
let make = (dcbEventLog, publishJsons, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(OutboundTranslationSlice$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
55
|
+
let make = (dcbEventLog, publishJsons, runtime, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(OutboundTranslationSlice$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
55
56
|
let opts_parent = Component$ReventlessCore.toPulumiResource(extra);
|
|
56
57
|
let opts = {
|
|
57
58
|
parent: opts_parent
|
|
58
59
|
};
|
|
60
|
+
let memorySize = RuntimeHints$ReventlessInfra.resolveMemory(runtime, 1024);
|
|
61
|
+
let timeout = RuntimeHints$ReventlessInfra.resolveTimeout(runtime, 30);
|
|
59
62
|
let queryDb = SpecificQueryDb.make(Api.api(), Api.apiRole(), undefined, opts);
|
|
60
63
|
let dcbEventTopicOutputs = Component$ReventlessCore.outputs(dcbEventLog).eventTopic;
|
|
61
64
|
let allEventTopics = Object.fromEntries([[
|
|
@@ -95,7 +98,7 @@ function Make(RuntimeEnvironment) {
|
|
|
95
98
|
}));
|
|
96
99
|
let handler = SpecificEventCollector.makeHandler(ec, jsonEventsHandler);
|
|
97
100
|
let resources = Component$ReventlessCore.outputs(queryDb).resources;
|
|
98
|
-
EventCollectorRuntimeBuilder.forEventCollector(handler, allEventTopics, resources,
|
|
101
|
+
EventCollectorRuntimeBuilder.forEventCollector(handler, allEventTopics, resources, memorySize, timeout, ec);
|
|
99
102
|
return ec;
|
|
100
103
|
});
|
|
101
104
|
Component$ReventlessCore.setOperations(extra, Pulumi.all([
|
|
@@ -46,11 +46,16 @@ module Make = (
|
|
|
46
46
|
~api: QueryDbStorage.api,
|
|
47
47
|
~apiRole: QueryDbStorage.role,
|
|
48
48
|
~allEventTopics,
|
|
49
|
+
~runtime,
|
|
49
50
|
self,
|
|
50
51
|
name,
|
|
51
52
|
) => {
|
|
52
53
|
let opts = {Pulumi.ComponentResource.parent: self->Component.toPulumiResource}
|
|
53
54
|
let name = name->ComponentType.name(ReadModel.componentType)
|
|
55
|
+
// Per-component runtime hint raises the event-collector memory floor and
|
|
56
|
+
// overrides the timeout; absent hint keeps the builder defaults.
|
|
57
|
+
let memorySize = ReventlessInfra.RuntimeHints.resolveMemory(runtime, ~default=1024)
|
|
58
|
+
let timeout = ReventlessInfra.RuntimeHints.resolveTimeout(runtime, ~default=30)
|
|
54
59
|
|
|
55
60
|
module SpecificQueryDb = QueryDb_Builder.Make(Spec, QueryDbStorage, QueryDbResolvers)
|
|
56
61
|
let queryDb = SpecificQueryDb.make(~api, ~apiRole, ~opts)
|
|
@@ -129,6 +134,8 @@ module Make = (
|
|
|
129
134
|
~handler,
|
|
130
135
|
~eventTopics,
|
|
131
136
|
~resources,
|
|
137
|
+
~memorySize,
|
|
138
|
+
~timeout,
|
|
132
139
|
)
|
|
133
140
|
|
|
134
141
|
eventCollector
|
|
@@ -152,12 +159,13 @@ module Make = (
|
|
|
152
159
|
~api: QueryDbStorage.api,
|
|
153
160
|
~apiRole: QueryDbStorage.role,
|
|
154
161
|
~allEventTopics,
|
|
162
|
+
~runtime=?,
|
|
155
163
|
~opts=?,
|
|
156
164
|
): ReadModel.component =>
|
|
157
165
|
Component.make(
|
|
158
166
|
~componentType=ReadModel.componentType->ComponentType.toString,
|
|
159
167
|
~name=Spec.name,
|
|
160
|
-
~construct=construct(~api, ~apiRole, ~allEventTopics, ...),
|
|
168
|
+
~construct=construct(~api, ~apiRole, ~allEventTopics, ~runtime, ...),
|
|
161
169
|
~opts,
|
|
162
170
|
)
|
|
163
171
|
|
|
@@ -9,6 +9,7 @@ import * as Component$ReventlessCore from "../Component.res.mjs";
|
|
|
9
9
|
import * as ReadModel$ReventlessCore from "./ReadModel.res.mjs";
|
|
10
10
|
import * as EventTopic$ReventlessCore from "../EventTopic/EventTopic.res.mjs";
|
|
11
11
|
import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
|
|
12
|
+
import * as RuntimeHints$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/RuntimeHints.res.mjs";
|
|
12
13
|
import * as QueryDb_Builder$ReventlessCore from "../QueryDb/QueryDb_Builder.res.mjs";
|
|
13
14
|
import * as ReadModel_Callback$ReventlessCore from "./ReadModel_Callback.res.mjs";
|
|
14
15
|
import * as EventCollector_Builder$ReventlessCore from "../EventCollector/EventCollector_Builder.res.mjs";
|
|
@@ -17,12 +18,14 @@ function Make(Spec) {
|
|
|
17
18
|
return Mappings => (RuntimeEnvironment => (QueryDbStorage => (QueryDbResolvers => (EventCollectorChannel => (EventCollectorRuntimeBuilder => {
|
|
18
19
|
let sourceNames = Belt_SetString.toArray(Belt_SetString.fromArray(Mappings.mappings.map(Mapping => Mapping.sourceName)));
|
|
19
20
|
let consumedEventNames = Belt_SetString.toArray(Belt_SetString.fromArray(Mappings.mappings.flatMap(Mapping => DcbTag$Reventless.extractVariantNames(Mapping.sourceEventSchema))));
|
|
20
|
-
let make = (api, apiRole, allEventTopics, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(ReadModel$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
21
|
+
let make = (api, apiRole, allEventTopics, runtime, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(ReadModel$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
21
22
|
let opts_parent = Component$ReventlessCore.toPulumiResource(extra);
|
|
22
23
|
let opts = {
|
|
23
24
|
parent: opts_parent
|
|
24
25
|
};
|
|
25
26
|
let name = ComponentType$ReventlessCore.name(extra$1, ReadModel$ReventlessCore.componentType);
|
|
27
|
+
let memorySize = RuntimeHints$ReventlessInfra.resolveMemory(runtime, 1024);
|
|
28
|
+
let timeout = RuntimeHints$ReventlessInfra.resolveTimeout(runtime, 30);
|
|
26
29
|
let SpecificQueryDb = QueryDb_Builder$ReventlessCore.Make(Spec)(QueryDbStorage)(QueryDbResolvers);
|
|
27
30
|
let queryDb = SpecificQueryDb.make(api, apiRole, undefined, opts);
|
|
28
31
|
let toProjectionOperations = param => {
|
|
@@ -69,7 +72,7 @@ function Make(Spec) {
|
|
|
69
72
|
});
|
|
70
73
|
let handler = SpecificEventCollector.makeHandler(eventCollector, Callback.handleJsonEvents);
|
|
71
74
|
let resources = Component$ReventlessCore.outputs(queryDb).resources;
|
|
72
|
-
EventCollectorRuntimeBuilder.forEventCollector(handler, eventTopics, resources,
|
|
75
|
+
EventCollectorRuntimeBuilder.forEventCollector(handler, eventTopics, resources, memorySize, timeout, eventCollector);
|
|
73
76
|
return eventCollector;
|
|
74
77
|
});
|
|
75
78
|
Component$ReventlessCore.setOperations(extra, Output$Pulumi.flatMap(eventCollector, Component$ReventlessCore.operations).apply(param => param.enqueueEvent));
|
|
@@ -33,6 +33,7 @@ module type T = {
|
|
|
33
33
|
clause (instead of an AND-ed composite) so the decision read is a real
|
|
34
34
|
secondary-tag read. */
|
|
35
35
|
~crossPartitionTagKeys: array<string>=?,
|
|
36
|
+
~runtime: ReventlessInfra.RuntimeHints.t=?,
|
|
36
37
|
~opts: Pulumi.ComponentResource.options=?,
|
|
37
38
|
) => component
|
|
38
39
|
}
|
|
@@ -75,11 +75,17 @@ module Make = (
|
|
|
75
75
|
self->Component.setOutputs(outputs)
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
// A StateChangeSlice registers its handler on the plugin's shared DCB command
|
|
79
|
+
// topic Lambda, so it has no per-slice runtime environment. The per-component
|
|
80
|
+
// hint is folded into that shared Lambda's size in the plugin/DCB runtime
|
|
81
|
+
// builder (keyed by `Spec.name` from `componentRuntime`), not here — so the
|
|
82
|
+
// slice builder accepts the hint for composition-surface parity and discards it.
|
|
78
83
|
let make = (
|
|
79
84
|
~dcbEventLog,
|
|
80
85
|
~publishJsons,
|
|
81
86
|
~tagKeysByEventType=Dict.make(),
|
|
82
87
|
~crossPartitionTagKeys=[],
|
|
88
|
+
~runtime as _=?,
|
|
83
89
|
~opts=?,
|
|
84
90
|
): StateChangeSlice.component =>
|
|
85
91
|
Component.make(
|
|
@@ -46,7 +46,7 @@ function Make(Spec) {
|
|
|
46
46
|
});
|
|
47
47
|
return Callback.handleCommands(tagKeysByEventType, crossPartitionTagKeys, dcbEventLogOps, decodedStream);
|
|
48
48
|
});
|
|
49
|
-
let make = (dcbEventLog, publishJsons, tagKeysByEventTypeOpt, crossPartitionTagKeysOpt, opts) => {
|
|
49
|
+
let make = (dcbEventLog, publishJsons, tagKeysByEventTypeOpt, crossPartitionTagKeysOpt, param, opts) => {
|
|
50
50
|
let tagKeysByEventType = tagKeysByEventTypeOpt !== undefined ? tagKeysByEventTypeOpt : ({});
|
|
51
51
|
let crossPartitionTagKeys = crossPartitionTagKeysOpt !== undefined ? crossPartitionTagKeysOpt : [];
|
|
52
52
|
return Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(StateChangeSlice$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
@@ -58,8 +58,10 @@ module Make = (
|
|
|
58
58
|
|
|
59
59
|
let decoder = Reventless.DcbDecode.makeDecoder(Spec.consumedEventSchema)
|
|
60
60
|
|
|
61
|
-
let construct = (~dcbEventLog: DcbEventLog.component, self, _name) => {
|
|
61
|
+
let construct = (~dcbEventLog: DcbEventLog.component, ~runtime, self, _name) => {
|
|
62
62
|
let opts = {Pulumi.ComponentResource.parent: self->Component.toPulumiResource}
|
|
63
|
+
let memorySize = ReventlessInfra.RuntimeHints.resolveMemory(runtime, ~default=1024)
|
|
64
|
+
let timeout = ReventlessInfra.RuntimeHints.resolveTimeout(runtime, ~default=30)
|
|
63
65
|
|
|
64
66
|
let queryDb = SpecificQueryDb.make(~api=Api.api(), ~apiRole=Api.apiRole(), ~opts)
|
|
65
67
|
|
|
@@ -145,6 +147,8 @@ module Make = (
|
|
|
145
147
|
~handler,
|
|
146
148
|
~eventTopics=allEventTopics,
|
|
147
149
|
~resources,
|
|
150
|
+
~memorySize,
|
|
151
|
+
~timeout,
|
|
148
152
|
)
|
|
149
153
|
ec
|
|
150
154
|
})
|
|
@@ -165,11 +169,15 @@ module Make = (
|
|
|
165
169
|
self->Component.setOutputs(outputs)
|
|
166
170
|
}
|
|
167
171
|
|
|
168
|
-
let make = (
|
|
172
|
+
let make = (
|
|
173
|
+
~dcbEventLog,
|
|
174
|
+
~runtime=?,
|
|
175
|
+
~opts=?,
|
|
176
|
+
): StateViewSlice.component =>
|
|
169
177
|
Component.make(
|
|
170
178
|
~componentType=StateViewSlice.componentType->ComponentType.toString,
|
|
171
179
|
~name=Spec.name,
|
|
172
|
-
~construct=construct(~dcbEventLog, ...),
|
|
180
|
+
~construct=construct(~dcbEventLog, ~runtime, ...),
|
|
173
181
|
~opts,
|
|
174
182
|
)
|
|
175
183
|
}
|
|
@@ -17,6 +17,7 @@ import * as LogFormat$ReventlessCore from "../../util/LogFormat.res.mjs";
|
|
|
17
17
|
import * as Projection$ReventlessCore from "../../Projection.res.mjs";
|
|
18
18
|
import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
|
|
19
19
|
import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
|
|
20
|
+
import * as RuntimeHints$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/RuntimeHints.res.mjs";
|
|
20
21
|
import * as StateViewSlice$ReventlessCore from "./StateViewSlice.res.mjs";
|
|
21
22
|
import * as QueryDb_Builder$ReventlessCore from "../QueryDb/QueryDb_Builder.res.mjs";
|
|
22
23
|
import * as EventCollector_Builder$ReventlessCore from "../EventCollector/EventCollector_Builder.res.mjs";
|
|
@@ -53,11 +54,13 @@ function Make(RuntimeEnvironment) {
|
|
|
53
54
|
]))
|
|
54
55
|
});
|
|
55
56
|
let decoder = DcbDecode$Reventless.makeDecoder(Spec.consumedEventSchema);
|
|
56
|
-
let make = (dcbEventLog, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(StateViewSlice$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
57
|
+
let make = (dcbEventLog, runtime, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(StateViewSlice$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
57
58
|
let opts_parent = Component$ReventlessCore.toPulumiResource(extra);
|
|
58
59
|
let opts = {
|
|
59
60
|
parent: opts_parent
|
|
60
61
|
};
|
|
62
|
+
let memorySize = RuntimeHints$ReventlessInfra.resolveMemory(runtime, 1024);
|
|
63
|
+
let timeout = RuntimeHints$ReventlessInfra.resolveTimeout(runtime, 30);
|
|
61
64
|
let queryDb = SpecificQueryDb.make(Api.api(), Api.apiRole(), undefined, opts);
|
|
62
65
|
let dcbEventTopicOutputs = Component$ReventlessCore.outputs(dcbEventLog).eventTopic;
|
|
63
66
|
let allEventTopics = Object.fromEntries([[
|
|
@@ -98,7 +101,7 @@ function Make(RuntimeEnvironment) {
|
|
|
98
101
|
});
|
|
99
102
|
let handler = SpecificEventCollector.makeHandler(ec, jsonEventsHandler);
|
|
100
103
|
let resources = Component$ReventlessCore.outputs(queryDb).resources;
|
|
101
|
-
EventCollectorRuntimeBuilder.forEventCollector(handler, allEventTopics, resources,
|
|
104
|
+
EventCollectorRuntimeBuilder.forEventCollector(handler, allEventTopics, resources, memorySize, timeout, ec);
|
|
102
105
|
return ec;
|
|
103
106
|
});
|
|
104
107
|
Component$ReventlessCore.setOperations(extra, Output$Pulumi.flatMap(eventCollector, Component$ReventlessCore.operations).apply(param => ({
|
|
@@ -30,6 +30,7 @@ type maker = (
|
|
|
30
30
|
~queryEngine: Reventless.QueryEngine.operations,
|
|
31
31
|
~resourceNaming: ReventlessInfra.ResourceNaming.operations,
|
|
32
32
|
~allAggregates: dict<Aggregate.outputs>,
|
|
33
|
+
~runtime: ReventlessInfra.RuntimeHints.t=?,
|
|
33
34
|
~opts: option<Pulumi.ComponentResource.options>,
|
|
34
35
|
) => component
|
|
35
36
|
|
|
@@ -28,6 +28,7 @@ module Make = (
|
|
|
28
28
|
and type runtimeParts = RuntimeEnvironment.parts
|
|
29
29
|
and type context = TaskRuntimeBuilder.context,
|
|
30
30
|
SpecificSideEffectHandler: SideEffectHandler.T,
|
|
31
|
+
Defaults: ReventlessInfra.RuntimeDefaults.T,
|
|
31
32
|
): Task.T => {
|
|
32
33
|
module Spec = Spec
|
|
33
34
|
type component = Task.component
|
|
@@ -45,10 +46,16 @@ module Make = (
|
|
|
45
46
|
~queryEngine,
|
|
46
47
|
~resourceNaming: ReventlessInfra.ResourceNaming.operations,
|
|
47
48
|
~allAggregates,
|
|
49
|
+
~runtime,
|
|
48
50
|
self,
|
|
49
51
|
taskName,
|
|
50
52
|
) => {
|
|
51
53
|
let opts = {Pulumi.ComponentResource.parent: self->Component.toPulumiResource}
|
|
54
|
+
// Task bucket callbacks default to the platform-supplied task-pod floor (a
|
|
55
|
+
// large envelope for bulk import/export work); a plugin.json `runtime`
|
|
56
|
+
// override raises memory above it and replaces timeout.
|
|
57
|
+
let memorySize = ReventlessInfra.RuntimeHints.resolveMemory(runtime, ~default=Defaults.memorySize)
|
|
58
|
+
let timeout = ReventlessInfra.RuntimeHints.resolveTimeout(runtime, ~default=Defaults.timeout)
|
|
52
59
|
let allCommandTopics = allAggregates->Aggregate.allCommandTopics
|
|
53
60
|
|
|
54
61
|
// Each adapter chooses what string the Task runtime should treat as the
|
|
@@ -171,8 +178,8 @@ module Make = (
|
|
|
171
178
|
~opts,
|
|
172
179
|
...
|
|
173
180
|
),
|
|
174
|
-
~memorySize
|
|
175
|
-
~timeout
|
|
181
|
+
~memorySize,
|
|
182
|
+
~timeout,
|
|
176
183
|
~name=bucketStem,
|
|
177
184
|
~callbackModulePath=Spec.moduleUrl,
|
|
178
185
|
~publishToAggregatesQueueUrls,
|
|
@@ -201,6 +208,7 @@ module Make = (
|
|
|
201
208
|
~queryEngine,
|
|
202
209
|
~resourceNaming,
|
|
203
210
|
~allAggregates,
|
|
211
|
+
~runtime=?,
|
|
204
212
|
~opts,
|
|
205
213
|
) =>
|
|
206
214
|
Component.make(
|
|
@@ -214,6 +222,7 @@ module Make = (
|
|
|
214
222
|
~queryEngine,
|
|
215
223
|
~resourceNaming,
|
|
216
224
|
~allAggregates,
|
|
225
|
+
~runtime,
|
|
217
226
|
...
|
|
218
227
|
),
|
|
219
228
|
~opts,
|
|
@@ -11,6 +11,7 @@ import * as Aggregate$ReventlessCore from "../Aggregate/Aggregate.res.mjs";
|
|
|
11
11
|
import * as Component$ReventlessCore from "../Component.res.mjs";
|
|
12
12
|
import * as Util_Promise$ReventlessCore from "../../util/Util_Promise.res.mjs";
|
|
13
13
|
import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
|
|
14
|
+
import * as RuntimeHints$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/RuntimeHints.res.mjs";
|
|
14
15
|
|
|
15
16
|
let log = Logger$ReventlessCore.fromEnv();
|
|
16
17
|
|
|
@@ -19,12 +20,14 @@ function pascalCase(s) {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
function Make(Spec) {
|
|
22
|
-
return RuntimeEnvironment => (EventCollectorChannel => (EventCollectorRuntimeBuilder => (TaskRuntimeBuilder => (TaskBucket => (SpecificSideEffectHandler => {
|
|
23
|
-
let make = (queryBucketName, scheduler, schedulerRoleUrn, publishToAggregates, queryEngine, resourceNaming, allAggregates, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(Task$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
23
|
+
return RuntimeEnvironment => (EventCollectorChannel => (EventCollectorRuntimeBuilder => (TaskRuntimeBuilder => (TaskBucket => (SpecificSideEffectHandler => (Defaults => {
|
|
24
|
+
let make = (queryBucketName, scheduler, schedulerRoleUrn, publishToAggregates, queryEngine, resourceNaming, allAggregates, runtime, opts) => Component$ReventlessCore.make(ComponentType$ReventlessCore.toString(Task$ReventlessCore.componentType), Spec.name, (extra, extra$1) => {
|
|
24
25
|
let opts_parent = Component$ReventlessCore.toPulumiResource(extra);
|
|
25
26
|
let opts = {
|
|
26
27
|
parent: opts_parent
|
|
27
28
|
};
|
|
29
|
+
let memorySize = RuntimeHints$ReventlessInfra.resolveMemory(runtime, Defaults.memorySize);
|
|
30
|
+
let timeout = RuntimeHints$ReventlessInfra.resolveTimeout(runtime, Defaults.timeout);
|
|
28
31
|
let allCommandTopics = Aggregate$ReventlessCore.allCommandTopics(allAggregates);
|
|
29
32
|
let publishToAggregatesQueueUrls = Stdlib_Dict.mapValues(allAggregates, agg => Output$Pulumi.flatMap(agg.commandTopic, ct => {
|
|
30
33
|
let r = ct.resources[0];
|
|
@@ -86,7 +89,7 @@ function Make(Spec) {
|
|
|
86
89
|
let opts$1 = {
|
|
87
90
|
parent: opts_parent
|
|
88
91
|
};
|
|
89
|
-
Stdlib_Option.forEach(bucketSpec.callback, callback => TaskRuntimeBuilder.forBucketCallback(createHandler(sideEffectHandler, callback), none => TaskBucket.connect(name, bucket, bucketSpec.bucketMode, allCommandTopics, none, opts$1),
|
|
92
|
+
Stdlib_Option.forEach(bucketSpec.callback, callback => TaskRuntimeBuilder.forBucketCallback(createHandler(sideEffectHandler, callback), none => TaskBucket.connect(name, bucket, bucketSpec.bucketMode, allCommandTopics, none, opts$1), memorySize, timeout, bucketStem, Spec.moduleUrl, publishToAggregatesQueueUrls, schedulerConfig, extra));
|
|
90
93
|
return [
|
|
91
94
|
bucketName,
|
|
92
95
|
bucket.resources[0].id
|
|
@@ -104,7 +107,7 @@ function Make(Spec) {
|
|
|
104
107
|
make: make,
|
|
105
108
|
outputs: Component$ReventlessCore.outputs
|
|
106
109
|
};
|
|
107
|
-
})))));
|
|
110
|
+
}))))));
|
|
108
111
|
}
|
|
109
112
|
|
|
110
113
|
export {
|
|
@@ -24,6 +24,11 @@ module type T = {
|
|
|
24
24
|
~outboundTranslationSlices: array<module(ReventlessInfra.OutboundTranslationSlice.T)>=?,
|
|
25
25
|
~inboundTranslationSlices: array<module(ReventlessInfra.InboundTranslationSlice.T)>=?,
|
|
26
26
|
~systemCallableComponents: array<string>=?,
|
|
27
|
+
/** Per-component runtime resource hints keyed by component name (plugin.json
|
|
28
|
+
`runtime` block). Looked up per component by `Spec.name` and forwarded into
|
|
29
|
+
the component's `make`. See
|
|
30
|
+
docs/plans/configurable-component-runtime-resources.md. */
|
|
31
|
+
~componentRuntime: dict<ReventlessInfra.RuntimeHints.t>=?,
|
|
27
32
|
~uiFragments: Reventless.Plugin.uiFragmentManifest=?,
|
|
28
33
|
~pluginStructure: Reventless.Plugin.pluginStructure=?,
|
|
29
34
|
~opts: Pulumi.ComponentResource.options=?,
|