Feature: add application scopes framework and imp health scope#367
Feature: add application scopes framework and imp health scope#367wonderflow merged 5 commits intooam-dev:masterfrom
Conversation
1fddbf0 to
4d243f3
Compare
|
It seems the version of openssl installed by base image is 1.1.0 which didn't match the requirement of the updated lib. I'm trying to figure out whether I should use a new base image |
6004118 to
dfc655e
Compare
41310b6 to
330bac1
Compare
|
@technosophos @hongchaodeng I think this PR is ready for review now. I have reset all the commits and split them into four big commits. Each commit is a separated part of code so you can review them one by one. |
| | cut -d: -f1 \ | ||
| | sort -u \ | ||
| | xargs -r apt-mark manual \ | ||
| && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false |
There was a problem hiding this comment.
kube-rs 0.6.1 need openssl 1.1.1 while using apt-get in debian:stretch-slim didn't work, so I have to compile from source here.
There was a problem hiding this comment.
Maybe add the comments in the Dockerfile?
hongchaodeng
left a comment
There was a problem hiding this comment.
LGTM after nit.
The code is a great start to use Scope
| @@ -0,0 +1,117 @@ | |||
| use crate::schematic::configuration::ComponentConfiguration; | |||
| /// Network scope is defined as https://github.com/oam-dev/spec/blob/master/4.application_scopes.md#network-scope | |||
| /// Now we don't really implement network scope, this is just a framework as the spec describe. | |||
| | cut -d: -f1 \ | ||
| | sort -u \ | ||
| | xargs -r apt-mark manual \ | ||
| && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false |
There was a problem hiding this comment.
Maybe add the comments in the Dockerfile?
| @@ -0,0 +1,197 @@ | |||
| # Health Scope Controller | |||
|
|
|||
| Health Scope Controller used for periodically check health scope crd and check the health of all the components related. | |||
There was a problem hiding this comment.
| Health Scope Controller used for periodically check health scope crd and check the health of all the components related. | |
| HealthScope controller is used to periodically check the health of all the components and update health scope custom resources. |
| }; | ||
| } | ||
| } | ||
| Err(e) => log::error!("get health scope list err {}", e), |
There was a problem hiding this comment.
| Err(e) => log::error!("get health scope list err {}", e), | |
| Err(e) => error!("get health scope list err {}", e), |
|
|
||
| ## What will health scope controller do? | ||
|
|
||
| 1. periodically check all component health and update the CR status. |
There was a problem hiding this comment.
| 1. periodically check all component health and update the CR status. | |
| 1. periodically check health status of components and update the HealthScope resource status. |
| debug!("health scope aggregate loop running..."); | ||
| } | ||
| //FIXME: we could change this to use an informer if we have a runtime controller queue | ||
| std::thread::sleep(std::time::Duration::from_secs(1)); |
There was a problem hiding this comment.
1s as default might be too frequent. Maybe 5s?
| health_scope_watch.join().unwrap() | ||
| } | ||
|
|
||
| use std::{ |
There was a problem hiding this comment.
Put this in the head of file?
| } | ||
|
|
||
| type BoxFut = Box<dyn Future<Item = Response<Body>, Error = hyper::Error> + Send>; | ||
| fn serve_health(req: Request<Body>) -> BoxFut { |
| Box::new(future::ok(response)) | ||
| } | ||
|
|
||
| fn request_health(instance_name: String) -> Result<String, Error> { |
| Ok(health.to_string()) | ||
| } | ||
|
|
||
| fn aggregate_health( |
There was a problem hiding this comment.
aggregate_health -> aggregate_components_health
|
ref oam-dev/spec#156 |
|
@hongchaodeng thanks very much, all comments are fixed in the last commit |
|
@wonderflow i'll review this today. |
| } | ||
| } | ||
|
|
||
| // FIXME kube-rs client doesn't support async call so we have to wrap it in HealthFuture here. |
There was a problem hiding this comment.
This looks like a solid solution while we wait for the Kube upstream.
|
The rebase that needs to be done is really simple, so feel free to merge as soon as you have rebased. I am excited to see this new addition! |
2. check scope overlap 3. implement health scope
2. align rudr and oam 3. rust version up to 1.38 4. compile openssl 1.1.1 in DockerImage
72308eb to
b01c587
Compare
|
Thanks @technosophos , I've rebased. I noticed changes from #375 has been overrided by #366. I rebased it back here. |
|
CI has passed, merging |
This PR is mainly to add application scope framework and health scope
This PR lasts several weeks mostly because the spec is changing.
https://github.com/microsoft/hydra-spec/issues/130
https://github.com/microsoft/hydra-spec/issues/144
https://github.com/microsoft/hydra-spec/pull/133
https://github.com/microsoft/hydra-spec/pull/127
https://github.com/microsoft/hydra-spec/pull/177
https://github.com/microsoft/hydra-spec/pull/196
add application scopes framework
add health scope
This is same with #160 as we have changed repo, I have to make a new PR.
fixes #9