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

feat(cli): add SSH support for renku session #3313

Merged
merged 7 commits into from
Feb 14, 2023

Conversation

Panaetius
Copy link
Member

closes #3289
closes #3290

Adds renku session setup-ssh command to configure SSH locally for access to a deployment (need to be logged in).
Adds renku session start --ssh command that setups of keys in the project for SSH access and configures the local machine for access to a session. Also perfirms setup-ssh if not done already.
Adds renku session open --ssh command that opens an SSH connection to a session.

@Panaetius Panaetius requested a review from a team as a code owner February 10, 2023 10:52
@Panaetius Panaetius force-pushed the topic/3289-ssh-session-setup branch 3 times, most recently from a614ebc to d479a0e Compare February 10, 2023 16:10
@Panaetius
Copy link
Member Author

Steps to test:

  • Create a project there and set the base image in the Dockerfile to ARG RENKU_BASE_IMAGE=renku/renkulab-py:python-3.9.12-4d92ea3
  • Clone the project locally
  • Install renku on your local machine from this PR pip install git+https://github.com/SwissDataScienceCenter/renku-python.git@topic/3289-ssh-session-setup
  • renku login renku-ci-nb-1389.dev.renku.ch
  • renku session setup-ssh (optional, sets up SSH jump host and keys for the deployment). you can also use -k <path to private key> if you don't want a key generated for you and use an existing key instead
  • export RENKU_IMAGE_REGISTRY="registry.dev.renku.ch" this is a workaround since renku session start doesn't currently work for external gitlab deployments where gitlab is not at gitlab. or /gitlab (which our CI deployments are). On dev or renkulab this wouldn't be necessary
  • renku session start -p renkulab --ssh starts the session, adds your key to authorized_hosts(the first time) and prints the connection name
  • Connect with VScode with the printed session name or renku session open --ssh <session id> for just a shell

Copy link
Contributor

@m-alisafaee m-alisafaee left a comment

Choose a reason for hiding this comment

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

Thanks Ralf! This is great! I couldn't create a project in the deployed env; it hangs when fetching templates.

renku/command/session.py Show resolved Hide resolved
renku/core/session/renkulab.py Show resolved Hide resolved
renku/core/session/session.py Show resolved Hide resolved
renku/core/session/session.py Outdated Show resolved Hide resolved
renku/core/util/ssh.py Outdated Show resolved Hide resolved
renku/core/util/ssh.py Outdated Show resolved Hide resolved
renku/core/util/ssh.py Outdated Show resolved Hide resolved
renku/core/util/ssh.py Show resolved Hide resolved
renku/core/session/renkulab.py Show resolved Hide resolved
@Panaetius
Copy link
Member Author

I couldn't create a project in the deployed env; it hangs when fetching templates.
That weird. I guess you could always just create the project on Dev as well and it'd show up here.
Or maybe it'll work now that I'm redeploying it with the new commit?

@Panaetius Panaetius merged commit daeb51f into feature/ssh-into-sessions Feb 14, 2023
@Panaetius Panaetius deleted the topic/3289-ssh-session-setup branch February 14, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants