Skip to content

Attribute remote SSH session WSFS activity via command origin#5774

Merged
anton-107 merged 1 commit into
mainfrom
sbauersfeld-remote-ssh-command-origin
Jun 30, 2026
Merged

Attribute remote SSH session WSFS activity via command origin#5774
anton-107 merged 1 commit into
mainfrom
sbauersfeld-remote-ssh-command-origin

Conversation

@anton-107

Copy link
Copy Markdown
Contributor

Re-home of #5728 (fork PR by @sbauersfeld) onto an in-repo branch so CI can run with OIDC/JFrog access — fork pull_request runs can't obtain an OIDC token, so the required test-result and validate-generated checks fail at the setup-jfrog step and the PR can never enter the merge queue. The change and authorship are unchanged (Scott is the commit author).

Changes

The SSH server bootstrap notebook (experimental/ssh/internal/client/ssh-server-bootstrap.py) writes RemoteSshServer to /Workspace/.proc/self/metadata/command_origin just before launching the SSH server.

Why

The bootstrap runs as a notebook job on the cluster, so without this, all workspace-file (WSFS) activity from a remote SSH session is attributed to the generic PythonDriver command origin. WSFS resolves each request to its leaf-most registered ancestor, so the SSH server subprocess and the shells it spawns inherit this origin, making that activity attributable in WSFS logs.

Pairs with

WsfsOperation.CommandOrigin enum value COMMAND_ORIGIN_REMOTE_SSH_SERVER added in databricks-eng/universe#2127479.

Tests

  • experimental/ssh/... unit tests and TestAccept/ssh acceptance pass locally on this change merged onto main.
  • The .proc/.../command_origin write path is exercised server-side by the WSFS TestMetadataCommandOrigin unit test.

Closes #5728

Co-authored-by: Scott Bauersfeld scott.bauersfeld@databricks.com

The SSH server bootstrap notebook writes "RemoteSshServer" to
/Workspace/.proc/self/metadata/command_origin so workspace-file activity
from a remote SSH session is attributed to its own WSFS command origin
instead of "PythonDriver". WSFS resolves each request to its leaf-most
registered ancestor, so the SSH server subprocess and the shells it spawns
inherit this origin. Best-effort: never blocks server startup if .proc is
unavailable.

Pairs with the WsfsOperation.CommandOrigin enum value
COMMAND_ORIGIN_REMOTE_SSH_SERVER added in databricks-eng/universe.

Re-homed from #5728 (fork PR by @sbauersfeld) so CI can run with OIDC.

Signed-off-by: Scott Bauersfeld <scott.bauersfeld@databricks.com>
Co-authored-by: Isaac

@rugpanov rugpanov left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lgtm

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 43ef425

Run: 28439084260

Env 🟨​KNOWN 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 1 13 231 1037 4:48
🟨​ aws windows 7 1 13 233 1035 5:45
💚​ aws-ucws linux 8 13 315 955 4:14
💚​ aws-ucws windows 8 13 317 953 3:19
💚​ azure linux 2 15 231 1036 3:50
💚​ azure windows 2 15 233 1034 2:47
💚​ azure-ucws linux 2 15 317 952 4:28
💚​ azure-ucws windows 2 15 319 950 3:02
💚​ gcp linux 2 15 230 1038 3:10
💚​ gcp windows 2 15 232 1036 2:35
21 interesting tests: 13 SKIP, 7 KNOWN, 1 RECOVERED
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/replace_existing 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_projects/update_display_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R

@anton-107 anton-107 added this pull request to the merge queue Jun 30, 2026
Merged via the queue into main with commit 3753e98 Jun 30, 2026
22 checks passed
@anton-107 anton-107 deleted the sbauersfeld-remote-ssh-command-origin branch June 30, 2026 12:05
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.

4 participants