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: stop vm when agent finished executing #43

Conversation

MurielParaire
Copy link
Contributor

What does this PR do ?

It sends a request to the agent to stop after they have finished executing the code

How to test ?

You need to open 3 command lines simultaneously and launch these three commands:

Api:

cargo run --bin api

Vmm

cargo build
sudo -E capsh --keep=1 --user=$USER --inh=cap_net_admin --addamb=cap_net_admin -- -c  'RUST_BACKTRACE=1 '$CARGO_PATH' run --bin vmm -- grpc'

Client:

cargo run --bin cli run --config-path <path_to_cloudlet>/src/cli/config/config.yaml

You should see a vm booted on the vmm terminal that launches the agent and stops as soon as the code is finished executing

@MurielParaire MurielParaire marked this pull request as ready for review May 2, 2024 17:43
@MurielParaire MurielParaire self-assigned this May 3, 2024
@MurielParaire MurielParaire force-pushed the feat/stop-agent-after-execution branch from 4ac6ebb to e45ba32 Compare May 30, 2024 18:01
Signed-off-by: Muriel Paraire <[email protected]>
@@ -44,7 +44,7 @@ pub struct CloudletShutdownResponse {
pub success: bool,
}

#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Debug, Default)]
Copy link
Contributor

Choose a reason for hiding this comment

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

By default, the Default implementation is ServerConfig { address: "", port: 0 }.

It would be better to implement it ourselves, so impl Default for ServerConfig { ... } with localhost and 50051 for default values.

@mfernd
Copy link
Contributor

mfernd commented May 30, 2024

Should the VMM be started by the API instead of manually? (since we are shutting it down when the execution is finished)

Note: closing it, and will consider it in another iteration

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