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

Draft: feat: node agent api implementation #70

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

EstebanBAR0N
Copy link
Contributor

In this pull request you will find the implementation of the node agent API.

The main function is separated in two parts, the grpc client and the grpc server.

The grpc client connect, register and send node status (resources) to the scheduler.

And the grpc server, implement node agent proto services to handle request from the scheduler.
The grpc server use workload_manager (node agent internal crate) functions.

@EstebanBAR0N EstebanBAR0N changed the title feat: node agent api implementation Draft: feat: node agent api implementation Aug 29, 2022
sameo and others added 20 commits August 30, 2022 09:43
Some devs were annoyed about this.

Signed-off-by: Nils Ponsard <[email protected]>
We need to re-use the service into namespace & instance. To avoid code repetition, the filter service has been made generic 
Changes have also been made in workload to use the service without it being linked to workload

Signed-off-by: Maxime <[email protected]>
Limit resource usage of container.
CPU and memory can be limited but this is not possible for disk usage yet.

Signed-off-by: Alexis Langlet <[email protected]>
Namespace service implements all the logic to manage Namespace.
Workload service implements EtcdService which is the interface to interact with etcd.

Things to know : 

- Namespace service require etcd address when initialized

- Etcd save in key => value format.
The key is the word "namespace" concatenated with the namespace name

Signed-off-by: Maxime <[email protected]>
Add routes and routes handler for namespace.  
Controller use namespace service.

- /namespace/ (GET) : Get all namespace
- /namespace  (PUT) : Create a new namespace
- /namespace/<namespace_name>/<workload_id> (DELETE) : Delete a namespace
- /namespace/<namespace_name>/<workload_id> (GET) : Get a namespace by name
- /namespace/<namespace_name>/<workload_id> (PATCH) : Update a namespace

Things to know

- function `services` is called by the server to get all the routes it needs to handle. It associates routes with middleware functions

- pagination is used on this route : /namespace
offset : start from the element <offset>
limit : retrieve a maximum of <limit> elements 

- When using pagination in get all route ,  query argument are optional but if they are used it is necessary to specify the two arguments (limit and offset). It is not possible to specify a single argument on both .


Signed-off-by: Maxime <[email protected]>
Now namespace service is created , we add it to workload service to check if namespace exist when managing workloads.

Signed-off-by: Maxime <[email protected]>
Update workload creation in order to save network settings
Update container in order to connect to specific bridge and use specified ip

Signed-off-by: Alexis Langlet <[email protected]>
Run tests in ci as root in order to test network related things

Signed-off-by: Alexis Langlet <[email protected]>
You can find the implementation of the node agent grpc client.
The role of the client is to connect, register and finally send node status to the scheduler.

Moreover, a configuration has been implemented with confy for grpc client (and server, available in the next commit).

Signed-off-by: esteban <[email protected]>
@EstebanBAR0N EstebanBAR0N force-pushed the node-agent-api-implementation branch from a2c937f to 270c313 Compare August 30, 2022 16:21
In this commit, you can find the implementation of the node agent grpc server.
This server handle scheduler request by using the workload_manager library (node agent internal crate).

Signed-off-by: esteban <[email protected]>
@EstebanBAR0N EstebanBAR0N force-pushed the node-agent-api-implementation branch from 270c313 to 2229e61 Compare August 31, 2022 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants