Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
- run: uv sync --all-extras
- run: poe bridge-lint
if: ${{ matrix.clippyLinter }}
- run: poe lint
- run: poe build-develop
- run: poe lint
- run: mkdir junit-xml
- run: poe test ${{matrix.pytestExtraArgs}} -s --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml
timeout-minutes: 15
Expand Down Expand Up @@ -149,8 +149,8 @@ jobs:
- run: uv tool install poethepoet
- run: uv lock --upgrade
- run: uv sync --all-extras
- run: poe lint
- run: poe build-develop
- run: poe lint
- run: mkdir junit-xml
- run: poe test -s --junit-xml=junit-xml/latest-deps.xml
timeout-minutes: 10
Expand Down
132 changes: 96 additions & 36 deletions temporalio/bridge/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions temporalio/bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ crate-type = ["cdylib"]
anyhow = "1.0"
async-trait = "0.1"
futures = "0.3"
prost = "0.13"
prost = "0.14"
pyo3 = { version = "0.25", features = [
"extension-module",
"abi3-py310",
Expand All @@ -38,7 +38,7 @@ temporal-sdk-core-api = { version = "0.1.0", path = "./sdk-core/core-api", featu
temporal-sdk-core-protos = { version = "0.1.0", path = "./sdk-core/sdk-core-protos" }
tokio = "1.26"
tokio-stream = "0.1"
tonic = "0.13"
tonic = "0.14"
tracing = "0.1"
url = "2.2"

Expand Down
12 changes: 10 additions & 2 deletions temporalio/bridge/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def _raise_in_thread(thread_id: int, exc_type: Type[BaseException]) -> bool:
thread_id, exc_type
)

def __init__(self, *, telemetry: TelemetryConfig) -> None:
def __init__(self, *, options: RuntimeOptions) -> None:
"""Create SDK Core runtime."""
self._ref = temporalio.bridge.temporal_sdk_bridge.init_runtime(telemetry)
self._ref = temporalio.bridge.temporal_sdk_bridge.init_runtime(options)

def retrieve_buffered_metrics(self, durations_as_seconds: bool) -> Sequence[Any]:
"""Get buffered metrics."""
Expand Down Expand Up @@ -91,6 +91,14 @@ class TelemetryConfig:
metrics: Optional[MetricsConfig]


@dataclass(frozen=True)
class RuntimeOptions:
"""Python representation of the Rust struct for runtime options."""

telemetry: TelemetryConfig
worker_heartbeat_interval_millis: Optional[int] = 30_000 # 30s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want the defaults defined by each language, or does this make more sense to take optionally into core and default there? Since this is optional but with a default number, does that mean overriding with None disables heartbeating?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah specifying None here disables heartbeating. so I think we need the default to be passed down to lang as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative would be a nested optional or some form of enum, but I accept this is the easiest route.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait why is this 30? Isn't our default 60?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 it is.. thanks for catching



# WARNING: This must match Rust runtime::BufferedLogEntry
class BufferedLogEntry(Protocol):
"""A buffered log entry."""
Expand Down
2 changes: 1 addition & 1 deletion temporalio/bridge/sdk-core
Submodule sdk-core updated 88 files
+1 −1 .cargo/config.toml
+1 −0 .clippy.toml
+2 −0 .github/workflows/heavy.yml
+10 −10 .github/workflows/per-pr.yml
+9 −5 Cargo.toml
+4 −0 README.md
+1 −0 client/Cargo.toml
+257 −259 client/src/lib.rs
+28 −5 client/src/metrics.rs
+618 −257 client/src/raw.rs
+522 −131 client/src/worker_registry/mod.rs
+19 −15 client/src/workflow_handle/mod.rs
+1 −0 core-api/Cargo.toml
+9 −0 core-api/src/lib.rs
+13 −0 core-api/src/telemetry.rs
+449 −51 core-api/src/telemetry/metrics.rs
+16 −7 core-api/src/worker.rs
+2 −1 core-c-bridge/Cargo.toml
+115 −24 core-c-bridge/include/temporal-sdk-core-c-bridge.h
+447 −172 core-c-bridge/src/client.rs
+18 −3 core-c-bridge/src/runtime.rs
+1 −0 core-c-bridge/src/tests/context.rs
+13 −13 core-c-bridge/src/tests/mod.rs
+234 −59 core-c-bridge/src/worker.rs
+3 −3 core/Cargo.toml
+43 −0 core/src/abstractions.rs
+5 −4 core/src/core_tests/activity_tasks.rs
+2 −2 core/src/core_tests/updates.rs
+3 −3 core/src/core_tests/workers.rs
+2 −1 core/src/core_tests/workflow_tasks.rs
+1 −0 core/src/internal_flags.rs
+65 −40 core/src/lib.rs
+41 −8 core/src/pollers/poll_buffer.rs
+4 −11 core/src/protosext/protocol_messages.rs
+1 −1 core/src/replay/mod.rs
+69 −24 core/src/telemetry/metrics.rs
+9 −2 core/src/telemetry/mod.rs
+1 −0 core/src/telemetry/prometheus_meter.rs
+6 −7 core/src/test_help/integ_helpers.rs
+12 −1 core/src/worker/activities.rs
+42 −6 core/src/worker/activities/activity_heartbeat_manager.rs
+1 −1 core/src/worker/activities/local_activities.rs
+195 −88 core/src/worker/client.rs
+25 −12 core/src/worker/client/mocks.rs
+130 −157 core/src/worker/heartbeat.rs
+436 −62 core/src/worker/mod.rs
+15 −7 core/src/worker/slot_provider.rs
+18 −1 core/src/worker/tuner.rs
+4 −0 core/src/worker/tuner/fixed_size.rs
+80 −39 core/src/worker/tuner/resource_based.rs
+9 −2 core/src/worker/workflow/machines/patch_state_machine.rs
+4 −4 core/src/worker/workflow/mod.rs
+7 −0 core/src/worker/workflow/wft_poller.rs
+8 −3 core/src/worker/workflow/workflow_stream.rs
+5 −5 fsm/rustfsm_procmacro/tests/trybuild/dupe_transitions_fail.stderr
+4 −5 sdk-core-protos/Cargo.toml
+10 −23 sdk-core-protos/build.rs
+9 −1 sdk-core-protos/protos/api_upstream/.github/workflows/create-release.yml
+254 −5 sdk-core-protos/protos/api_upstream/openapi/openapiv2.json
+234 −5 sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml
+1 −1 sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto
+6 −0 sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto
+6 −2 sdk-core-protos/protos/api_upstream/temporal/api/namespace/v1/message.proto
+60 −2 sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto
+30 −6 sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto
+1 −1 sdk-core-protos/src/history_builder.rs
+5 −6 sdk-core-protos/src/lib.rs
+2 −5 sdk-core-protos/src/utilities.rs
+8 −2 sdk/Cargo.toml
+5 −4 sdk/src/lib.rs
+35 −16 tests/common/mod.rs
+10 −11 tests/global_metric_tests.rs
+2 −1 tests/heavy_tests.rs
+23 −14 tests/integ_tests/client_tests.rs
+9 −5 tests/integ_tests/ephemeral_server_tests.rs
+123 −23 tests/integ_tests/metrics_tests.rs
+10 −4 tests/integ_tests/polling_tests.rs
+3 −1 tests/integ_tests/update_tests.rs
+1,050 −0 tests/integ_tests/worker_heartbeat_tests.rs
+296 −8 tests/integ_tests/worker_tests.rs
+35 −22 tests/integ_tests/worker_versioning_tests.rs
+2 −2 tests/integ_tests/workflow_tests.rs
+82 −2 tests/integ_tests/workflow_tests/activities.rs
+10 −2 tests/integ_tests/workflow_tests/patches.rs
+28 −21 tests/integ_tests/workflow_tests/resets.rs
+25 −15 tests/main.rs
+4 −3 tests/manual_tests.rs
+4 −2 tests/workflow_replay_bench.rs
Loading
Loading