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

feat(agent/grpc): add gRPC server #27

Merged
merged 9 commits into from
Apr 25, 2024

Conversation

mmoreiradj
Copy link
Contributor

@mmoreiradj mmoreiradj commented Apr 23, 2024

What am I looking at ???

Add a gRPC server that will run and stream the lifecycle of the agent to a caller. For now, it only streams the data once it's done.

What still needs to be done

  • Stream the data continuously during the build and the run
  • Better error handling and logs
  • Graceful shutdown of the running workload

(In another PR.)

How can I run it ?

git [email protected]:mmoreiradj/cloudlet.git
cd cloudlet
git checkout feat/agent_grpc_server

Then the key build.code-path at src/agent/examples/config.toml to put the right path to the code.

cargo run --bin agent -- --config=./src/agent/examples/config.toml

Tip

To use the debug agent you can use the feature flag debug-agent like this:

cargo run --bin agent -F debug-agent -- --config=./src/agent/examples/config.toml

@mmoreiradj mmoreiradj self-assigned this Apr 23, 2024
@mmoreiradj mmoreiradj marked this pull request as draft April 23, 2024 18:29
@mmoreiradj mmoreiradj force-pushed the feat/agent_grpc_server branch from 11a5e26 to 96af7c9 Compare April 25, 2024 19:17
@mmoreiradj mmoreiradj marked this pull request as ready for review April 25, 2024 19:17
@mmoreiradj mmoreiradj force-pushed the feat/agent_grpc_server branch from 91a5e54 to c2b7c34 Compare April 25, 2024 19:19
Copy link
Contributor

@mfernd mfernd left a comment

Choose a reason for hiding this comment

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

I don't think the proto makes much sense, but for now they're fine...

@mmoreiradj
Copy link
Contributor Author

Merged so the VMM team can work on communication with the agent.

mmoreiradj and others added 9 commits April 25, 2024 21:50
Signed-off-by: Martin Moreira de Jesus <[email protected]>
Signed-off-by: Martin Moreira de Jesus <[email protected]>
Signed-off-by: Martin Moreira de Jesus <[email protected]>
Signed-off-by: Martin Moreira de Jesus <[email protected]>
Signed-off-by: Martin Moreira de Jesus <[email protected]>
@mmoreiradj mmoreiradj force-pushed the feat/agent_grpc_server branch from 30dfd07 to cc2d300 Compare April 25, 2024 19:51
@mmoreiradj mmoreiradj merged commit decb5bd into virt-do:main Apr 25, 2024
2 checks passed
MurielParaire pushed a commit to MurielParaire/cloudlet that referenced this pull request Apr 28, 2024
* feat(agent): add and compile workload proto service

Signed-off-by: Martin Moreira de Jesus <[email protected]>

* refactor(agent/workload): add mod.rs

Signed-off-by: Martin Moreira de Jesus <[email protected]>

* feat(agent/grpc): add service skeleton

Signed-off-by: Martin Moreira de Jesus <[email protected]>

* feat(agent/grpc): run agent on request and send result

Signed-off-by: Martin Moreira de Jesus <[email protected]>

* fix(agent/grpc): add server config in file

Signed-off-by: Martin Moreira de Jesus <[email protected]>

* fix(agent/grpc): typo

Signed-off-by: Martin Moreira de Jesus <[email protected]>

* feat(agent/grpc): add ungraceful shutdown

Signed-off-by: Martin Moreira de Jesus <[email protected]>

* nitpick: move agent.proto at root proto folder

Signed-off-by: Matéo Fernandez <[email protected]>

* refactor(grpc): use map_err instead of match

Signed-off-by: Matéo Fernandez <[email protected]>

---------

Signed-off-by: Martin Moreira de Jesus <[email protected]>
Signed-off-by: Matéo Fernandez <[email protected]>
Co-authored-by: Matéo Fernandez <[email protected]>
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.

2 participants