@temporalio/core-bridge 1.8.5 → 1.9.0-rc.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/Cargo.lock +189 -152
- package/Cargo.toml +1 -0
- package/lib/index.d.ts +17 -44
- package/lib/index.js.map +1 -1
- package/package.json +3 -4
- package/releases/aarch64-apple-darwin/index.node +0 -0
- package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
- package/releases/x86_64-apple-darwin/index.node +0 -0
- package/releases/x86_64-pc-windows-msvc/index.node +0 -0
- package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
- package/sdk-core/.github/workflows/heavy.yml +4 -0
- package/sdk-core/.github/workflows/per-pr.yml +96 -0
- package/sdk-core/ARCHITECTURE.md +1 -1
- package/sdk-core/Cargo.toml +6 -0
- package/sdk-core/README.md +37 -21
- package/sdk-core/client/Cargo.toml +6 -3
- package/sdk-core/client/src/lib.rs +272 -138
- package/sdk-core/client/src/metrics.rs +68 -57
- package/sdk-core/client/src/raw.rs +191 -45
- package/sdk-core/client/src/retry.rs +20 -0
- package/sdk-core/client/src/worker_registry/mod.rs +264 -0
- package/sdk-core/client/src/workflow_handle/mod.rs +2 -1
- package/sdk-core/core/Cargo.toml +16 -18
- package/sdk-core/core/src/core_tests/child_workflows.rs +7 -7
- package/sdk-core/core/src/core_tests/mod.rs +1 -0
- package/sdk-core/core/src/core_tests/replay_flag.rs +29 -39
- package/sdk-core/core/src/core_tests/updates.rs +73 -0
- package/sdk-core/core/src/core_tests/workflow_tasks.rs +52 -1
- package/sdk-core/core/src/ephemeral_server/mod.rs +34 -11
- package/sdk-core/core/src/internal_flags.rs +7 -1
- package/sdk-core/core/src/lib.rs +19 -36
- package/sdk-core/core/src/protosext/mod.rs +11 -3
- package/sdk-core/core/src/protosext/protocol_messages.rs +102 -0
- package/sdk-core/core/src/replay/mod.rs +100 -48
- package/sdk-core/core/src/telemetry/log_export.rs +161 -28
- package/sdk-core/core/src/telemetry/metrics.rs +869 -248
- package/sdk-core/core/src/telemetry/mod.rs +135 -239
- package/sdk-core/core/src/telemetry/prometheus_server.rs +36 -31
- package/sdk-core/core/src/test_help/mod.rs +63 -4
- package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +12 -2
- package/sdk-core/core/src/worker/activities.rs +276 -10
- package/sdk-core/core/src/worker/client/mocks.rs +18 -0
- package/sdk-core/core/src/worker/client.rs +16 -3
- package/sdk-core/core/src/worker/mod.rs +50 -19
- package/sdk-core/core/src/worker/slot_provider.rs +175 -0
- package/sdk-core/core/src/worker/workflow/driven_workflow.rs +27 -34
- package/sdk-core/core/src/worker/workflow/history_update.rs +4 -1
- package/sdk-core/core/src/worker/workflow/machines/activity_state_machine.rs +36 -94
- package/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +34 -22
- package/sdk-core/core/src/worker/workflow/machines/cancel_workflow_state_machine.rs +50 -34
- package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +106 -92
- package/sdk-core/core/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +22 -21
- package/sdk-core/core/src/worker/workflow/machines/local_activity_state_machine.rs +386 -499
- package/sdk-core/core/src/worker/workflow/machines/mod.rs +12 -2
- package/sdk-core/core/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +33 -26
- package/sdk-core/core/src/worker/workflow/machines/patch_state_machine.rs +198 -215
- package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +66 -62
- package/sdk-core/core/src/worker/workflow/machines/timer_state_machine.rs +88 -119
- package/sdk-core/core/src/worker/workflow/machines/transition_coverage.rs +3 -1
- package/sdk-core/core/src/worker/workflow/machines/update_state_machine.rs +411 -0
- package/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +26 -25
- package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +302 -85
- package/sdk-core/core/src/worker/workflow/managed_run.rs +179 -132
- package/sdk-core/core/src/worker/workflow/mod.rs +121 -46
- package/sdk-core/core/src/worker/workflow/run_cache.rs +8 -12
- package/sdk-core/core/src/worker/workflow/workflow_stream.rs +45 -38
- package/sdk-core/core-api/Cargo.toml +7 -6
- package/sdk-core/core-api/src/lib.rs +4 -12
- package/sdk-core/core-api/src/telemetry/metrics.rs +334 -0
- package/sdk-core/core-api/src/telemetry.rs +53 -42
- package/sdk-core/core-api/src/worker.rs +7 -0
- package/sdk-core/{.buildkite/docker → docker}/docker-compose.yaml +1 -1
- package/sdk-core/etc/dynamic-config.yaml +11 -1
- package/sdk-core/fsm/rustfsm_procmacro/Cargo.toml +1 -1
- package/sdk-core/fsm/rustfsm_procmacro/src/lib.rs +1 -3
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/no_handle_conversions_require_into_fail.stderr +2 -2
- package/sdk-core/sdk/Cargo.toml +1 -1
- package/sdk-core/sdk/src/lib.rs +85 -7
- package/sdk-core/sdk/src/workflow_context/options.rs +4 -0
- package/sdk-core/sdk/src/workflow_context.rs +43 -15
- package/sdk-core/sdk/src/workflow_future.rs +334 -204
- package/sdk-core/sdk-core-protos/Cargo.toml +2 -2
- package/sdk-core/sdk-core-protos/build.rs +14 -14
- package/sdk-core/sdk-core-protos/protos/api_upstream/.buildkite/Dockerfile +2 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/Makefile +99 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/api-linter.yaml +56 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/buf.gen.yaml +20 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/buf.lock +11 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/buf.yaml +18 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/google/api/annotations.proto +31 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/google/api/http.proto +379 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/any.proto +162 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/descriptor.proto +1212 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/duration.proto +115 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/empty.proto +51 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/timestamp.proto +144 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/wrappers.proto +123 -0
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/batch/v1/message.proto +3 -5
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/command/v1/message.proto +11 -13
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/common/v1/message.proto +2 -4
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/failed_cause.proto +2 -0
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/reset.proto +1 -1
- package/sdk-core/{protos/api_upstream/build/tools.go → sdk-core-protos/protos/api_upstream/temporal/api/export/v1/message.proto} +22 -6
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/filter/v1/message.proto +2 -4
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/history/v1/message.proto +21 -23
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/namespace/v1/message.proto +2 -4
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/operatorservice/v1/request_response.proto +2 -0
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/operatorservice/v1/service.proto +4 -0
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/replication/v1/message.proto +1 -3
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/schedule/v1/message.proto +36 -20
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +13 -0
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/taskqueue/v1/message.proto +2 -4
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/update/v1/message.proto +1 -1
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/version/v1/message.proto +2 -3
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/workflow/v1/message.proto +18 -20
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/workflowservice/v1/request_response.proto +84 -32
- package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/workflowservice/v1/service.proto +205 -47
- package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +57 -0
- package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +27 -0
- package/sdk-core/sdk-core-protos/src/history_builder.rs +67 -2
- package/sdk-core/sdk-core-protos/src/lib.rs +75 -2
- package/sdk-core/sdk-core-protos/src/utilities.rs +14 -0
- package/sdk-core/test-utils/Cargo.toml +5 -1
- package/sdk-core/test-utils/src/canned_histories.rs +3 -57
- package/sdk-core/test-utils/src/interceptors.rs +46 -0
- package/sdk-core/test-utils/src/lib.rs +106 -38
- package/sdk-core/tests/integ_tests/metrics_tests.rs +110 -15
- package/sdk-core/tests/integ_tests/queries_tests.rs +174 -3
- package/sdk-core/tests/integ_tests/update_tests.rs +908 -0
- package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +44 -1
- package/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +1 -1
- package/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +1 -1
- package/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +4 -4
- package/sdk-core/tests/integ_tests/workflow_tests/eager.rs +61 -0
- package/sdk-core/tests/integ_tests/workflow_tests/replay.rs +27 -2
- package/sdk-core/tests/integ_tests/workflow_tests.rs +1 -0
- package/sdk-core/tests/main.rs +2 -1
- package/sdk-core/tests/runner.rs +15 -2
- package/src/conversions.rs +75 -89
- package/src/helpers.rs +74 -0
- package/src/runtime.rs +17 -6
- package/src/worker.rs +14 -61
- package/ts/index.ts +21 -52
- package/sdk-core/.buildkite/docker/Dockerfile +0 -9
- package/sdk-core/.buildkite/docker/build.sh +0 -5
- package/sdk-core/.buildkite/docker/docker-compose-ci.yaml +0 -27
- package/sdk-core/.buildkite/pipeline.yml +0 -57
- package/sdk-core/.github/workflows/semgrep.yml +0 -25
- package/sdk-core/core/src/worker/workflow/bridge.rs +0 -35
- package/sdk-core/core/src/worker/workflow/managed_run/managed_wf_test.rs +0 -215
- package/sdk-core/protos/api_upstream/.buildkite/Dockerfile +0 -2
- package/sdk-core/protos/api_upstream/Makefile +0 -80
- package/sdk-core/protos/api_upstream/api-linter.yaml +0 -40
- package/sdk-core/protos/api_upstream/buf.yaml +0 -9
- package/sdk-core/protos/api_upstream/build/go.mod +0 -7
- package/sdk-core/protos/api_upstream/build/go.sum +0 -5
- package/sdk-core/protos/api_upstream/go.mod +0 -6
- package/sdk-core/protos/testsrv_upstream/dependencies/gogoproto/gogo.proto +0 -141
- /package/sdk-core/{.buildkite/docker → docker}/docker-compose-telem.yaml +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.buildkite/docker-compose.yml +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.buildkite/pipeline.yml +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/CODEOWNERS +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/workflows/publish-docs.yml +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/workflows/trigger-api-go-update.yml +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/LICENSE +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/README.md +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/batch_operation.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/command_type.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/common.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/event_type.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/namespace.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/query.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/schedule.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/task_queue.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/update.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/workflow.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/errordetails/v1/message.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/failure/v1/message.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/protocol/v1/message.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/query/v1/message.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/google/rpc/status.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/grpc/health/v1/health.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/activity_result/activity_result.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/activity_task/activity_task.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/child_workflow/child_workflow.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/common/common.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/core_interface.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/external_data/external_data.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/Makefile +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/api-linter.yaml +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/buf.yaml +0 -0
- /package/sdk-core/{protos/api_upstream → sdk-core-protos/protos/testsrv_upstream}/dependencies/gogoproto/gogo.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/temporal/api/testservice/v1/request_response.proto +0 -0
- /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/temporal/api/testservice/v1/service.proto +0 -0
package/Cargo.toml
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SpanContext } from '@opentelemetry/api';
|
|
2
1
|
import { LogLevel, Duration } from '@temporalio/common';
|
|
3
2
|
import type { TLSConfig } from '@temporalio/common/lib/internal-non-workflow';
|
|
4
3
|
export { TLSConfig };
|
|
@@ -103,12 +102,6 @@ export interface OtelCollectorExporter {
|
|
|
103
102
|
};
|
|
104
103
|
}
|
|
105
104
|
/** @experimental */
|
|
106
|
-
export type CompiledOtelTraceExporter = Shadow<OtelCollectorExporter, {
|
|
107
|
-
otel: {
|
|
108
|
-
metricsExportInterval?: never;
|
|
109
|
-
};
|
|
110
|
-
}>;
|
|
111
|
-
/** @experimental */
|
|
112
105
|
export type CompiledOtelMetricsExporter = Shadow<OtelCollectorExporter, {
|
|
113
106
|
otel: {
|
|
114
107
|
metricsExportInterval: number;
|
|
@@ -142,12 +135,6 @@ export interface PrometheusMetricsExporter {
|
|
|
142
135
|
export type MetricsExporter = {
|
|
143
136
|
temporality?: 'cumulative' | 'delta';
|
|
144
137
|
} & (PrometheusMetricsExporter | OtelCollectorExporter);
|
|
145
|
-
/**
|
|
146
|
-
* Trace exporters supported by Core
|
|
147
|
-
*
|
|
148
|
-
* @experimental
|
|
149
|
-
*/
|
|
150
|
-
export type TraceExporter = OtelCollectorExporter;
|
|
151
138
|
/** @experimental */
|
|
152
139
|
export interface TelemetryOptions {
|
|
153
140
|
/**
|
|
@@ -156,7 +143,7 @@ export interface TelemetryOptions {
|
|
|
156
143
|
*
|
|
157
144
|
* Which determines what tracing data is collected in the Core SDK.
|
|
158
145
|
*
|
|
159
|
-
* @deprecated Use
|
|
146
|
+
* @deprecated Use `logging.filter` instead
|
|
160
147
|
*/
|
|
161
148
|
tracingFilter?: string;
|
|
162
149
|
/**
|
|
@@ -188,35 +175,16 @@ export interface TelemetryOptions {
|
|
|
188
175
|
*/
|
|
189
176
|
filter?: string;
|
|
190
177
|
} & Partial<Logger>;
|
|
191
|
-
/**
|
|
192
|
-
* Control where to send traces generated by Rust Core, optional and turned off by default.
|
|
193
|
-
*
|
|
194
|
-
* This is typically used for profiling SDK internals.
|
|
195
|
-
*/
|
|
196
|
-
tracing?: {
|
|
197
|
-
/**
|
|
198
|
-
* A string in (env filter format)[https://docs.rs/tracing-subscriber/0.2.20/tracing_subscriber/struct.EnvFilter.html]
|
|
199
|
-
* which determines what tracing data is collected in the Core SDK.
|
|
200
|
-
*
|
|
201
|
-
* You can use {@link Runtime.makeTelemetryFilterString()} to easily build a correctly formatted filter
|
|
202
|
-
* string based on desired log level for Core SDK and other native packages.
|
|
203
|
-
*
|
|
204
|
-
* **BACKWARD COMPATIBILITY**
|
|
205
|
-
*
|
|
206
|
-
* If `tracing.filter` is missing, the following legacy values (if present) will be used instead (in the given order):
|
|
207
|
-
* - {@link TelemetryOptions.tracingFilter}
|
|
208
|
-
* - Default value of `makeTelemetryFilterString({ core: 'INFO', other: 'INFO'})`
|
|
209
|
-
*
|
|
210
|
-
* @default `makeTelemetryFilterString({ core: 'INFO', other: 'INFO'})` (with some exceptions, as described in backward compatibility note above)
|
|
211
|
-
*/
|
|
212
|
-
filter?: string;
|
|
213
|
-
} & Partial<TraceExporter>;
|
|
214
178
|
/**
|
|
215
179
|
* Control exporting {@link NativeConnection} and {@link Worker} metrics.
|
|
216
180
|
*
|
|
217
181
|
* Turned off by default
|
|
218
182
|
*/
|
|
219
183
|
metrics?: MetricsExporter;
|
|
184
|
+
/**
|
|
185
|
+
* @deprecated Core SDK tracing is no longer supported. This option is ignored.
|
|
186
|
+
*/
|
|
187
|
+
tracing?: unknown;
|
|
220
188
|
}
|
|
221
189
|
/** @experimental */
|
|
222
190
|
export type CompiledTelemetryOptions = {
|
|
@@ -228,9 +196,6 @@ export type CompiledTelemetryOptions = {
|
|
|
228
196
|
} | {
|
|
229
197
|
forward: {};
|
|
230
198
|
});
|
|
231
|
-
tracing?: {
|
|
232
|
-
filter: string;
|
|
233
|
-
} & CompiledOtelTraceExporter;
|
|
234
199
|
metrics?: {
|
|
235
200
|
temporality?: 'cumulative' | 'delta';
|
|
236
201
|
} & (PrometheusMetricsExporter | CompiledOtelMetricsExporter);
|
|
@@ -258,6 +223,7 @@ export interface WorkerOptions {
|
|
|
258
223
|
maxConcurrentActivityTaskExecutions: number;
|
|
259
224
|
maxConcurrentWorkflowTaskExecutions: number;
|
|
260
225
|
maxConcurrentLocalActivityExecutions: number;
|
|
226
|
+
nonStickyToStickyPollRatio: number;
|
|
261
227
|
/**
|
|
262
228
|
* Maximum number of Workflow tasks to poll concurrently.
|
|
263
229
|
*/
|
|
@@ -307,6 +273,9 @@ export interface WorkerOptions {
|
|
|
307
273
|
*/
|
|
308
274
|
maxActivitiesPerSecond?: number;
|
|
309
275
|
}
|
|
276
|
+
export type LogEntryMetadata = {
|
|
277
|
+
[key: string]: string | number | boolean | LogEntryMetadata;
|
|
278
|
+
};
|
|
310
279
|
export interface LogEntry {
|
|
311
280
|
/** Log message */
|
|
312
281
|
message: string;
|
|
@@ -318,6 +287,10 @@ export interface LogEntry {
|
|
|
318
287
|
timestamp: [number, number];
|
|
319
288
|
/** Log level */
|
|
320
289
|
level: LogLevel;
|
|
290
|
+
/** Name of the Core subsystem that emitted that log entry */
|
|
291
|
+
target: string;
|
|
292
|
+
/*** Metadata fields */
|
|
293
|
+
fields: LogEntryMetadata;
|
|
321
294
|
}
|
|
322
295
|
/**
|
|
323
296
|
* Which version of the executable to run.
|
|
@@ -446,10 +419,10 @@ export declare function clientUpdateHeaders(client: Client, headers: Record<stri
|
|
|
446
419
|
export declare function clientClose(client: Client): void;
|
|
447
420
|
export declare function runtimeShutdown(runtime: Runtime, callback: VoidCallback): void;
|
|
448
421
|
export declare function pollLogs(runtime: Runtime, callback: LogsCallback): void;
|
|
449
|
-
export declare function workerPollWorkflowActivation(worker: Worker,
|
|
450
|
-
export declare function workerCompleteWorkflowActivation(worker: Worker,
|
|
451
|
-
export declare function workerPollActivityTask(worker: Worker,
|
|
452
|
-
export declare function workerCompleteActivityTask(worker: Worker,
|
|
422
|
+
export declare function workerPollWorkflowActivation(worker: Worker, callback: PollCallback): void;
|
|
423
|
+
export declare function workerCompleteWorkflowActivation(worker: Worker, result: ArrayBuffer, callback: VoidCallback): void;
|
|
424
|
+
export declare function workerPollActivityTask(worker: Worker, callback: PollCallback): void;
|
|
425
|
+
export declare function workerCompleteActivityTask(worker: Worker, result: ArrayBuffer, callback: VoidCallback): void;
|
|
453
426
|
export declare function workerRecordActivityHeartbeat(worker: Worker, heartbeat: ArrayBuffer): void;
|
|
454
427
|
export declare function getTimeOfDay(): [number, number];
|
|
455
428
|
export declare function startEphemeralServer(runtime: Runtime, config: EphemeralServerConfig, sdkVersion: string, callback: Callback<EphemeralServer>): void;
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;AAsfA,mCAA0E;AAAjE,uGAAA,aAAa,OAAA;AAAE,wGAAA,cAAc,OAAA;AAAE,yGAAA,eAAe,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporalio/core-bridge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0-rc.0",
|
|
4
4
|
"description": "Temporal.io SDK Core<>Node bridge",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
"author": "Temporal Technologies Inc. <sdk@temporal.io>",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@temporalio/common": "1.8.5",
|
|
25
|
+
"@temporalio/common": "1.9.0-rc.0",
|
|
27
26
|
"arg": "^5.0.2",
|
|
28
27
|
"cargo-cp-artifact": "^0.1.6",
|
|
29
28
|
"which": "^2.0.2"
|
|
@@ -53,5 +52,5 @@
|
|
|
53
52
|
"publishConfig": {
|
|
54
53
|
"access": "public"
|
|
55
54
|
},
|
|
56
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "ca3e508e62de02b2c9bb40d0d889003cebba282d"
|
|
57
56
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
name: Per merge CI
|
|
2
|
+
|
|
3
|
+
on: # rebuild any PRs and main branch changes
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- master
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build-and-test:
|
|
15
|
+
name: "Format, docs, and lint"
|
|
16
|
+
timeout-minutes: 20
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v2
|
|
20
|
+
with:
|
|
21
|
+
submodules: recursive
|
|
22
|
+
- uses: actions-rs/toolchain@v1
|
|
23
|
+
with:
|
|
24
|
+
profile: minimal
|
|
25
|
+
toolchain: 1.74.0
|
|
26
|
+
override: true
|
|
27
|
+
- name: Install protoc
|
|
28
|
+
uses: arduino/setup-protoc@v1
|
|
29
|
+
with:
|
|
30
|
+
version: '3.x'
|
|
31
|
+
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
32
|
+
- run: rustup component add rustfmt clippy
|
|
33
|
+
- uses: Swatinem/rust-cache@v2
|
|
34
|
+
- uses: actions-rs/cargo@v1
|
|
35
|
+
with:
|
|
36
|
+
command: fmt
|
|
37
|
+
args: --all -- --check
|
|
38
|
+
- uses: actions-rs/cargo@v1
|
|
39
|
+
with:
|
|
40
|
+
command: doc
|
|
41
|
+
args: --workspace --all-features --no-deps
|
|
42
|
+
- uses: actions-rs/cargo@v1
|
|
43
|
+
with:
|
|
44
|
+
command: lint
|
|
45
|
+
- uses: actions-rs/cargo@v1
|
|
46
|
+
with:
|
|
47
|
+
command: test-lint
|
|
48
|
+
|
|
49
|
+
test:
|
|
50
|
+
name: Unit Tests
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v2
|
|
54
|
+
- uses: actions-rs/toolchain@v1
|
|
55
|
+
with:
|
|
56
|
+
profile: minimal
|
|
57
|
+
toolchain: 1.74.0
|
|
58
|
+
override: true
|
|
59
|
+
- name: Install protoc
|
|
60
|
+
uses: arduino/setup-protoc@v1
|
|
61
|
+
with:
|
|
62
|
+
version: '3.x'
|
|
63
|
+
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
64
|
+
- uses: Swatinem/rust-cache@v2
|
|
65
|
+
- uses: actions-rs/cargo@v1
|
|
66
|
+
with:
|
|
67
|
+
command: test
|
|
68
|
+
args: -- --include-ignored
|
|
69
|
+
- uses: actions/upload-artifact@v3
|
|
70
|
+
with:
|
|
71
|
+
name: coverage-report
|
|
72
|
+
path: tarpaulin-report.html
|
|
73
|
+
- uses: actions/upload-artifact@v3
|
|
74
|
+
with:
|
|
75
|
+
name: state-machine-coverage
|
|
76
|
+
path: machine_coverage/
|
|
77
|
+
|
|
78
|
+
fmt:
|
|
79
|
+
name: Integ tests
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
steps:
|
|
82
|
+
- uses: actions/checkout@v2
|
|
83
|
+
- uses: actions-rs/toolchain@v1
|
|
84
|
+
with:
|
|
85
|
+
profile: minimal
|
|
86
|
+
toolchain: 1.74.0
|
|
87
|
+
override: true
|
|
88
|
+
- name: Install protoc
|
|
89
|
+
uses: arduino/setup-protoc@v1
|
|
90
|
+
with:
|
|
91
|
+
version: '3.x'
|
|
92
|
+
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
93
|
+
- uses: Swatinem/rust-cache@v2
|
|
94
|
+
- uses: actions-rs/cargo@v1
|
|
95
|
+
with:
|
|
96
|
+
command: integ-test
|
package/sdk-core/ARCHITECTURE.md
CHANGED
|
@@ -66,7 +66,7 @@ async fn hello_activity(name: &str) -> String {
|
|
|
66
66
|
|
|
67
67
|
We define the interface between the core and lang SDKs in terms of gRPC service definitions. The actual implementations of this "service" are not generated by gRPC generators, but the messages themselves are, and make it easier to hit the ground running in new languages.
|
|
68
68
|
|
|
69
|
-
See the latest API definition [here](https://github.com/temporalio/sdk-core/tree/master/protos/local/temporal/sdk/core)
|
|
69
|
+
See the latest API definition [here](https://github.com/temporalio/sdk-core/tree/master/sdk-core-protos/protos/local/temporal/sdk/core)
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
## Other topics
|
package/sdk-core/Cargo.toml
CHANGED
package/sdk-core/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
[](https://buildkite.com/temporal/core-sdk?branch=master)
|
|
2
2
|
|
|
3
|
+
# Temporal Core SDK
|
|
4
|
+
|
|
3
5
|
Core SDK that can be used as a base for other Temporal SDKs. It is currently used as the base of:
|
|
4
6
|
|
|
5
7
|
- [TypeScript SDK](https://github.com/temporalio/sdk-typescript/)
|
|
@@ -7,24 +9,31 @@ Core SDK that can be used as a base for other Temporal SDKs. It is currently use
|
|
|
7
9
|
- [.NET SDK](https://github.com/temporalio/sdk-dotnet/)
|
|
8
10
|
- [Ruby SDK](https://github.com/temporalio/sdk-ruby/)
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
# Documentation
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
Core SDK documentation can be generated with `cargo doc`, output will be placed in the
|
|
15
|
+
`target/doc` directory.
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
[Architecture](ARCHITECTURE.md) doc provides some high-level information about how Core SDK works
|
|
15
18
|
and how language layers interact with it.
|
|
16
19
|
|
|
20
|
+
For the reasoning behind the Core SDK, see blog post:
|
|
21
|
+
|
|
22
|
+
- [Why Rust powers Temporal’s new Core SDK](https://temporal.io/blog/why-rust-powers-core-sdk).
|
|
23
|
+
|
|
17
24
|
# Development
|
|
18
25
|
|
|
19
|
-
You will need the `protoc` protobuf compiler
|
|
26
|
+
You will need the `protoc` [protobuf compiler](https://grpc.io/docs/protoc-installation)
|
|
27
|
+
installed to build Core.
|
|
20
28
|
|
|
21
29
|
This repo is composed of multiple crates:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
|
|
31
|
+
- temporal-sdk-core-protos `./sdk-core-protos` - Holds the generated proto code and extensions
|
|
32
|
+
- temporal-client `./client` - Defines client(s) for interacting with the Temporal gRPC service
|
|
33
|
+
- temporal-sdk-core-api `./core-api` - Defines the API surface exposed by Core
|
|
34
|
+
- temporal-sdk-core `./core` - The Core implementation
|
|
35
|
+
- temporal-sdk `./sdk` - A (currently prototype) Rust SDK built on top of Core. Used for testing.
|
|
36
|
+
- rustfsm `./fsm` - Implements a procedural macro used by core for defining state machines
|
|
28
37
|
(contains subcrates). It is temporal agnostic.
|
|
29
38
|
|
|
30
39
|
Visualized (dev dependencies are in blue):
|
|
@@ -35,25 +44,28 @@ All the following commands are enforced for each pull request:
|
|
|
35
44
|
|
|
36
45
|
## Building and testing
|
|
37
46
|
|
|
38
|
-
You can
|
|
47
|
+
You can build and test the project using cargo:
|
|
39
48
|
`cargo build`
|
|
40
49
|
`cargo test`
|
|
41
50
|
|
|
42
|
-
Run integ tests with `cargo integ-test`.
|
|
43
|
-
|
|
51
|
+
Run integ tests with `cargo integ-test`. By default it will start an ephemeral server. You can also
|
|
52
|
+
use an already-running server by passing `-s external`.
|
|
44
53
|
|
|
45
54
|
Run load tests with `cargo test --features=save_wf_inputs --test heavy_tests`.
|
|
46
55
|
|
|
47
56
|
## Formatting
|
|
57
|
+
|
|
48
58
|
To format all code run:
|
|
49
59
|
`cargo fmt --all`
|
|
50
60
|
|
|
51
61
|
## Linting
|
|
62
|
+
|
|
52
63
|
We are using [clippy](https://github.com/rust-lang/rust-clippy) for linting.
|
|
53
64
|
You can run it using:
|
|
54
65
|
`cargo clippy --all -- -D warnings`
|
|
55
66
|
|
|
56
67
|
## Debugging
|
|
68
|
+
|
|
57
69
|
The crate uses [tracing](https://github.com/tokio-rs/tracing) to help with debugging. To enable
|
|
58
70
|
it for a test, insert the below snippet at the start of the test. By default, tracing data is output
|
|
59
71
|
to stdout in a (reasonably) pretty manner.
|
|
@@ -67,14 +79,14 @@ The passed in options to initialization can be customized to export to an OTel c
|
|
|
67
79
|
To run integ tests with OTel collection on, you can use `integ-with-otel.sh`. You will want to make
|
|
68
80
|
sure you are running the collector via docker, which can be done like so:
|
|
69
81
|
|
|
70
|
-
`docker-compose -f
|
|
82
|
+
`docker-compose -f docker/docker-compose.yaml -f docker/docker-compose-telem.yaml up`
|
|
71
83
|
|
|
72
84
|
If you are working on a language SDK, you are expected to initialize tracing early in your `main`
|
|
73
85
|
equivalent.
|
|
74
86
|
|
|
75
87
|
## Proto files
|
|
76
88
|
|
|
77
|
-
This repo uses a subtree for upstream protobuf files. The path `protos/api_upstream` is a
|
|
89
|
+
This repo uses a subtree for upstream protobuf files. The path `sdk-core-protos/protos/api_upstream` is a
|
|
78
90
|
subtree. To update it, use:
|
|
79
91
|
|
|
80
92
|
`git pull --squash -s subtree ssh://git@github.com/temporalio/api.git master --allow-unrelated-histories`
|
|
@@ -83,17 +95,19 @@ Do not question why this git command is the way it is. It is not our place to in
|
|
|
83
95
|
|
|
84
96
|
The java testserver protos are also pulled from the sdk-java repo, but since we only need a
|
|
85
97
|
subdirectory of that repo, we just copy the files with read-tree:
|
|
98
|
+
|
|
86
99
|
```bash
|
|
87
100
|
# add sdk-java as a remote if you have not already
|
|
88
101
|
git remote add -f -t master --no-tags testsrv-protos git@github.com:temporalio/sdk-java.git
|
|
89
102
|
# delete existing protos
|
|
90
|
-
git rm -rf protos/testsrv_upstream
|
|
103
|
+
git rm -rf sdk-core-protos/protos/testsrv_upstream
|
|
91
104
|
# pull from upstream & commit
|
|
92
|
-
git read-tree --prefix protos/testsrv_upstream -u testsrv-protos/master:temporal-test-server/src/main/proto
|
|
105
|
+
git read-tree --prefix sdk-core-protos/protos/testsrv_upstream -u testsrv-protos/master:temporal-test-server/src/main/proto
|
|
93
106
|
git commit
|
|
94
107
|
```
|
|
95
108
|
|
|
96
109
|
## Fetching Histories
|
|
110
|
+
|
|
97
111
|
Tests which would like to replay stored histories rely on that history being made available in
|
|
98
112
|
binary format. You can fetch histories in that format like so (from a local docker server):
|
|
99
113
|
|
|
@@ -104,16 +118,18 @@ You can change the `TEMPORAL_SERVICE_ADDRESS` env var to fetch from a different
|
|
|
104
118
|
## Style Guidelines
|
|
105
119
|
|
|
106
120
|
### Error handling
|
|
107
|
-
|
|
121
|
+
|
|
122
|
+
Any error which is returned from a public interface should be well-typed, and we use
|
|
108
123
|
[thiserror](https://github.com/dtolnay/thiserror) for that purpose.
|
|
109
124
|
|
|
110
|
-
Errors returned from things only used in testing are free to use
|
|
125
|
+
Errors returned from things only used in testing are free to use
|
|
111
126
|
[anyhow](https://github.com/dtolnay/anyhow) for less verbosity.
|
|
112
127
|
|
|
113
|
-
|
|
114
128
|
# The Rust "SDK"
|
|
129
|
+
|
|
115
130
|
This repo contains a *prototype* Rust sdk in the `sdk/` directory. This SDK should be considered
|
|
116
131
|
pre-alpha in terms of its API surface. Since it's still using Core underneath, it is generally
|
|
117
132
|
functional. We do not currently have any firm plans to productionize this SDK. If you want to write
|
|
118
133
|
workflows and activities in Rust, feel free to use it - but be aware that the API may change at any
|
|
119
|
-
time without warning and we do not provide any support guarantees.
|
|
134
|
+
time without warning and we do not provide any support guarantees.
|
|
135
|
+
|
|
@@ -20,12 +20,13 @@ futures = "0.3"
|
|
|
20
20
|
futures-retry = "0.6.0"
|
|
21
21
|
http = "0.2"
|
|
22
22
|
once_cell = "1.13"
|
|
23
|
-
opentelemetry = {
|
|
23
|
+
opentelemetry = { workspace = true, features = ["metrics"] }
|
|
24
24
|
parking_lot = "0.12"
|
|
25
25
|
prost-types = "0.11"
|
|
26
|
+
slotmap = "1.0"
|
|
26
27
|
thiserror = "1.0"
|
|
27
28
|
tokio = "1.1"
|
|
28
|
-
tonic = {
|
|
29
|
+
tonic = { workspace = true, features = ["tls", "tls-roots"] }
|
|
29
30
|
tower = "0.4"
|
|
30
31
|
tracing = "0.1"
|
|
31
32
|
url = "2.2"
|
|
@@ -33,7 +34,9 @@ uuid = { version = "1.1", features = ["v4"] }
|
|
|
33
34
|
|
|
34
35
|
[dependencies.temporal-sdk-core-protos]
|
|
35
36
|
path = "../sdk-core-protos"
|
|
36
|
-
|
|
37
|
+
|
|
38
|
+
[dependencies.temporal-sdk-core-api]
|
|
39
|
+
path = "../core-api"
|
|
37
40
|
|
|
38
41
|
[dev-dependencies]
|
|
39
42
|
assert_matches = "1"
|