-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Provisioner] Generate valid cluster names when username has invalid characters #1526
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @romilbhardwaj!
- How about keeping hyphens in a username? Since they are used and allowed by clouds.
- One other place where non-conforming username may be picked up as part of a cluster name is
_default_interactive_node_name()
in cli.py. Should we fix that too? - There are a few other usage of
getpass.getuser()
but I think only the above two are for cluster names purposes.
These are great points:
I have updated the code to allow hyphens in the middle the of the username, but not at start or end. Thinking more about it, maybe it's better to have a simpler scheme (disallow hyphens everywhere), but I don't feel strongly either way.
Great catch! I have updated
Yeah, there are some used in hashing job ids, but perhaps they don't need to be changed. Changing them would require some thought about backward compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @romilbhardwaj. LGTM.
Co-authored-by: Zongheng Yang <[email protected]>
Closes #1161.
We now clean up the username (used as suffix in the cluster name) by:
e.g.
1SkY-PiLot2-
becomessky-pilot2
when it is used for generating cluster name.Tested:
Manual tests by overriding the username read by getpass.getuser():
LOGNAME=RomilB sky launch
- uppercase charactersLOGNAME=romil-b sky launch
- hypenLOGNAME=romil_b sky launch
- underscoreLOGNAME=1roMil-b123 sky launch
- number at start gets removed. Becomesromilb123
LOGNAME=r#omIl_B sky launch