[RunPod] Label account SSH keys with the SkyPilot user#9975
Conversation
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>
There was a problem hiding this comment.
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.
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.