Skip to content
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

[k8s] Fix for spaces and equals signs in docker env vars #3322

Merged
merged 3 commits into from
Mar 18, 2024

Conversation

romilbhardwaj
Copy link
Collaborator

@romilbhardwaj romilbhardwaj commented Mar 17, 2024

Closes #3320. Our parsing for k8s envvars -> ssh envvars would break if the envvar value contained equals signs or spaces. This PR fixes it.

Example, if the env is set as ENV GIT_SSH_COMMAND="ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa".

Before, our custom envs script would contain:

...
export GIT_SSH_COMMAND=ssh -o HostKeyAlgorithms
...

After (handles equals sign, adds quotes to handle spaces):

...
export GIT_SSH_COMMAND="ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa"
...

Tested (run the relevant ones):

@romilbhardwaj romilbhardwaj changed the title [k8s] Fix for spaces and equals signs in envvars [k8s] Fix for spaces and equals signs in docker env vars Mar 17, 2024
@romilbhardwaj romilbhardwaj marked this pull request as ready for review March 18, 2024 03:37
Copy link
Collaborator

@Michaelvll Michaelvll left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks for the quick fix of this @romilbhardwaj! LGTM.

@romilbhardwaj
Copy link
Collaborator Author

Also ran basic tests with GPU image (sky launch -c gputest --gpus T4:1 --cloud kubernetes -- nvidia-smi), merging now.

@romilbhardwaj romilbhardwaj merged commit 8a27ca8 into master Mar 18, 2024
19 checks passed
@romilbhardwaj romilbhardwaj deleted the k8s_envvar_spaces_fix branch March 18, 2024 21:57
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.

[k8s] SkyPilot overrides GIT_SSH_COMMAND environment variable
2 participants