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

[MT-68] Add ControlMaster ssh options in mila init #58

Merged
merged 18 commits into from
Nov 1, 2023

Conversation

lebrice
Copy link
Collaborator

@lebrice lebrice commented Sep 25, 2023

  • Adds the ControlMaster, ControlPath and ControlPersist options to the mila ssh configuration entry as well as the one used to connect to compute nodes.
  • Updates the entries in-place if they already exist.

These options make it possible to reuse an existing ssh connection via what's called "SSH multiplexing". I'm not an expert, but basically, it seems to create a file in a predetermined path (set via "ControlPath") for each "real" ssh connection. Then, if you try to make a new SSH connection to the same host and port, that initial connection is reused instead of making a new one.

TL;DR: This makes it a LOT quicker to connect to the cluster or to compute nodes: after the first connection to the login node or compute node is done (still takes a while), the following connections are near-instant.

ALSO:

  • Removes extra newlines between SSH configuration entries

    • This currently has a potentially annoying side-effect of collapsing existing empty block of > 2 empty lines in the user's ~/.ssh/config file into just a single empty line.
  • Improves the name and format of regression files used in unit tests. They are now readable Markdown files in this format:

    Running the `mila init` command with this initial content:
    
    (the initial content)
    
    and these use inputs: (the user inputs)
    leads to the following ssh config contents:
    
    (the resulting content of ~/.ssh/config)
    

(See https://github.com/lebrice/milatools/blob/ControlMaster-mila-init-MT-68/tests/cli/test_init_command/test_with_existing_entries_has_mila_compute_entry_has_mila_cpu_entry_no_mila_entry_.md for an example)

This makes connecting to the cluster much easier, since the long delay
will only happen on the first connection. Also makes it much quicker to
reload a VsCode window connected to a compute node, for instance.

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
lebrice and others added 11 commits September 25, 2023 16:27
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
@lebrice lebrice merged commit 244bd50 into mila-iqia:master Nov 1, 2023
5 checks passed
lebrice added a commit that referenced this pull request Nov 6, 2023
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.

3 participants