volcano-sh / volcano

A Cloud Native Batch System (Project under CNCF)
https://volcano.sh
Apache License 2.0
4.21k stars 964 forks source link

enhancement vcctl features #3495

Open googs1025 opened 5 months ago

googs1025 commented 5 months ago

What would you like to be added:

TODO:

Notes:

it is expected that work on this proposal will be carried out after this https://github.com/volcano-sh/volcano/pull/3494 PR is merged. Split each todo work item and merge it using multiple PRs.

googs1025 commented 5 months ago

/assign

googs1025 commented 5 months ago

@lowang-bh @hwdef @Monokaix /PTAL Please help identify whether we need this type of enhancement. thanks!

lowang-bh commented 5 months ago

I am ok. vcctl job list need another filter --namespace=ns Other's detail need to be discussed. You'd better first submit a docs to illustrate the detail display.

googs1025 commented 5 months ago

I am ok. vcctl job list need another filter --namespace=ns Other's detail need to be discussed. You'd better first submit a docs to illustrate the detail display.

Okay, I will post a document describing the details in the next few days.

googs1025 commented 5 months ago

Enhancement vcctl Proposal:

Summary:

The functionality of vcctl is currently limited. For example, it only supports job and queue operations. However, Volcano itself has other custom resource (CR) types, such as jobflow and jobtemplate, among others.

Motivation

To enhance vcctl functionality

Tasks

  1. Enhance vcctl to support jobflow and jobtemplate CRs:
    • Add create, delete, list, get, describe commands for jobflow and jobtemplate CRs example: vcctl jobflow create, vcctl jobflow delete, vcctl jobflow list, vcctl jobflow get, vcctl jobflow describe example: vcctl jobtemplate create, vcctl jobtemplate delete, vcctl jobtemplate list, vcctl jobtemplate get, vcctl jobtemplate describe
  2. Add filtering options to vcctl job list command
    • Add "--queue=default" to filter by the specific queue.
    • Add "--phase=Running" to filter by the specific phase.

The following are the original functions

root@VM-0-17-ubuntu:~# vcctl job list -h
list job information

Usage:
  vcctl job list [flags]

Flags:
      --all-namespaces      list jobs in all namespaces
  -h, --help                help for list
  -k, --kubeconfig string   (optional) absolute path to the kubeconfig file (default "/root/.kube/config")
  -s, --master string       the address of apiserver
  -n, --namespace string    the namespace of job (default "default")
  -S, --scheduler string    list job with specified scheduler name
      --selector string     fuzzy matching jobName

Global Flags:
      --log-flush-frequency duration   Maximum number of seconds between log flushes (default 5s)
  -v, --v Level                        number for the log level verbosity
      --vmodule moduleSpec             comma-separated list of pattern=N settings for file-filtered logging (only works for the default text log format)
  1. Add support for vcctl job get <job-name> commands

    • How to use:
      root@VM-0-17-ubuntu:~# vcctl job get job-1
      Name     Creation       Phase       JobType     Replicas    Min   Pending   Running   Succeeded   Failed    Unknown     RetryCount
      job-1    2024-05-27     Completed   Batch       1           1     0         0         1           0         0           0
  2. Add support for vcctl queue describe <queue-name> commands

    • How to use:
      root@VM-0-17-ubuntu:~# vcctl queue describe deault
      Name:         default
      Namespace:
      Labels:       <none>
      Annotations:  <none>
      API Version:  scheduling.volcano.sh/v1beta1
      Kind:         Queue
      Metadata:
      Creation Timestamp:  2024-05-26T14:27:56Z
      Generation:          1
      Resource Version:    350469
      UID:                 5ecfb13b-5597-4ec6-8811-d80256849884
      ...
  3. Add support for vcctl pod commands Users sometimes pay attention to the pods started by vcjob, so we can add a query function for this

    
    root@VM-0-17-ubuntu:/home/ubuntu# vcctl pod get --for vcjobs/job-1
    NAME                               READY   STATUS      RESTARTS   AGE
    test-a-default-nginx-0             0/1     Completed   0          23h

root@VM-0-17-ubuntu:/home/ubuntu# vcctl pod list --for vcjobs/test-a NAME READY STATUS RESTARTS AGE test-a-default-nginx-0 0/1 Completed 0 21h test-a-default-nginx-1 0/1 Completed 0 21h

Monokaix commented 5 months ago

Add support for vcctl queue describe commands

So what's the difference between this and kubectl describe queue?

googs1025 commented 5 months ago

Add support for vcctl queue describe commands

So what's the difference between this and kubectl describe queue?

Yes, there is no difference in the current design, but I think that since vcctl features are already supported, these basic features should be included. Users should not have to switch back and forth between vcctl kubectl all the time.

googs1025 commented 5 months ago

The PR https://github.com/volcano-sh/volcano/pull/3494 has been merged, maybe we can submit features in batches.

Monokaix commented 5 months ago

The PR #3494 has been merged, maybe we can submit features in batches.

Yeah you can have a try.

googs1025 commented 4 months ago

/reopen

volcano-sh-bot commented 4 months ago

@googs1025: Reopened this issue.

In response to [this](https://github.com/volcano-sh/volcano/issues/3495#issuecomment-2165600620): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
Monokaix commented 4 months ago

root@VM-0-17-ubuntu:/home/ubuntu# vcctl pod get --for vcjobs/job-1 NAME READY STATUS RESTARTS AGE test-a-default-nginx-0 0/1 Completed 0 23h

root@VM-0-17-ubuntu:/home/ubuntu# vcctl pod list --for vcjobs/test-a NAME READY STATUS RESTARTS AGE test-a-default-nginx-0 0/1 Completed 0 21h test-a-default-nginx-1 0/1 Completed 0 21h

seems that you wanna use the first command get to get a pod in a job, but didn's specify the pod name, so is there any difference between the two comands?

Monokaix commented 4 months ago

Another question is that we should unify the format of commands and determine whether resources should be placed first or verbs first: )

googs1025 commented 4 months ago

Another question is that we should unify the format of commands and determine whether resources should be placed first or verbs first: )

  • resources first:vcctl pod/vcctl job
  • verbs first: vcctl list/vcctl get

@Monokaix Yes, I totally agree with you. I also thought this was a bit strange when I first used it. This method is different from the general use of kubectl. However, since vcctl is an existing feature, I should not modify it arbitrarily. Maybe we should refactor vcctl to make vcctl more consistent with kubectl

Monokaix commented 4 months ago

Another question is that we should unify the format of commands and determine whether resources should be placed first or verbs first: )

  • resources first:vcctl pod/vcctl job
  • verbs first: vcctl list/vcctl get

@Monokaix Yes, I totally agree with you. I also thought this was a bit strange when I first used it. This method is different from the general use of kubectl. However, since vcctl is an existing feature, I should not modify it arbitrarily. Maybe we should refactor vcctl to make vcctl more consistent with kubectl

If previous using method is resources first, we can keep this way to be consistent with old habit and user-side API: )

googs1025 commented 4 months ago

I agree that we need to maintain forward compatibility. But I think it feels better to use it in a way that is more similar to kubectl. @william-wang WDYT

googs1025 commented 3 months ago

/reopen

volcano-sh-bot commented 3 months ago

@googs1025: Reopened this issue.

In response to [this](https://github.com/volcano-sh/volcano/issues/3495#issuecomment-2249746348): >/reopen > > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
googs1025 commented 3 months ago

/reopen

volcano-sh-bot commented 3 months ago

@googs1025: Reopened this issue.

In response to [this](https://github.com/volcano-sh/volcano/issues/3495#issuecomment-2261933814): >/reopen > > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
googs1025 commented 3 months ago

/reopen

volcano-sh-bot commented 3 months ago

@googs1025: Reopened this issue.

In response to [this](https://github.com/volcano-sh/volcano/issues/3495#issuecomment-2266352917): > >/reopen > > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
Monokaix commented 2 months ago

Are all the tasks are done? If that's true, we can close it now.