k8s-AppController
k8s-AppController copied to clipboard
Improved status reporting
This commit rewrites status reporting used to control deployment progress and get-status command
- Old reporter machinery was removed
- Resource classes were simplified:
- they no longer wrap resources in SimpleReporter
- they do not care about their metadata
- Status method was replaced with GetProgress which reports deployment progress in float number 0..1. Most resources have either 0 or 1, but replicated resources can have all the variety
- resources no longer dial with reporting
- handling of success factor is now done in scheduler As a result resource classes are now much simpler
On top of that new status methods were added that collect overall deployment statistics and detailed per-resource status table. Both can be retrieved using get-status CLI command
I like the idea for moving test for success factor to scheduler, gaining in same time a possibility to test it e.x. for daemonsets, when someone would be so crazy that he would want to depend on smaller number of replicas from a number set as desired :)
Reviewed 53 of 53 files at r1. Review status: all files reviewed at latest revision, 7 unresolved discussions, some commit checks failed.
docs/flows.md, line 245 at r1 (raw file):
One possible solution is to utilize technique shown above: make parameter value be part of resource name and them duplicate the dependency that leads to this resource and pass different parameter value along each of
and then duplicate... Also white space at the end of line.
docs/flows.md, line 251 at r1 (raw file):
Luckily, the dependencies can be automatically replicated. This is done through the `generateFor` field of the `Dependency` object. `generateFor` is a map where keys are argument names and values are list expressions. Each list
Each expression list...
docs/flows.md, line 256 at r1 (raw file):
Then the dependency is going to be replicated automatically with each replica getting on of the list values as an additional argument. There can be several `generateFor` arguments. In this case there is going to be one dependency for each combination of the list values. For example
Missing : at the end of line.
docs/flows.md, line 270 at r1 (raw file):
has the same effect as
Replace space at end of line with :.
e2e/flows_test.go, line 37 at r1 (raw file):
Eventually(func() int { return framework.countJobs("a-job-", false) }, 300*time.Second, 5*time.Second).Should(Equal(1), "1 a-job* should have been created")
Hmmm... Quite long times... It has to be full 5min there? Also time between checks - there is so many cases, each having 5sec for it. This can lead to quite big change in tests longevity.
Btw. I know that I should ask for this previously, but these tests just screams for putting them into table, with fields: func, string argument, bool argument, integer value to equal, failure description text.
e2e/utils/appcmanager.go, line 57 at r1 (raw file):
// RunWithOptions runs dependency graph deployment with given settings func (a *AppControllerManager) RunWithOptions(runAsync bool, options interfaces.DependencyGraphOptions) {
I would prefer to introduce there second func - RunAsynchronouslyWithOptions, which would call that func at the start.
Adding runAsync parameter without changing func name there is a bit misleading - at first look few lines above I didn't know for what first parameter was introduced, needed to look forward on func metric.
pkg/client/flows.go, line 170 at r1 (raw file):
} func (r *replicas) Update(replica *Replica) error {
Missing docstring.
Comments from Reviewable
Review status: all files reviewed at latest revision, 7 unresolved discussions, some commit checks failed.
docs/flows.md, line 251 at r1 (raw file):
Previously, jellonek (Piotr Skamruk) wrote…
Each expression list...
expression list = list of expressions. expression list is an expression which expresses the list. 1..3 is a list expression
docs/flows.md, line 256 at r1 (raw file):
Previously, jellonek (Piotr Skamruk) wrote…
Missing
:at the end of line.
comma, I'd say because the sentence continues after example
docs/flows.md, line 270 at r1 (raw file):
Previously, jellonek (Piotr Skamruk) wrote…
Replace space at end of line with
:.
same as above, the example is part of the sentence, "For example, X has the same effect as Y", just X and Y are yamls
e2e/flows_test.go, line 37 at r1 (raw file):
Previously, jellonek (Piotr Skamruk) wrote…
Hmmm... Quite long times... It has to be full 5min there? Also time between checks - there is so many cases, each having 5sec for it. This can lead to quite big change in tests longevity.
Btw. I know that I should ask for this previously, but these tests just screams for putting them into table, with fields: func, string argument, bool argument, integer value to equal, failure description text.
It doesn't increases running time since this is the maximum allowed time and in reality, all the checks pass instantly after deployment finishes. It doesn't matter if it is 5min or 5 hours. But if CI goes slower at least it won't fail
I'll try to change it to a table
Comments from Reviewable
Comments were addressed either here or in previous PRs where the issue was introduced