Commit Graph

3 Commits

Author SHA1 Message Date
Ben Ye d14f6ac07f support metrics in notebook-controller (kubeflow/kubeflow#4123)
Signed-off-by: yeya24 <yb532204897@gmail.com>
2019-10-16 00:15:40 -07:00
Ben Ye 807843ec2a cleanup some codes in notebook controller (kubeflow/kubeflow#4098)
* cleanup some codes in notebook controller

Signed-off-by: yeya24 <yb532204897@gmail.com>

* remove ambassador in notebook controller

Signed-off-by: yeya24 <yb532204897@gmail.com>
2019-10-14 12:06:52 -07:00
Kimonas Sotirchos 08f43598c2 Culling of Idle Jupyter Notebooks (kubeflow/kubeflow#3856)
* Create a culler as a package

Helper functions for culling resources. Takes for granted that ISTIO is
installed to the system and queries Prometheus to get metrics.
Specifically, requests/{configurable time}.

If the resource should be culled, then it should be done by setting an
annotation. This way the UIs can also show that the Resource is stopping
and also easily stop a resource by making a PATCH request.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Culling logic enhancements

Add necessary ENV Vars. Culling won't happen by default. To enable it
the user will need to set the ENABLE_CULLING=true

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Misc fixes in logging and comment cleanup

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Fix typo

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Add Notebooks specific culling

Query the /api/status endpoint of each Server

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Remove the generic culling logic

We need to discuss if it would make sense to have this logic as a go
library, or use knative.

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Add unit tests

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Remove unused code

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Review changes #1

* rename `getEnvDef` to `getEnvDefault`
* Add a comment to describe how the STOP_ANNOTATION gets used

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>

* Make cluster domain configurable

Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
2019-08-26 04:40:21 -07:00