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

Add Schedule #1713

Merged
merged 11 commits into from
May 6, 2021
Merged

Add Schedule #1713

merged 11 commits into from
May 6, 2021

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Apr 16, 2021

What problem does this PR solve?

Fix #1693

TODO

  • Add ConcurrencyPolicy
  • Don't delete running chaos

Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

cmd/chaos-builder/schedule.go Outdated Show resolved Hide resolved
cmd/chaos-builder/schedule.go Outdated Show resolved Hide resolved
return ctrl.Result{}, nil
}

kind, ok := v1alpha1.AllKinds()[string(schedule.Spec.Type)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

v1alpha1.AllKinds() seems to contains only chaos type only, workflow type is not supported yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

As the support for Workflow, I need another discussion with @STRRL (as it needs the finished status to GC the history). I prefer to include it in another PR as this one is too big.

controllers/schedule/gc/controller.go Outdated Show resolved Hide resolved
workers: 1
load: 100
options: ["--cpu 2", "--timeout 600", "--hdd 1"]
duration: "30s"
scheduler:
Copy link
Collaborator

Choose a reason for hiding this comment

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

So we would not test scheduler seperately in every chaos. Instead we could test it once and for all?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. But we nearly didn't test scheduler in previous tests 🤦 .

I tried to write an integration test for the scheduler, through the sigs.k8s.io/controller-runtime/pkg/envtest. Would you like to help and make it easy to define and add case ? (And I think it could be added in another PR, as this one is big enough 🤦 )

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure. I'll check it out.

Copy link
Collaborator

Choose a reason for hiding this comment

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

umm, I'm a bit coinfused. Does that mean we would use envtest to create a virtual cluster, register crd and controllers, and run tests on it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Some tests are already using it, e.g. api/v1alpha1/suite_test.go.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems that suite_test.go is good to use on crds, but it has no controllers. Could we just reuse that?

Signed-off-by: YangKeao <keao.yang@yahoo.com>
Signed-off-by: YangKeao <keao.yang@yahoo.com>
Signed-off-by: YangKeao <keao.yang@yahoo.com>
Signed-off-by: YangKeao <keao.yang@yahoo.com>
Signed-off-by: YangKeao <keao.yang@yahoo.com>
Signed-off-by: YangKeao <keao.yang@yahoo.com>
@YangKeao YangKeao requested review from STRRL and Hexilee April 28, 2021 10:52
Signed-off-by: YangKeao <keao.yang@yahoo.com>
Signed-off-by: YangKeao <keao.yang@yahoo.com>
@YangKeao
Copy link
Member Author

YangKeao commented May 6, 2021

It seems no one want to review it yet. But we have to review it in the final PR about merging nirvana into the master 😛

Merge it to not block the development roadmap.

@YangKeao YangKeao merged commit 17b6d50 into chaos-mesh:nirvana May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants