Skip to content

Commit 757f15a

Browse files
committed
uploader: enable handshake by default (#2958)
Summary: We’ve deployed production servers that support the handshake protocol specified in #2878 and implemented on the client in #2879. This commit enables that protocol by default. Test Plan: Running `bazel run //tensorboard -- dev list` still properly connects and prints valid URLs. Re-running with the TensorBoard version patched to `2.0.0a0` (in `version/version.py`) properly causes a handshake failure. Setting `--origin` to point to a non-prod frontend properly connects to the appropriate backend. Setting `--api_endpoint` to point to a non-prod backend connects directly, skipping the handshake, and printing `https://tensorboard.dev` URLs. Specifying both `--origin` and `--api_endpoint` performs the handshake and overrides the backend server only, printing URLs corresponding to the listed frontend. Running `git grep api.tensorboard.dev` no longer finds any code results. As a double check, building the Pip package and running it in a new virtualenv still has a working `tensorboard dev upload` flow. wchargin-branch: uploader-handshake
1 parent bb71c7c commit 757f15a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tensorboard/uploader/uploader_main.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@
6868
_AUTH_SUBCOMMAND_KEY_REVOKE = 'REVOKE'
6969

7070
_DEFAULT_ORIGIN = "https://tensorboard.dev"
71-
# Compatibility measure until server-side /api/uploader support is
72-
# rolled out and stable.
73-
_HARDCODED_API_ENDPOINT = "api.tensorboard.dev:443"
7471

7572

7673
def _prompt_for_user_ack(intent):
@@ -506,10 +503,8 @@ def _get_intent(flags):
506503

507504
def _get_server_info(flags):
508505
origin = flags.origin or _DEFAULT_ORIGIN
509-
if not flags.origin:
510-
# Temporary fallback to hardcoded API endpoint when not specified.
511-
api_endpoint = flags.api_endpoint or _HARDCODED_API_ENDPOINT
512-
return server_info_lib.create_server_info(origin, api_endpoint)
506+
if flags.api_endpoint and not flags.origin:
507+
return server_info_lib.create_server_info(origin, flags.api_endpoint)
513508
server_info = server_info_lib.fetch_server_info(origin)
514509
# Override with any API server explicitly specified on the command
515510
# line, but only if the server accepted our initial handshake.

0 commit comments

Comments
 (0)