Skip to content

[RunPod] Label account SSH keys with the SkyPilot user#9975

Open
ciprianf wants to merge 2 commits into
skypilot-org:masterfrom
ciprianf:alexandru/runpod-ssh-key-label
Open

[RunPod] Label account SSH keys with the SkyPilot user#9975
ciprianf wants to merge 2 commits into
skypilot-org:masterfrom
ciprianf:alexandru/runpod-ssh-key-label

Conversation

@ciprianf

@ciprianf ciprianf commented Jun 29, 2026

Copy link
Copy Markdown

Why

SkyPilot registers an SSH key into a user's RunPod account on launch. RunPod names a key after its comment field, but SkyPilot's keys have no comment — so they all show up unnamed, and on a shared account you can't tell which key belongs to whom.

What

Add a skypilot-<user>-<hash> comment to the key right before registering it with RunPod. The key itself is unchanged, so SSH still works; only the name shown in the RunPod console changes. Includes unit tests.

Tested

Unit-tests.

ciprianf and others added 2 commits June 29, 2026 11:54
RunPod derives an account SSH key's display name from the key's comment
field. SkyPilot generates keys with no comment, so every per-user key the
API server registers shows up as unnamed, making it impossible to tell which
key belongs to which user.

Stamp the public key with a `skypilot-<user>-<hash>` comment at registration
time, normalizing away any existing comment so re-registration stays
idempotent. Key material is untouched, so SSH auth is unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cover _runpod_key_label (username present, unresolved fallback, empty
fallback) and setup_runpod_authentication (labels a bare key, replaces an
existing comment), asserting the registered key keeps its material and carries
a single-token comment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a mechanism to label SSH keys registered with RunPod, allowing them to be easily identified in the RunPod dashboard. Specifically, it adds a helper function _runpod_key_label to generate a per-user identifier without spaces, and updates setup_runpod_authentication to append this label to the public key. Additionally, comprehensive unit tests have been added to verify the labeling logic under various scenarios. There are no review comments to address, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

1 participant