Skip to content

Add support for binding to Unix sockets#7108

Open
robinkar wants to merge 1 commit into
tensorflow:masterfrom
robinkar:feat/unix-socket-support
Open

Add support for binding to Unix sockets#7108
robinkar wants to merge 1 commit into
tensorflow:masterfrom
robinkar:feat/unix-socket-support

Conversation

@robinkar
Copy link
Copy Markdown

@robinkar robinkar commented May 20, 2026

Fixes #6057.

Adds the possibility of passing a path to a Unix socket as the host parameter, --host unix:///path/to/tensorboard.sock, to bind TensorBoard to a Unix socket.

Motivation for features / changes

This will allow running TensorBoard securely in multi-user hosts, e.g. on HPC clusters as in my case.

Technical description of changes

As Werkzeug supports listening on Unix sockets, this mostly affects the command-line argument handling to allow passing the Unix socket path to Werkzeug.

Detailed steps to verify changes work correctly

This is easiest to test using caddy:

#!/bin/bash
socket=$(mktemp -d)/tb.sock
# Assuming the scalars_demo files have been generated already.
bazel run //tensorboard -- --logdir /tmp/scalars_demo --host unix://$socket &
caddy reverse-proxy --from :8080 --to=unix/$socket

TensorBoard should then print something like:

TensorBoard 2.21.0a0 at unix:///tmp/tmp.7e0ou10PTk/tb.sock/ (Press CTRL+C to quit)

And http://localhost:8080 should work as expected.

Add the possibility of passing a path to a Unix socket as unix://<path>
in the --host parameter to allow running TensorBoard securely on
multi-user hosts.
@boegel
Copy link
Copy Markdown

boegel commented May 26, 2026

Very much +1 on this, would be great to have this reviewed/merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support binding to a Unix domain socket

2 participants