volcano.sh/volcano@v1.9.0/docs/design/command-line-enhancement.md (about)

     1  # `vcctl` Command Line Enhancement
     2  
     3  [@jiangkaihua](jiangkaihua1@huawei.com); Dec. 16, 2019
     4  
     5  ## Catalog
     6  - [`vcctl` Command Line Enhancement](#vcctl-command-line-enhancement)
     7    - [Catalog](#catalog)
     8    - [Functions of `vcctl`](#functions-of-vcctl)
     9      - [Command `vcctl job`](#command-vcctl-job)
    10      - [Command `vcctl queue`](#command-vcctl-queue)
    11    - [`vcctl` vs. Slurm Command Line](#vcctl-vs-slurm-command-line)
    12    - [New Format of Volcano Command Line](#new-format-of-volcano-command-line)
    13      - [For Common User](#for-common-user)
    14        - [`vsub` submit via file](#vsub-submit-via-file)
    15      - [For Administrator](#for-administrator)
    16    - [Reference](#reference)
    17  
    18  ## Functions of `vcctl`
    19  `vcctl` is the command line of [volcano](https://github.com/volcano-sh/volcano). The main functions are listed below:
    20  
    21  ### Command `vcctl job`
    22  | Command Format | Usage |
    23  | - | - |
    24  | `vcctl job delete -N <job_name> -n <namespace>` | delete a job |
    25  | `vcctl job list -S <scheduler> -n <namespace>` | list job info |
    26  | `vcctl job resume -N <job_name> -n <namespace>` | resume a job |
    27  | `vcctl job run -f <yaml_file> -i <image> -L <resource_limit> -m <min_available> -N <job_name> -n <namespace> -r <replicas> -R <resource_requeset> -S <scheduler>` | run job by parameters from the command line |
    28  | `vcctl job suspend -N <job_name> -n <namespace>` | suspend a job |
    29  | `vcctl job view -N <job_name> -n <namespace>` | show a job info |
    30  
    31  ### Command `vcctl queue`
    32  | Command Format | Usage |
    33  | - | - |
    34  | `vcctl queue create -n <queue_name> -w <weight>` | create a queue |
    35  | `vcctl queue delete -n <queue_name>` | delete a queue |
    36  | `vcctl queue get -n <queue_name>` | get a queue |
    37  | `vcctl queue list ` | list all the queue |
    38  | `vcctl queue operate -a <open/close/update> -n <queue_name> -w <weight>` | operate a queue |
    39  
    40  ## `vcctl` vs. Slurm Command Line
    41  The similar Slurm command lines are listed below:
    42  
    43  | `vcctl` Function | Similar Slurm Command Line |
    44  | - | - |
    45  | `vcctl job run -f <yaml_file>` | `sbatch <job_file>` |
    46  | `vcctl job run -N <job_name>` | `srun -J <job_name> ` |
    47  | `vcctl job delete -N <job_name> -n <namespace>` | `scancel <job_id> / -n <job_name> -u <user>` |
    48  | `vcctl job suspend -N <job_name> -n <namespace>` | `scontrol suspend <job_id>` |
    49  | `vcctl job resume -N <job_name> -n <namespace>` | `scontrol resume <job_id>` |
    50  | `vcctl job view -N <job_name> -n <namespace>` | `scontrol show job <job_id>` |
    51  | `vcctl job list --all-namespaces` | `scontrol show job` |
    52  | `vcctl job list -n <namespace>` | `squeue -u <user>` |
    53  | `vcctl queue create -n <queue_name> -w <weight>` | `scontrol create PartitionName=<partition_name>` |
    54  | `vcctl queue delete -n <queue_name>` | `scontrol delete PartitionName=<partition_name>` |
    55  | `vcctl queue get -n <queue_name>` | `squeue -p <partition_name> & scontrol show partition <partition_name>` |
    56  | `vcctl queue list ` | `squeue -a & scontrol show partition` |
    57  | `vcctl queue operate -a <open/close/update> -n <queue_name> -w <weight>` | no similar commands |
    58  
    59  ## New Format of Volcano Command Line
    60  ### For Common User
    61  | Old Format | New Format |
    62  | - | - |
    63  | `vcctl job run -N <job_name>` | `vsub -j/--job-name <job_file>` |
    64  | `vcctl job delete -N <job_name> -n <namespace>` | `vcancel -n <job_name> -N <namespace>` |
    65  | `vcctl job suspend -N <job_name> -n <namespace>` | `vsuspend -n <job_name> -N <namespace>` |
    66  | `vcctl job resume -N <job_name> -n <namespace>` | `vresume -n <job_name> -N <namespace>` |
    67  | `vcctl job view -N <job_name> -n <namespace>` | `vjobs -n <job_name> -N <namespace>` |
    68  | `vcctl job list -S <scheduler> -n <namespace>` | `vjobs -S <scheduler> -N <namespace>` |
    69  | `vcctl queue get -n <queue_name>` | `vqueues -n <queue_name>` |
    70  | `vcctl queue list ` | `vqueues` |
    71  
    72  #### `vsub` submit via file
    73  Command `vsub` can also submit a batch job via `.sh` file, like:
    74  ```shell
    75  [user@host]$ vsub test.sh
    76  Submitted batch job test
    77  ```
    78  The job file <test.sh> owns a format like:
    79  ```shell
    80  #!/bin/bash`
    81  
    82  #VSUB jobName test
    83  #VSUB namespace volcano-system
    84  #VSUB queue default
    85  #VSUB schedulerName volcano
    86  #VSUB image busybox
    87  #VSUB replicas 10
    88  #VSUB minAvailable 4
    89  ...
    90  
    91  echo test.sh start on $(date)
    92  sleep 100
    93  echo test.sh end on $(date)
    94  ```
    95  
    96  
    97  ### For Administrator
    98  | Old Format | New Format |
    99  | - | - |
   100  | `vcctl queue create -n <queue_name> -w <weight>` | `vadmin qcreate -n <queue_name> -w <weight>` |
   101  | `vcctl queue delete -n <queue_name>`| `vadmin qcancel -n <queue_name>` |
   102  | `vcctl queue operate -a open -n <queue_name>`| `vadmin qopen -n <queue_name>` |
   103  | `vcctl queue operate -a close -n <queue_name>`| `vadmin qclose -n <queue_name>` |
   104  | `vcctl queue operate -a update -n <queue_name> -w <weight>`| `vadmin qupdate -n <queue_name> -w <weight>` |
   105  
   106  
   107  operate -a <open/close/update> -n <queue_name> -w <weight>
   108  ## Reference
   109  - [Slurm Documentation](https://slurm.schedmd.com/)
   110  - [IBM Platform LSF Command Reference](https://www.ibm.com/support/knowledgecenter/en/SSETD4_9.1.2/lsf_kc_cmd_ref.html)
   111  - [Slurm作业调度系统使用指南](http://hmli.ustc.edu.cn/doc/userguide/slurm-userguide.pdf)
   112  - [SLURM使用基础教程](https://www.hpccube.com/wiki/index.php/SLURM%E4%BD%BF%E7%94%A8%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B)
   113  - [北京大学国际数学中心微型工作站-SLURM 使用参考](http://bicmr.pku.edu.cn/~wenzw/pages/index.html)