https://github.com/breuleux/milatools-bk
Tools to connect to and interact with the Mila cluster
https://github.com/breuleux/milatools-bk
Last synced: about 1 month ago
JSON representation
Tools to connect to and interact with the Mila cluster
- Host: GitHub
- URL: https://github.com/breuleux/milatools-bk
- Owner: breuleux
- Created: 2021-08-31T19:38:15.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-13T18:10:59.000Z (over 3 years ago)
- Last Synced: 2025-04-14T20:09:23.056Z (about 1 month ago)
- Language: Python
- Size: 40 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# milatools
The milatools package provides the `mila` command, which is meant to help with connecting to and interacting with the Mila cluster.
## Install
Requires Python >= 3.8
```bash
pip install milatools
```Or, for bleeding edge version:
```bash
pip install git+git://github.com/mila-iqia/milatools.git
```After installing `milatools`, start with `mila init`:
```bash
mila init
```## Commands
### mila init
Set up your access to the mila cluster interactively. Have your username and password ready!
* Set up your SSH config for easy connection with `ssh mila`
* Set up your public key if you don't already have them
* Copy your public key over to the cluster for passwordless auth
* Set up a public key on the login node to enable ssh into compute nodes### mila docs/intranet
* Use `mila docs ` to search the Mila technical documentation
* Use `mila intranet ` to search the Mila intranetBoth commands open a browser window. If no search terms are given you are taken to the home page.
### mila code
Connect a VSCode instance to a compute node. `mila code` first allocates a compute node using slurm (you can pass slurm options as well using `--alloc`), and then calls the `code` command with the appropriate options to start a remote coding session on the allocated node.
You can simply Ctrl+C the process to end the session.
```
usage: mila code [-h] [--alloc ...] [--job VALUE] [--node VALUE] PATHpositional arguments:
PATH Path to open on the remote machineoptional arguments:
-h, --help show this help message and exit
--alloc ... Extra options to pass to slurm
--job VALUE Job ID to connect to
--node VALUE Node to connect to
```For example:
```bash
mila code path/to/my/experiment
```The `--alloc` option may be used to pass extra arguments to `salloc` when allocating a node (for example, `--alloc --gres=cpu:8` to allocate 8 CPUs). `--alloc` should be at the end, because it will take all of the arguments that come after it.
If you already have an allocation on a compute node, you may use the `--node NODENAME` or `--job JOBID` options to connect to that node.