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