tensorchord / envd

🏕️ Reproducible development environment
https://envd.tensorchord.ai/
Apache License 2.0
2.04k stars 160 forks source link

feat(CLI): Support SSH(attach) command #101

Open gaocegege opened 2 years ago

gaocegege commented 2 years ago

Description

midi ssh

kemingy commented 2 years ago

Is it done though sshd?

gaocegege commented 2 years ago

This issue is to support a new command envd ssh to attach into the env.

kemingy commented 2 years ago

This issue is to support a new command envd ssh to attach into the env.

What's the main difference between ssh <envd-container> and envd ssh <envd-container>? Any feature we should support through this new command?

gaocegege commented 2 years ago

envd ssh or envd attach does not require the target if it is run in the build context dir.

gaocegege commented 2 years ago

For envd-server runner:

envd ssh will be introduced as the new command. It creates the ssh client config, then connect to the ssh proxy server containerssh. The username should be the contains the identitytoken and project name.

The envd-server should:

gaocegege commented 2 years ago

After thinking, I propose not to add the command now.

We already inject the ssh entry in envd-server runner like this:

# entry generated by envd
Host a332139d39b89a241400013700e665a3.envd
  PubkeyAcceptedKeyTypes +ssh-rsa
  HostKeyAlgorithms +ssh-rsa
  HostName 127.0.0.1
  Port 2222
  UserKnownHostsFile /dev/null
  IdentityFile "/home/gaocegege/.config/envd/id_rsa_envd"
  StrictHostKeyChecking no
  User a332139d39b89a241400013700e665a3

User can use ssh a332139d39b89a241400013700e665a3.envd to attach. Thus there is no need to introduce a new command.

VoVAllen commented 1 year ago

Mainly to support automatic port forwarding other than pure SSH connection. This is also related to the syncthing support