diff --git a/Cargo.toml b/Cargo.toml index a8fd4a2..f20a473 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,9 @@ members = [ "libs/advmac", "libs/loopdev", "shared", - "daemon", "guest", + "runtime", + "daemon", "network", "controller", ] @@ -19,62 +20,65 @@ version = "0.0.1" [workspace.dependencies] anyhow = "1.0" -thiserror = "1.0" -log = "0.4.20" -libc = "0.2" -nix = "0.28.0" +arrayvec = "0.7.4" +async-stream = "0.3.5" +async-trait = "0.1.77" +backhand = "0.14.2" byteorder = "1" -slice-copy = "0.3.0" -memchr = "2" -xz2 = "0.1" -flate2 = "1.0" +bytes = "1.5.0" +cli-tables = "0.2.1" +directories = "5.0.1" elf = "0.7.4" env_logger = "0.11.0" errno = "0.3.0" -oci-spec = "0.6.4" -backhand = "0.14.2" -sha256 = "1.5.0" -serde_json = "1.0.113" -walkdir = "2" -directories = "5.0.1" -tar = "0.4.40" -zstd = "0.13.0" -termion = "3.0.0" -path-clean = "1.0.1" -url = "2.5.0" -cli-tables = "0.2.1" -rand = "0.8.5" -arrayvec = "0.7.4" -rtnetlink = "0.14.1" -netlink-packet-route = "0.19.0" +etherparse = "0.14.2" +flate2 = "1.0" futures = "0.3.30" ipnetwork = "0.20.0" -udp-stream = "0.0.11" -smoltcp = "0.11.0" -etherparse = "0.14.2" -async-trait = "0.1.77" -bytes = "1.5.0" +libc = "0.2" +log = "0.4.20" +memchr = "2" +netlink-packet-route = "0.19.0" +nix = "0.28.0" +oci-spec = "0.6.4" path-absolutize = "3.1.1" -tokio-tun = "0.11.2" -tokio-listener = "0.3.1" -trait-variant = "0.1.1" -tokio-native-tls = "0.3.1" -signal-hook = "0.3.17" -tonic-build = "0.11.0" +path-clean = "1.0.1" prost = "0.12.3" -async-stream = "0.3.5" +rand = "0.8.5" +rtnetlink = "0.14.1" +serde_json = "1.0.113" +sha256 = "1.5.0" +signal-hook = "0.3.17" +slice-copy = "0.3.0" +smoltcp = "0.11.0" +tar = "0.4.40" +termion = "3.0.0" +thiserror = "1.0" +tokio-listener = "0.3.1" +tokio-native-tls = "0.3.1" +tokio-tun = "0.11.2" +tonic-build = "0.11.0" tower = "0.4.13" +trait-variant = "0.1.1" +udp-stream = "0.0.11" +url = "2.5.0" +walkdir = "2" +xz2 = "0.1" +zstd = "0.13.0" -[workspace.dependencies.uuid] -version = "1.6.1" -features = ["v4"] +[workspace.dependencies.clap] +version = "4.4.18" +features = ["derive"] + +[workspace.dependencies.reqwest] +version = "0.11.24" [workspace.dependencies.sys-mount] version = "3.0.0" default-features = false -[workspace.dependencies.clap] -version = "4.4.18" +[workspace.dependencies.serde] +version = "1.0.196" features = ["derive"] [workspace.dependencies.tokio] @@ -85,13 +89,10 @@ features = ["macros", "rt", "rt-multi-thread", "io-util"] version = "0.1" features = ["io-util", "net"] -[workspace.dependencies.reqwest] -version = "0.11.24" - -[workspace.dependencies.serde] -version = "1.0.196" -features = ["derive"] - [workspace.dependencies.tonic] version = "0.11.0" features = ["tls"] + +[workspace.dependencies.uuid] +version = "1.6.1" +features = ["v4"] diff --git a/controller/Cargo.toml b/controller/Cargo.toml index cd6c48a..442698f 100644 --- a/controller/Cargo.toml +++ b/controller/Cargo.toml @@ -6,26 +6,24 @@ resolver = "2" [dependencies] anyhow = { workspace = true } -log = { workspace = true } +async-stream = { workspace = true } +clap = { workspace = true } +cli-tables = { workspace = true } env_logger = { workspace = true } +krata = { path = "../shared" } +log = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } termion = { workspace = true } -cli-tables = { workspace = true } -clap = { workspace = true } tokio = { workspace = true } -tokio-stream = { workspace = true } tokio-native-tls = { workspace = true } -url = { workspace = true } +tokio-stream = { workspace = true } +tonic = { workspace = true } tower = { workspace = true } -tonic = { workspace = true} -async-stream = { workspace = true } - -[dependencies.krata] -path = "../shared" +url = { workspace = true } [lib] -path = "src/lib.rs" +name = "kratactl" [[bin]] name = "kratactl" diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index 7447eae..55c414e 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -6,56 +6,22 @@ resolver = "2" [dependencies] anyhow = { workspace = true } -log = { workspace = true } -env_logger = { workspace = true } -zstd = { workspace = true } -flate2 = { workspace = true } -tar = { workspace = true } -directories = { workspace = true } -walkdir = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -sha256 = { workspace = true } -url = { workspace = true } -reqwest = { workspace = true } -path-clean = { workspace = true } -termion = { workspace = true } -cli-tables = { workspace = true } -clap = { workspace = true } -oci-spec = { workspace = true } -backhand = { workspace = true } -uuid = { workspace = true } -ipnetwork = { workspace = true } -tokio = { workspace = true } -futures = { workspace = true } -bytes = { workspace = true } -tokio-stream = { workspace = true } -async-trait = { workspace = true } -signal-hook = { workspace = true } async-stream = { workspace = true } -tonic = { workspace = true, features = ["tls"]} - -[dependencies.krata] -path = "../shared" - -[dependencies.nix] -workspace = true -features = ["process"] - -[dependencies.advmac] -path = "../libs/advmac" - -[dependencies.loopdev] -path = "../libs/loopdev" - -[dependencies.xenclient] -path = "../libs/xen/xenclient" - -[dependencies.xenstore] -path = "../libs/xen/xenstore" +async-trait = { workspace = true } +clap = { workspace = true } +env_logger = { workspace = true } +futures = { workspace = true } +krata = { path = "../shared" } +kratart = { path = "../runtime" } +log = { workspace = true } +signal-hook = { workspace = true } +tokio = { workspace = true } +tokio-stream = { workspace = true } +tonic = { workspace = true, features = ["tls"] } +uuid = { workspace = true } [lib] -path = "src/lib.rs" +name = "kratad" [[bin]] name = "kratad" diff --git a/daemon/bin/daemon.rs b/daemon/bin/daemon.rs index 407beb9..5948cc1 100644 --- a/daemon/bin/daemon.rs +++ b/daemon/bin/daemon.rs @@ -2,7 +2,8 @@ use anyhow::Result; use clap::Parser; use env_logger::Env; use krata::dial::ControlDialAddress; -use kratad::{runtime::Runtime, Daemon}; +use kratad::Daemon; +use kratart::Runtime; use std::{ str::FromStr, sync::{atomic::AtomicBool, Arc}, diff --git a/daemon/src/control.rs b/daemon/src/control.rs index 3678d8c..7d3f252 100644 --- a/daemon/src/control.rs +++ b/daemon/src/control.rs @@ -14,10 +14,8 @@ use tokio::{ use tokio_stream::StreamExt; use tonic::{Request, Response, Status, Streaming}; -use crate::{ - event::DaemonEventContext, - runtime::{launch::GuestLaunchRequest, Runtime}, -}; +use crate::event::DaemonEventContext; +use kratart::{launch::GuestLaunchRequest, Runtime}; pub struct ApiError { message: String, @@ -67,19 +65,19 @@ impl ControlService for RuntimeControlService { request: Request, ) -> Result, Status> { let request = request.into_inner(); - let guest: GuestInfo = self - .runtime - .launch(GuestLaunchRequest { - image: &request.image, - vcpus: request.vcpus, - mem: request.mem, - env: empty_vec_optional(request.env), - run: empty_vec_optional(request.run), - debug: false, - }) - .await - .map_err(ApiError::from)? - .into(); + let guest: GuestInfo = convert_guest_info( + self.runtime + .launch(GuestLaunchRequest { + image: &request.image, + vcpus: request.vcpus, + mem: request.mem, + env: empty_vec_optional(request.env), + run: empty_vec_optional(request.run), + debug: false, + }) + .await + .map_err(ApiError::from)?, + ); Ok(Response::new(LaunchGuestReply { guest: Some(guest) })) } @@ -103,7 +101,7 @@ impl ControlService for RuntimeControlService { let guests = self.runtime.list().await.map_err(ApiError::from)?; let guests = guests .into_iter() - .map(GuestInfo::from) + .map(convert_guest_info) .collect::>(); Ok(Response::new(ListGuestsReply { guests })) } @@ -173,17 +171,6 @@ impl ControlService for RuntimeControlService { } } -impl From for GuestInfo { - fn from(value: crate::runtime::GuestInfo) -> Self { - GuestInfo { - id: value.uuid.to_string(), - image: value.image, - ipv4: value.ipv4.map(|x| x.ip().to_string()).unwrap_or_default(), - ipv6: value.ipv6.map(|x| x.ip().to_string()).unwrap_or_default(), - } - } -} - fn empty_vec_optional(value: Vec) -> Option> { if value.is_empty() { None @@ -191,3 +178,12 @@ fn empty_vec_optional(value: Vec) -> Option> { Some(value) } } + +fn convert_guest_info(value: kratart::GuestInfo) -> GuestInfo { + GuestInfo { + id: value.uuid.to_string(), + image: value.image, + ipv4: value.ipv4.map(|x| x.ip().to_string()).unwrap_or_default(), + ipv6: value.ipv6.map(|x| x.ip().to_string()).unwrap_or_default(), + } +} diff --git a/daemon/src/event.rs b/daemon/src/event.rs index 25f8604..3ff2796 100644 --- a/daemon/src/event.rs +++ b/daemon/src/event.rs @@ -6,7 +6,7 @@ use log::error; use tokio::{sync::broadcast, task::JoinHandle, time}; use uuid::Uuid; -use crate::runtime::{GuestInfo, Runtime}; +use kratart::{GuestInfo, Runtime}; pub type DaemonEvent = krata::control::watch_events_reply::Event; diff --git a/daemon/src/lib.rs b/daemon/src/lib.rs index 5cf8a9b..ed20063 100644 --- a/daemon/src/lib.rs +++ b/daemon/src/lib.rs @@ -4,15 +4,14 @@ use anyhow::Result; use control::RuntimeControlService; use event::{DaemonEventContext, DaemonEventGenerator}; use krata::{control::control_service_server::ControlServiceServer, dial::ControlDialAddress}; +use kratart::Runtime; use log::info; -use runtime::Runtime; use tokio::{net::UnixListener, task::JoinHandle}; use tokio_stream::wrappers::UnixListenerStream; use tonic::transport::{Identity, Server, ServerTlsConfig}; pub mod control; pub mod event; -pub mod runtime; pub struct Daemon { store: String, diff --git a/guest/Cargo.toml b/guest/Cargo.toml index b1444a6..2478c3a 100644 --- a/guest/Cargo.toml +++ b/guest/Cargo.toml @@ -6,32 +6,25 @@ resolver = "2" [dependencies] anyhow = { workspace = true } -log = { workspace = true } env_logger = { workspace = true } -walkdir = { workspace = true } +futures = { workspace = true } +ipnetwork = { workspace = true } +krata = { path = "../shared" } +log = { workspace = true } +nix = { workspace = true, features = ["process"] } +oci-spec = { workspace = true } +path-absolutize = { workspace = true } +rtnetlink = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } sys-mount = { workspace = true } -oci-spec = { workspace = true } -rtnetlink = { workspace = true } tokio = { workspace = true } -futures = { workspace = true } -ipnetwork = { workspace = true } -path-absolutize = { workspace = true } tokio-stream = { workspace = true } - -[dependencies.nix] -workspace = true -features = ["process"] - -[dependencies.krata] -path = "../shared" - -[dependencies.xenstore] -path = "../libs/xen/xenstore" +walkdir = { workspace = true } +xenstore = { path = "../libs/xen/xenstore" } [lib] -path = "src/lib.rs" +name = "krataguest" [[bin]] name = "krataguest" diff --git a/libs/advmac/Cargo.toml b/libs/advmac/Cargo.toml index ac0a723..cd77045 100644 --- a/libs/advmac/Cargo.toml +++ b/libs/advmac/Cargo.toml @@ -1,16 +1,15 @@ # This package is from https://github.com/GamePad64/advmac -# Edera maintains an in-tree version because of dependencies -# being out of date. +# Edera maintains an in-tree version because of dependencies being out of date. [package] name = "advmac" version.workspace = true license = "MIT" edition = "2021" +[dependencies] +arrayvec = { workspace = true, features = ["serde"] } +rand = { workspace = true } +serde = { workspace = true } + [lib] name = "advmac" - -[dependencies] -serde = { workspace = true } -rand = { workspace = true } -arrayvec = { workspace = true, features = ["serde"] } diff --git a/libs/advmac/LICENSE b/libs/advmac/LICENSE new file mode 100644 index 0000000..f3319d9 --- /dev/null +++ b/libs/advmac/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Alexander Shishenko + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/libs/loopdev/Cargo.toml b/libs/loopdev/Cargo.toml index b087946..62f1355 100644 --- a/libs/loopdev/Cargo.toml +++ b/libs/loopdev/Cargo.toml @@ -8,13 +8,10 @@ version.workspace = true license = "MIT" edition = "2021" -[lib] -name = "loopdev" - [dependencies] errno = { workspace = true } libc = { workspace = true } +nix = { workspace = true, features = ["ioctl"] } -[dependencies.nix] -workspace = true -features = ["ioctl"] +[lib] +name = "loopdev" diff --git a/libs/xen/xencall/Cargo.toml b/libs/xen/xencall/Cargo.toml index 464b4b9..33bccf5 100644 --- a/libs/xen/xencall/Cargo.toml +++ b/libs/xen/xencall/Cargo.toml @@ -4,18 +4,15 @@ version.workspace = true edition = "2021" resolver = "2" -[lib] -path = "src/lib.rs" - [dependencies] -thiserror = { workspace = true } libc = { workspace = true } log = { workspace = true } +nix = { workspace = true, features = ["ioctl"] } +thiserror = { workspace = true } uuid = { workspace = true } -[dependencies.nix] -workspace = true -features = ["ioctl"] +[lib] +name = "xencall" [dev-dependencies] env_logger = { workspace = true } diff --git a/libs/xen/xenclient/Cargo.toml b/libs/xen/xenclient/Cargo.toml index 3dfd74e..766fa7b 100644 --- a/libs/xen/xenclient/Cargo.toml +++ b/libs/xen/xenclient/Cargo.toml @@ -5,28 +5,24 @@ edition = "2021" resolver = "2" [dependencies] -thiserror = { workspace = true } -libc = { workspace = true } elf = { workspace = true } flate2 = { workspace = true } -xz2 = { workspace = true } +libc = { workspace = true } +log = { workspace = true } memchr = { workspace = true } slice-copy = { workspace = true } -log = { workspace = true } -uuid = { workspace = true } +thiserror = { workspace = true } tokio = { workspace = true } - -[dependencies.xencall] -path = "../xencall" - -[dependencies.xenstore] -path = "../xenstore" +uuid = { workspace = true } +xz2 = { workspace = true } +xencall = { path = "../xencall" } +xenstore = { path = "../xenstore" } [dev-dependencies] env_logger = { workspace = true } [lib] -path = "src/lib.rs" +name = "xenclient" [[example]] name = "xenclient-boot" diff --git a/libs/xen/xenevtchn/Cargo.toml b/libs/xen/xenevtchn/Cargo.toml index fc583a0..72fa98a 100644 --- a/libs/xen/xenevtchn/Cargo.toml +++ b/libs/xen/xenevtchn/Cargo.toml @@ -5,16 +5,13 @@ edition = "2021" resolver = "2" [dependencies] -thiserror = { workspace = true } -tokio = { workspace = true } log = { workspace = true } - -[dependencies.nix] -workspace = true -features = ["ioctl"] +thiserror = { workspace = true } +nix = { workspace = true, features = ["ioctl"] } +tokio = { workspace = true } [lib] -path = "src/lib.rs" +name = "xenevtchn" [[example]] name = "xenevtchn-simple" diff --git a/libs/xen/xenstore/Cargo.toml b/libs/xen/xenstore/Cargo.toml index 0f706ba..70ab4ef 100644 --- a/libs/xen/xenstore/Cargo.toml +++ b/libs/xen/xenstore/Cargo.toml @@ -4,16 +4,16 @@ version.workspace = true edition = "2021" resolver = "2" -[lib] -path = "src/lib.rs" - [dependencies] -thiserror = { workspace = true } -libc = { workspace = true } -log = { workspace = true } -tokio = { workspace = true } async-trait = { workspace = true } byteorder = { workspace = true } +libc = { workspace = true } +log = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true } + +[lib] +name = "xenstore" [dev-dependencies] env_logger = { workspace = true } diff --git a/network/Cargo.toml b/network/Cargo.toml index c6efd94..8464c4f 100644 --- a/network/Cargo.toml +++ b/network/Cargo.toml @@ -5,31 +5,27 @@ edition = "2021" resolver = "2" [dependencies] +advmac = { path = "../libs/advmac" } anyhow = { workspace = true } +async-trait = { workspace = true } +bytes = { workspace = true } clap = { workspace = true } -log = { workspace = true } env_logger = { workspace = true } -rtnetlink = { workspace = true } -netlink-packet-route = { workspace = true } -tokio = { workspace = true } +etherparse = { workspace = true } futures = { workspace = true } libc = { workspace = true } -udp-stream = { workspace = true } +log = { workspace = true } +netlink-packet-route = { workspace = true } +rtnetlink = { workspace = true } smoltcp = { workspace = true } -etherparse = { workspace = true } -async-trait = { workspace = true } -uuid = { workspace = true } -bytes = { workspace = true } +tokio = { workspace = true } tokio-tun = { workspace = true } - -[dependencies.advmac] -path = "../libs/advmac" - -[dependencies.xenstore] -path = "../libs/xen/xenstore" +udp-stream = { workspace = true } +uuid = { workspace = true } +xenstore = { path = "../libs/xen/xenstore" } [lib] -path = "src/lib.rs" +name = "kratanet" [[bin]] name = "kratanet" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml new file mode 100644 index 0000000..09a1c3e --- /dev/null +++ b/runtime/Cargo.toml @@ -0,0 +1,45 @@ +[package] +name = "kratart" +version.workspace = true +edition = "2021" +resolver = "2" + +[dependencies] +advmac = { path = "../libs/advmac" } +anyhow = { workspace = true } +async-stream = { workspace = true } +async-trait = { workspace = true } +backhand = { workspace = true } +bytes = { workspace = true } +clap = { workspace = true } +cli-tables = { workspace = true } +directories = { workspace = true } +env_logger = { workspace = true } +flate2 = { workspace = true } +futures = { workspace = true } +ipnetwork = { workspace = true } +krata = { path = "../shared" } +log = { workspace = true } +loopdev = { path = "../libs/loopdev" } +nix = { workspace = true, features = ["process"] } +oci-spec = { workspace = true } +path-clean = { workspace = true } +reqwest = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +sha256 = { workspace = true } +signal-hook = { workspace = true } +tar = { workspace = true } +termion = { workspace = true } +tokio = { workspace = true } +tokio-stream = { workspace = true } +tonic = { workspace = true, features = ["tls"] } +url = { workspace = true } +uuid = { workspace = true } +walkdir = { workspace = true } +zstd = { workspace = true } +xenclient = { path = "../libs/xen/xenclient" } +xenstore = { path = "../libs/xen/xenstore" } + +[lib] +name = "kratart" diff --git a/daemon/src/runtime/autoloop.rs b/runtime/src/autoloop.rs similarity index 100% rename from daemon/src/runtime/autoloop.rs rename to runtime/src/autoloop.rs diff --git a/daemon/src/runtime/cfgblk.rs b/runtime/src/cfgblk.rs similarity index 98% rename from daemon/src/runtime/cfgblk.rs rename to runtime/src/cfgblk.rs index 2a66fdb..d8921b0 100644 --- a/daemon/src/runtime/cfgblk.rs +++ b/runtime/src/cfgblk.rs @@ -1,4 +1,4 @@ -use crate::runtime::image::ImageInfo; +use crate::image::ImageInfo; use anyhow::Result; use backhand::{FilesystemWriter, NodeHeader}; use krata::launchcfg::LaunchInfo; diff --git a/daemon/src/runtime/console.rs b/runtime/src/console.rs similarity index 100% rename from daemon/src/runtime/console.rs rename to runtime/src/console.rs diff --git a/daemon/src/runtime/image/cache.rs b/runtime/src/image/cache.rs similarity index 100% rename from daemon/src/runtime/image/cache.rs rename to runtime/src/image/cache.rs diff --git a/daemon/src/runtime/image/fetch.rs b/runtime/src/image/fetch.rs similarity index 100% rename from daemon/src/runtime/image/fetch.rs rename to runtime/src/image/fetch.rs diff --git a/daemon/src/runtime/image/mod.rs b/runtime/src/image/mod.rs similarity index 98% rename from daemon/src/runtime/image/mod.rs rename to runtime/src/image/mod.rs index 9f11929..e0d15da 100644 --- a/daemon/src/runtime/image/mod.rs +++ b/runtime/src/image/mod.rs @@ -2,9 +2,9 @@ pub mod cache; pub mod fetch; pub mod name; -use crate::runtime::image::cache::ImageCache; -use crate::runtime::image::fetch::RegistryClient; -use crate::runtime::image::name::ImageName; +use crate::image::cache::ImageCache; +use crate::image::fetch::RegistryClient; +use crate::image::name::ImageName; use anyhow::{anyhow, Result}; use backhand::compression::Compressor; use backhand::{FilesystemCompressor, FilesystemWriter, NodeHeader}; diff --git a/daemon/src/runtime/image/name.rs b/runtime/src/image/name.rs similarity index 100% rename from daemon/src/runtime/image/name.rs rename to runtime/src/image/name.rs diff --git a/daemon/src/runtime/launch/mod.rs b/runtime/src/launch/mod.rs similarity index 98% rename from daemon/src/runtime/launch/mod.rs rename to runtime/src/launch/mod.rs index 2e493a6..f1077ad 100644 --- a/daemon/src/runtime/launch/mod.rs +++ b/runtime/src/launch/mod.rs @@ -11,9 +11,9 @@ use uuid::Uuid; use xenclient::{DomainConfig, DomainDisk, DomainNetworkInterface}; use xenstore::client::XsdInterface; -use crate::runtime::cfgblk::ConfigBlock; -use crate::runtime::image::{cache::ImageCache, name::ImageName, ImageCompiler, ImageInfo}; -use crate::runtime::RuntimeContext; +use crate::cfgblk::ConfigBlock; +use crate::image::{cache::ImageCache, name::ImageName, ImageCompiler, ImageInfo}; +use crate::RuntimeContext; use super::{GuestInfo, GuestState}; diff --git a/daemon/src/runtime/mod.rs b/runtime/src/lib.rs similarity index 100% rename from daemon/src/runtime/mod.rs rename to runtime/src/lib.rs diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 0e31bd3..7ecdfc1 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -6,23 +6,20 @@ resolver = "2" [dependencies] anyhow = { workspace = true } -serde = { workspace = true } libc = { workspace = true } log = { workspace = true } -tokio = { workspace = true } -url = { workspace = true } -tonic = { workspace = true } +nix = { workspace = true, features = ["ioctl", "socket"] } prost = { workspace = true } +serde = { workspace = true } +tokio = { workspace = true } +tonic = { workspace = true } +url = { workspace = true } [build-dependencies] tonic-build = { workspace = true } -[dependencies.nix] -workspace = true -features = ["ioctl", "socket"] - [lib] -path = "src/lib.rs" +name = "krata" [[example]] name = "ethtool"