Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b71f4fa
WIP: Rework of `mila init` following changes
lebrice Mar 17, 2025
fec09c8
temp
lebrice Mar 18, 2025
ddfec0b
temp
lebrice Mar 18, 2025
b71b1ef
TEMP
lebrice Mar 20, 2025
0f28687
WIP: New `mila init` that mainly only prints
lebrice Mar 24, 2025
5752f5b
Make some progress on the rework of mila init
lebrice Mar 28, 2025
934129f
Remove overcomplicated, broken tests
lebrice Mar 28, 2025
d51710b
Add todo for new 'cn-????' entry for compute nodes
lebrice Mar 28, 2025
c150c5c
Remove leftover todo
lebrice Mar 28, 2025
3325958
`StrictHostKeyChecking=no` for mila compute nodes
lebrice Mar 28, 2025
2b0f4ff
Remove flaky check_passwordless and test
lebrice Mar 28, 2025
907ab0c
Explicit async fixture scope to avoid warning
lebrice Mar 28, 2025
2358581
Update regression files for compute node entry
lebrice Mar 31, 2025
5cb8ef0
Fix bug in test for config file permissions
lebrice Mar 31, 2025
e389563
Add xfail on Windows test (?)
lebrice Mar 31, 2025
b511bce
Another fix for Windows permission check (?)
lebrice Mar 31, 2025
cd3dba5
Make test slightly less flaky
lebrice Apr 1, 2025
eee2cb3
Remove mentions of the temporary form to add keys
lebrice Apr 7, 2025
f27675a
Dont add StrictHostKeyChecking=no for compute node
lebrice Apr 7, 2025
3194e1e
Add new tests for mila init
lebrice Jun 11, 2025
82fccec
WIP: Simplify/remove unnecessary tests
lebrice Sep 2, 2025
5300a3d
Xfail tests that are broken
lebrice Sep 3, 2025
67bd4a9
Remove unnecessary regression files, add todos
lebrice Sep 4, 2025
373b7d8
Adjust tests for init_command
lebrice Sep 4, 2025
c0852ab
Simplify input stream mocks in tests for mila init
lebrice Sep 8, 2025
4e9b121
Fix some tests that use input_stream twice
lebrice Sep 8, 2025
bb7f15d
Start adding new tests for `mila init`
lebrice Sep 8, 2025
632e214
Make new integration tests for `mila init`
lebrice Sep 8, 2025
663be34
Add temporary modifications to init_command.py
lebrice Sep 8, 2025
7fec9a3
Add todo for disabling assert rewriting
lebrice Sep 8, 2025
fa628e4
Add full test for compute node SSH access setup
lebrice Sep 9, 2025
1cc6411
Add todo for later test
lebrice Sep 9, 2025
ae9f8ce
Fix test collection error in test_init.py
lebrice Sep 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions milatools/cli/code.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""

TODO: If we need to add a ssh-key on the login node and add it to authorized_keys to get
ssh access to compute nodes, do it here instead of in mila init, since we're already
going to go through 2FA once.
"""

from __future__ import annotations

import asyncio
Expand Down
36 changes: 2 additions & 34 deletions milatools/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@
from milatools.cli import console
from milatools.cli.code import code
from milatools.cli.init_command import (
print_welcome_message,
setup_keys_on_login_node,
setup_passwordless_ssh_access,
setup_ssh_config,
setup_vscode_settings,
setup_windows_ssh_config_from_wsl,
init,
)
from milatools.cli.profile import ensure_program, setup_profile
from milatools.cli.utils import (
Expand All @@ -54,7 +49,6 @@
get_fully_qualified_name,
get_hostname_to_use_for_compute_node,
randname,
running_inside_WSL,
with_control_file,
)
from milatools.utils.disk_quota import check_disk_quota_v1
Expand Down Expand Up @@ -108,6 +102,7 @@ def main():
github_issue_url = (
f"https://github.com/mila-iqia/milatools/issues/new?{urlencode(options)}"
)

print(
T.bold_yellow(
f"An error occurred during the execution of the command `{command}`. "
Expand Down Expand Up @@ -508,33 +503,6 @@ def intranet(search: Sequence[str]) -> None:
webbrowser.open(url)


def init():
"""Set up your configuration and credentials."""

#############################
# Step 1: SSH Configuration #
#############################

print("Checking ssh config")

ssh_config = setup_ssh_config()

success = setup_passwordless_ssh_access(ssh_config=ssh_config)
if not success:
exit()

# if we're running on WSL, we actually just copy the id_rsa + id_rsa.pub and the
# ~/.ssh/config to the Windows ssh directory (taking care to remove the
# ControlMaster-related entries) so that the user doesn't need to install Python on
# the Windows side.
if running_inside_WSL():
setup_windows_ssh_config_from_wsl(linux_ssh_config=ssh_config)

setup_keys_on_login_node()
setup_vscode_settings()
print_welcome_message()


def forward(
remote: str,
page: str | None,
Expand Down
Loading
Loading