Skip to content

Remove deprecated rr.serve() #9207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 4 additions & 2 deletions docs/content/reference/migration/migration-0-23.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ Either:

The former is subject to (double-precision) floating point precision loss (still microsecond precision for the next century), while the latter is lossless.

## 🐍 Python: removed `rr.log_components()`, `rr.connect()`, and `rr.connect_tcp()`
## 🐍 Python: removed `rr.log_components()`, `rr.connect()`, `rr.connect_tcp()`, and `rr.serve()`

These functions were [deprecated](migration-0-22.md#python-api-changes) in 0.22 and are no longer available.

Calls to `rr.log_components()` API are now superseded by the new partial update API. See the [documentation](../../concepts/latest-at.md#partial-updates) and the [migration instructions](migration-0-22.md#partial-updates).

Calls to `rr.connect()` and `rr.connect_tcp()` must be changed to [`rr.connect_grpc()`](https://ref.rerun.io/docs/python/0.22.1/common/initialization_functions/#rerun.connect_grpc?speculative-link).
Calls to `rr.connect()` and `rr.connect_tcp()` must be changed to [`rr.connect_grpc()`](https://ref.rerun.io/docs/python/0.23.0/common/initialization_functions/#rerun.connect_grpc?speculative-link).

Calls to `rr.serve()` must be changed to [`rr.serve_web()`](https://ref.rerun.io/docs/python/0.23.0/common/initialization_functions/#rerun.serve_web?speculative-link).
1 change: 0 additions & 1 deletion rerun_py/docs/gen_common_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class Section:
"disconnect",
"save",
"send_blueprint",
"serve",
"serve_web",
"spawn",
"memory_recording",
Expand Down
1 change: 0 additions & 1 deletion rerun_py/rerun_sdk/rerun/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@
disconnect as disconnect,
save as save,
send_blueprint as send_blueprint,
serve as serve,
serve_web as serve_web,
spawn as spawn,
stdout as stdout,
Expand Down
70 changes: 0 additions & 70 deletions rerun_py/rerun_sdk/rerun/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import logging
import pathlib
import warnings
from typing import TYPE_CHECKING

import rerun_bindings as bindings
from typing_extensions import deprecated # type: ignore[misc, unused-ignore]

from rerun.blueprint.api import BlueprintLike, create_in_memory_blueprint

Expand Down Expand Up @@ -213,74 +211,6 @@ def disconnect(recording: RecordingStream | None = None) -> None:
)


@deprecated(
"""Please migrate to `rr.serve_web(…)`.
See: https://www.rerun.io/docs/reference/migration/migration-0-20 for more details.""",
)
def serve(
*,
open_browser: bool = True,
web_port: int | None = None,
grpc_port: int | None = None,
default_blueprint: BlueprintLike | None = None,
recording: RecordingStream | None = None,
server_memory_limit: str = "25%",
) -> None:
"""
Serve log-data over WebSockets and serve a Rerun web viewer over HTTP.

!!! Warning "Deprecated"
Please migrate to [rerun.serve_web][].
See [the migration guide](https://www.rerun.io/docs/reference/migration/migration-0-20) for more details.

You can also connect to this server with the native viewer using `rerun localhost:9090`.

The WebSocket server will buffer all log data in memory so that late connecting viewers will get all the data.
You can limit the amount of data buffered by the WebSocket server with the `server_memory_limit` argument.
Once reached, the earliest logged data will be dropped.
Note that this means that static data may be dropped if logged early (see <https://github.com/rerun-io/rerun/issues/5531>).

This function returns immediately.

Parameters
----------
open_browser:
Open the default browser to the viewer.
web_port:
The port to serve the web viewer on (defaults to 9090).
grpc_port:
The port to serve the gRPC server on (defaults to 9876)
default_blueprint:
Optionally set a default blueprint to use for this application. If the application
already has an active blueprint, the new blueprint won't become active until the user
clicks the "reset blueprint" button. If you want to activate the new blueprint
immediately, instead use the [`rerun.send_blueprint`][] API.
recording:
Specifies the [`rerun.RecordingStream`][] to use.
If left unspecified, defaults to the current active data recording, if there is one.
See also: [`rerun.init`][], [`rerun.set_global_data_recording`][].
server_memory_limit:
Maximum amount of memory to use for buffering log data for clients that connect late.
This can be a percentage of the total ram (e.g. "50%") or an absolute value (e.g. "4GB").

"""

warnings.warn(
message=("`serve` is deprecated. Use `serve_web` instead."),
category=DeprecationWarning,
stacklevel=2,
)

return serve_web(
open_browser=open_browser,
web_port=web_port,
grpc_port=grpc_port,
default_blueprint=default_blueprint,
recording=recording, # NOLINT
server_memory_limit=server_memory_limit,
)


def serve_web(
*,
open_browser: bool = True,
Expand Down
Loading