Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "3"
members = ["odorobo"]
members = ["odorobo", "odoroboctl"]

[workspace.package]
rust-version = "1.95.0"
Expand All @@ -18,6 +18,8 @@ tracing-subscriber = { version = "0.3", features = [
"fmt",
"json",
] }
ulid = { version = "1.2", features = ["serde", "uuid"] }
bytesize = { version = "2.3", features = ["serde"] }


# our crates
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sudo dnf in -y clang-devel nftables cloud-hypervisor
cargo build --release

# Run the Agent & Manager (requires write permissions to /run/odorobo)
sudo ./target/release/odorobo --manager-enabled=true # or set ODOROBO_MANAGER_ENABLED=true
sudo ./target/release/odorobo --manager-enabled # or set ODOROBO_MANAGER_ENABLED=true

# Run on other boxes
sudo ./target/release/odorobo
Expand Down
4 changes: 2 additions & 2 deletions odorobo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ serde_json = { workspace = true }
serde = { workspace = true, features = ["derive"] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
ulid = { workspace = true }
bytesize = { workspace = true }

http-body-util = "0.1"
hyper = { version = "1.9", features = ["full"] }
Expand All @@ -39,9 +41,7 @@ axum-extra = "0.12"
tower-http = { version = "0.6", features = ["trace"] }
kameo = { version = "0.20", features = ["remote"] }
ahash = { version = "0.8", features = ["serde"] }
ulid = { version = "1.2", features = ["serde", "uuid"] }
dirs = "6"
bytesize = { version = "2.3", features = ["serde"] }
ipnet = {version = "2.12", features = ["serde", "schemars08"]}
url = { version = "2.5", features = ["serde"] }
async-trait = "0.1"
Expand Down
11 changes: 5 additions & 6 deletions odorobo/src/actors/agent_actor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{config::Config, types::ObjectMetadata, messages::{Ping, Pong, agent::{AgentStatus, GetAgentStatus}, debug::PanicAgent, vm::*}, networking::actor::NetworkAgentActor, state::provisioning::actor::VMActor, utils::actor_names::{NETWORK, VM, vm_actor_id}};
use crate::{ch_driver::actor::VMActor, config::Config, messages::{Ping, Pong, agent::{AgentStatus, GetAgentStatus}, debug::PanicAgent, vm::*}, networking::actor::NetworkAgentActor, types::{ObjectMetadata, VirtualMachine}, utils::actor_names::{NETWORK, VM, vm_actor_id}};
use ahash::AHashMap;
use bytesize::ByteSize;
use cloud_hypervisor_client::models::VmConfig;
use kameo::prelude::*;
use stable_eyre::{Report, Result};
use std::ops::ControlFlow;
Expand All @@ -13,7 +12,7 @@ use kameo::error::PanicError;

pub struct VMCacheData {
actor_ref: ActorRef<VMActor>,
config: VmConfig
config: VirtualMachine
}

#[derive(RemoteActor)]
Expand Down Expand Up @@ -137,7 +136,7 @@ impl Message<MigrateVMReceive> for AgentActor {
vmid,
VMCacheData {
actor_ref: actor_ref.clone(),
config: msg.config.clone()
config: Default::default()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

empty default on cache miss?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we need to decide if the migrate messages are ch specific or used for everything. the cache is now setup to store the overall meta-manifest and the current migrate messages are ch specific. so they don't have a copy of the manfiest. we also could just get a copy from the old vm, but im not 100% sure if we want to rely on getting a copy from there.

}
);

Expand Down Expand Up @@ -285,12 +284,12 @@ impl Message<GetAgentStatus> for AgentActor {
) -> Self::Reply {

let vcpus_used_by_vms = self.vms.values()
.map(|vm| vm.config.cpus.as_ref().map(|cpu_config| cpu_config.boot_vcpus).unwrap_or(0))
.map(|vm| vm.config.data.vcpus)
.reduce(|acc, cpus| acc + cpus)
.unwrap_or(0) as u32;

let ram_used_by_vms = self.vms.values()
.map(|vm| vm.config.memory.as_ref().map(|memory_config| memory_config.size).unwrap_or(0))
.map(|vm| vm.config.data.memory.as_u64())
.reduce(|acc, memory| acc + memory)
.unwrap_or(0) as u64;

Expand Down
31 changes: 0 additions & 31 deletions odorobo/src/actors/http_actor.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
use cloud_hypervisor_client::models::{CpusConfig, MemoryConfig, PayloadConfig, VmConfig};
use kameo::prelude::*;
use crate::messages::vm::{
AgentListVMs, AgentListVMsReply, CreateVM, CreateVMReply, DeleteVM, DeleteVMReply,
ShutdownVM, ShutdownVMReply,
};
use stable_eyre::{Report, Result};

use crate::types::CreateVMRequest;

use super::scheduler_actor::SchedulerActor;

const EXTERNAL_HTTP_ADDRESS: &str = "0.0.0.0:3000";
Expand All @@ -17,34 +14,6 @@ pub struct HTTPActor {
pub scheduler: ActorRef<SchedulerActor>,
}

impl HTTPActor {
pub fn create_vm_message(request: CreateVMRequest) -> CreateVM {
CreateVM {
vmid: request.data.id,
config: VmConfig {
cpus: Some(CpusConfig {
boot_vcpus: request.data.vcpus as i32,
max_vcpus: request
.data
.max_vcpus
.map(|v| v as i32)
.unwrap_or(request.data.vcpus as i32),
..Default::default()
}),
memory: Some(MemoryConfig {
size: request.data.memory.as_u64() as i64,
..Default::default()
}),
payload: PayloadConfig {
kernel: Some(request.data.image),
..Default::default()
},
..Default::default()
},
}
}
}

impl Actor for HTTPActor {
type Args = ActorRef<SchedulerActor>;
type Error = Report;
Expand Down
2 changes: 1 addition & 1 deletion odorobo/src/actors/scheduler_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use async_trait::async_trait;
use kameo::prelude::*;
use libp2p::futures::TryStreamExt;
use crate::actors::agent_actor::AgentActor;
use crate::state::provisioning::actor::VMActor;
use crate::ch_driver::actor::VMActor;
use crate::utils::actor_cache::ActorCache;
use crate::utils::actor_cache::ActorCacheUpdater;
use crate::utils::actor_names::VM;
Expand Down
39 changes: 0 additions & 39 deletions odorobo/src/ch_api/ch.rs

This file was deleted.

Loading
Loading