Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add vcctl jobflow command #3543

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

googs1025
Copy link
Member

@googs1025 googs1025 commented Jun 24, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • Added vcctl jobflow command feature
    • create : Support -f (file) to pass in yaml file to create jobflow resource
    • delete: Support -f (file) to pass in yaml file to delete jobflow resource or -N(name) -n(namespace) to delete jobflow resource
    • describe: Support -o, --format to output in yaml or json format, -N(name) -n(namespace) to inquire
    • list: Support -n(namespace) to inquire , and --all-namespaces to list jobflows in all namespaces
    • get: Support -N(name) -n(namespace) to inquire

Which issue(s) this PR fixes:

Fixes #3495

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

Added vcctl jobflow command feature

root@VM-0-3-ubuntu:~/volcano/example/jobflow# vcctl jobflow delete -f JobFlow.yaml
Deleted JobFlow: default/test

root@VM-0-3-ubuntu:~/volcano/example/jobflow# vcctl jobflow create -f JobFlow.yaml
Created JobFlow: default/test


root@VM-0-3-ubuntu:~/volcano/_output/bin# vcctl jobflow get -N test -n default
Name    Namespace    Phase      Age
test    default      Succeed    140m

root@VM-0-3-ubuntu:~/volcano/_output/bin# vcctl jobflow list
Name     Namespace    Phase      Age
test     default      Succeed    139m
test1    default      Succeed    24m

root@VM-0-3-ubuntu:~/volcano/_output/bin# vcctl jobflow describe -N test -n default
apiVersion: flow.volcano.sh/v1alpha1
kind: JobFlow
metadata:
  creationTimestamp: "2024-06-24T11:25:59Z"
  generation: 1
  managedFields:
...

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

None


@volcano-sh-bot volcano-sh-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 24, 2024
@volcano-sh-bot volcano-sh-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jun 24, 2024
@googs1025 googs1025 force-pushed the add_jobflow_vcctl branch 2 times, most recently from c326d09 to 502a7cf Compare June 24, 2024 14:17
@googs1025 googs1025 mentioned this pull request Jun 24, 2024
5 tasks
@googs1025 googs1025 force-pushed the add_jobflow_vcctl branch 4 times, most recently from 48c1be2 to 2005ab7 Compare June 26, 2024 06:16
@Monokaix
Copy link
Member

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2024
Copy link
Member

@hwdef hwdef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@googs1025
Copy link
Member Author

/assign @william-wang /PTAL

}

jobFlowClient := versioned.NewForConfigOrDie(config)
jobFlow, err := jobFlowClient.FlowV1alpha1().JobFlows(getJobFlowFlags.Namespace).Get(ctx, getJobFlowFlags.Name, metav1.GetOptions{})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If getJobFlowFlags.Namespace == "", it will return all jobflow, we should set a default ns here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have default value.

// InitGetFlags is used to init all flags.
func InitGetFlags(cmd *cobra.Command) {
	util.InitFlags(cmd, &getJobFlowFlags.CommonFlags)
	cmd.Flags().StringVarP(&getJobFlowFlags.Name, "name", "N", "", "the name of jobflow")
	cmd.Flags().StringVarP(&getJobFlowFlags.Namespace, "namespace", "n", "default", "the namespace of jobflow")
}

@volcano-sh-bot volcano-sh-bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2024
@googs1025 googs1025 force-pushed the add_jobflow_vcctl branch 2 times, most recently from 8cc64d8 to 399aa5f Compare July 25, 2024 00:32
@Monokaix
Copy link
Member

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 25, 2024
@william-wang
Copy link
Member

@googs1025 Please add the vcctl jobflow command line to the design doc:)
https://github.com/volcano-sh/volcano/blob/master/docs/design/command-line-enhancement.md

@googs1025
Copy link
Member Author

@googs1025 Please add the vcctl jobflow command line to the design doc:) https://github.com/volcano-sh/volcano/blob/master/docs/design/command-line-enhancement.md

pr here: #3584

Copy link
Member

@william-wang william-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hwdef, william-wang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 25, 2024
Signed-off-by: googs1025 <googs1025@gmail.com>
@volcano-sh-bot volcano-sh-bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 26, 2024
@googs1025
Copy link
Member Author

googs1025 commented Jul 26, 2024

@Monokaix /PTAL lgtm label for appove

Copy link
Member

@hwdef hwdef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 1, 2024
@volcano-sh-bot volcano-sh-bot merged commit 0eddc99 into volcano-sh:master Aug 1, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enhancement vcctl features
5 participants