|
1 | 1 | # coman |
2 | 2 |
|
3 | | -[](https://github.com/SwissDataScienceCenter/coman/actions) |
| 3 | +[](https://github.com/SwissDataScienceCenter/coman/actions) |
4 | 4 |
|
5 | 5 | Compute Manager for managing HPC compute |
| 6 | + |
| 7 | + |
| 8 | +## Installation |
| 9 | + |
| 10 | +### Linux |
| 11 | + |
| 12 | +```shell |
| 13 | +$ curl -LO https://github.com/SwissDataScienceCenter/coman/releases/latest/download/coman-Linux-x86_64-musl.tar.gz |
| 14 | +# tar -xzf ... /usr/local/bin/coman |
| 15 | +# chmod +x /usr/local/bin/coman |
| 16 | +``` |
| 17 | + |
| 18 | +### Macos |
| 19 | + |
| 20 | +```shell |
| 21 | +$ curl -LO https://github.com/SwissDataScienceCenter/coman/releases/latest/download/coman-Darwin-x86_64.tar.gz |
| 22 | +# tar -xzf ... /usr/local/bin/coman |
| 23 | +# chmod +x /usr/local/bin/coman |
| 24 | +``` |
| 25 | + |
| 26 | +### Windows |
| 27 | +Run as Admin: |
| 28 | + |
| 29 | +```powershell |
| 30 | +# Download the ZIP file |
| 31 | +Invoke-WebRequest -Uri "https://github.com/SwissDataScienceCenter/coman/releases/latest/download/coman-Windows-aarch64.zip" -OutFile "coman-Windows-aarch64.zip" |
| 32 | +
|
| 33 | +# Extract the ZIP file |
| 34 | +Expand-Archive -Path "coman-Windows-aarch64.zip" -DestinationPath ".\coman_temp" -Force |
| 35 | +
|
| 36 | +# Move the binary to C:\Program Files\coman |
| 37 | +New-Item -ItemType Directory -Path "C:\Program Files\coman" -Force |
| 38 | +Move-Item -Path ".\coman_temp\coman.exe" -Destination "C:\Program Files\coman\coman.exe" -Force |
| 39 | +
|
| 40 | +# Permanent PATH addition (requires Administrator privileges) |
| 41 | +[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";C:\Program Files\coman", "Machine") |
| 42 | +
|
| 43 | +# Clean up temporary files |
| 44 | +Remove-Item -Path "coman-Windows-aarch64.zip" -Force |
| 45 | +Remove-Item -Path ".\coman_temp" -Recurse -Force |
| 46 | +``` |
| 47 | + |
| 48 | + |
| 49 | +## Usage |
| 50 | + |
| 51 | +Coman can be used in two ways, one is as a normal CLI tool the other is as an interactive terminal UI (TUI). |
| 52 | + |
| 53 | +### Logging in |
| 54 | +To use Coman, you need to log in to CSCS. |
| 55 | + |
| 56 | +For this you need go to the [CSCS Developer portal](https://developer.svc.cscs.ch) and go to `Applications` |
| 57 | + |
| 58 | + |
| 59 | +After logging in with your CSCS credentials, pick the `DefaultApplication` |
| 60 | + |
| 61 | + |
| 62 | +Click on `Production Keys` |
| 63 | + |
| 64 | + |
| 65 | +Then click on `Generate Keys` at the bottom, without changing any settings. |
| 66 | + |
| 67 | + |
| 68 | +You should now have a Consumer Key (`Client id` in Coman) and a Consumer Secret (`Client Secret` in Coman) |
| 69 | + |
| 70 | + |
| 71 | +Run `coman cscs login` and provide the Client id and Client secret when prompted. Both are securely stored in |
| 72 | +your operating systems secure storage and don't need to be entered again. You also don't need to repeat this |
| 73 | +step unless your keys change. |
| 74 | + |
| 75 | + |
| 76 | +### CLI |
| 77 | + |
| 78 | +To create a Coman config for a project/folder, run |
| 79 | + |
| 80 | +```shell |
| 81 | +$ coman init <folder> |
| 82 | +``` |
| 83 | + |
| 84 | +This creates a `coman.toml` file that you can customize with settings if you wish. |
| 85 | + |
| 86 | +Select what system you want to run on |
| 87 | + |
| 88 | +```shell |
| 89 | +$ coman cscs system ls # this lists systems you can see. |
| 90 | +┌───────┬────────────────────────────┐ |
| 91 | +│ name │ services_health │ |
| 92 | +├───────┼────────────────────────────┤ |
| 93 | +│ eiger │ ╔══════════════╦═════════╗ │ |
| 94 | +│ │ ║ service_type ║ healthy ║ │ |
| 95 | +│ │ ╠══════════════╬═════════╣ │ |
| 96 | +│ │ ║ Scheduler ║ true ║ │ |
| 97 | +│ │ ╠══════════════╬═════════╣ │ |
| 98 | +│ │ ║ Ssh ║ true ║ │ |
| 99 | +│ │ ╠══════════════╬═════════╣ │ |
| 100 | +│ │ ║ Filesystem ║ true ║ │ |
| 101 | +│ │ ╠══════════════╬═════════╣ │ |
| 102 | +│ │ ║ Filesystem ║ true ║ │ |
| 103 | +│ │ ╠══════════════╬═════════╣ │ |
| 104 | +│ │ ║ Filesystem ║ true ║ │ |
| 105 | +│ │ ╚══════════════╩═════════╝ │ |
| 106 | +├───────┼────────────────────────────┤ |
| 107 | +│ daint │ ╔══════════════╦═════════╗ │ |
| 108 | +│ │ ║ service_type ║ healthy ║ │ |
| 109 | +│ │ ╠══════════════╬═════════╣ │ |
| 110 | +│ │ ║ Scheduler ║ true ║ │ |
| 111 | +│ │ ╠══════════════╬═════════╣ │ |
| 112 | +│ │ ║ Ssh ║ true ║ │ |
| 113 | +│ │ ╠══════════════╬═════════╣ │ |
| 114 | +│ │ ║ Filesystem ║ true ║ │ |
| 115 | +│ │ ╠══════════════╬═════════╣ │ |
| 116 | +│ │ ║ Filesystem ║ true ║ │ |
| 117 | +│ │ ╠══════════════╬═════════╣ │ |
| 118 | +│ │ ║ Filesystem ║ true ║ │ |
| 119 | +│ │ ╠══════════════╬═════════╣ │ |
| 120 | +│ │ ║ Filesystem ║ true ║ │ |
| 121 | +│ │ ╠══════════════╬═════════╣ │ |
| 122 | +│ │ ║ Filesystem ║ true ║ │ |
| 123 | +│ │ ╚══════════════╩═════════╝ │ |
| 124 | +└───────┴────────────────────────────┘ |
| 125 | +$ coman cscs system set daint |
| 126 | +``` |
| 127 | + |
| 128 | +To execute a job on CSCS, run a command like |
| 129 | + |
| 130 | +```shell |
| 131 | +$ coman cscs job submit -i ubuntu:latest -- echo test |
| 132 | +``` |
| 133 | +This will run the command `echo test` using the `ubuntu:latest` docker image and default settings. |
| 134 | +See `coman cscs job submit -h` for more options. |
| 135 | + |
| 136 | +You can list your jobs using |
| 137 | + |
| 138 | +```shell |
| 139 | +$ coman cscs job list |
| 140 | +┌─────────┬────────────────┬──────────┬──────────┬────────────────────────────┬────────────────────────────┐ |
| 141 | +│ id │ name │ status │ user │ start_date │ end_date │ |
| 142 | +├─────────┼────────────────┼──────────┼──────────┼────────────────────────────┼────────────────────────────┤ |
| 143 | +│ 2104427 │ job-name │ Finished │ user │ 2025-11-19 12:13:26 +01:00 │ 2025-11-19 12:13:55 +01:00 │ |
| 144 | +└─────────┴────────────────┴──────────┴──────────┴────────────────────────────┴────────────────────────────┘ |
| 145 | +``` |
| 146 | + |
| 147 | +Get details for a job with |
| 148 | +```shell |
| 149 | +$ coman cscs job get <id> |
| 150 | +┌───────────────┬────────────────────────────────────────────────────────┐ |
| 151 | +│ Id │ 2127021 │ |
| 152 | +├───────────────┼────────────────────────────────────────────────────────┤ |
| 153 | +│ Name │ job-name │ |
| 154 | +├───────────────┼────────────────────────────────────────────────────────┤ |
| 155 | +│ Start Date │ 2025-11-24 10:15:50 +01:00 │ |
| 156 | +├───────────────┼────────────────────────────────────────────────────────┤ |
| 157 | +│ End Date │ 2025-11-24 10:17:32 +01:00 │ |
| 158 | +├───────────────┼────────────────────────────────────────────────────────┤ |
| 159 | +│ Status │ Finished │ |
| 160 | +├───────────────┼────────────────────────────────────────────────────────┤ |
| 161 | +│ Status Reason │ None │ |
| 162 | +├───────────────┼────────────────────────────────────────────────────────┤ |
| 163 | +│ Exit Code │ 0 │ |
| 164 | +├───────────────┼────────────────────────────────────────────────────────┤ |
| 165 | +│ stdin │ /dev/null │ |
| 166 | +├───────────────┼────────────────────────────────────────────────────────┤ |
| 167 | +│ stdout │ /capstor/scratch/cscs/rgrubenm/coman/slurm-2127021.out │ |
| 168 | +├───────────────┼────────────────────────────────────────────────────────┤ |
| 169 | +│ stderr │ │ |
| 170 | +└───────────────┴────────────────────────────────────────────────────────┘ |
| 171 | +``` |
| 172 | + |
| 173 | +Get the logs from a job |
| 174 | + |
| 175 | +```shell |
| 176 | +$ coman cscs job log <id> |
| 177 | +``` |
| 178 | + |
| 179 | + |
| 180 | +### TUI |
| 181 | + |
| 182 | +To run the TUI, simply run `coman` without any arguments: |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | +The TUI should be pretty self-explanatory. It gives an overview of your jobs on the selected system, |
| 187 | +refreshed every couple of seconds, lets you see the logs and all the other functionality of the CLI, |
| 188 | +just in an interactive way. |
0 commit comments