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 execution contexts api #1266

Merged
merged 3 commits into from
Aug 20, 2019
Merged

Conversation

zhujian7
Copy link
Collaborator

@zhujian7 zhujian7 commented Aug 19, 2019

What this PR does / why we need it:

Add list execution contexts API to list ExecutionContexts of a tenant.
An execution context describes the context of workflow execution, including information(cluster, namespace, PVC, etc.)that workflows will use in running.

Which issue(s) this PR is related to (optional, link to 3rd issue(s)):

Fixes #

Reference to #

Special notes for your reviewer:

/cc @supereagle @cd1989

Release note:

Add execution contexts API

@caicloud-bot caicloud-bot added release-note-none Denotes a PR that doesn't merit a release note. caicloud-cla: yes Indicates the PR's author has not signed the Caicloud CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 19, 2019
@@ -88,4 +88,27 @@ var tenant = []definition.Descriptor{
},
},
},
{
Path: "/tenants/{tenant}/precheck",
Copy link
Contributor

Choose a reason for hiding this comment

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

"/tenants/{tenant}/executioncontexts" to list all execution contexts for the given tenant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done


// WorkerContextStatus describes the status of worker clusters, it contains information that affects
// pipeline execution, like reserved resources, pvc status.
type WorkerContextStatus struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

ExecutionContext {
  Spec: ...
  Status: ...
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@zhujian7 zhujian7 changed the title feat: add precheck api feat: add execution contexts api Aug 19, 2019
@caicloud-bot caicloud-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Aug 19, 2019
@zhujian7
Copy link
Collaborator Author

@cd1989 PTAL

type ExecutionContextSpec struct {
Cluster string `json:"cluster"`
Namespace string `json:"namespace"`
Integration string `json:"integration"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need integration ?

Copy link
Collaborator Author

@zhujian7 zhujian7 Aug 20, 2019

Choose a reason for hiding this comment

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

I will add a Closed phase for execution context.
If users want to use a closed execution context, they need to open the related cluster integration firstly.
So I think the integration field is useful.

@cd1989 WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to remove it.

// ExecutionContext represtents a context used to execute workflows.
type ExecutionContext struct {
// Metadata for the particular object, including name, namespace, labels, etc
meta_v1.ObjectMeta `json:"metadata,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I think ExecutionContext doesn't have concept like namespace, and also no need to use labels, it's not k8s resources, and we should not treat like that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK,I will delete it.

type ExecutionContextStatus struct {
// Phase of the execution context, could be 'Ready', 'NotReady' or 'Unknown'
Phase ExecutionContextPhase `json:"phase"`
ReservedResources map[core_v1.ResourceName]string `json:"reservedResources"`
Copy link
Contributor

Choose a reason for hiding this comment

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

You can comment what is ReservedResources with examples.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK

@zhujian7
Copy link
Collaborator Author

@cd1989 PTAL

@cd1989
Copy link
Contributor

cd1989 commented Aug 20, 2019

/lgtm

@caicloud-bot caicloud-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 20, 2019
@caicloud-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cd1989

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

@caicloud-bot caicloud-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 20, 2019
@caicloud-bot caicloud-bot merged commit e3c8259 into caicloud:master Aug 20, 2019
@zhujian7
Copy link
Collaborator Author

/cherrypick release-1.0

@caicloud-bot
Copy link
Collaborator

@zhujian7: new pull request created: #1267

In response to this:

/cherrypick release-1.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. caicloud-cla: yes Indicates the PR's author has not signed the Caicloud CLA. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants