mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-02 21:00:55 +00:00
hypha: move components into separate crates
This commit is contained in:
parent
0c11744c50
commit
e000ab2919
10
Cargo.toml
10
Cargo.toml
@ -6,7 +6,10 @@ members = [
|
|||||||
"libs/xen/xenclient",
|
"libs/xen/xenclient",
|
||||||
"libs/advmac",
|
"libs/advmac",
|
||||||
"libs/loopdev",
|
"libs/loopdev",
|
||||||
"hypha",
|
"shared",
|
||||||
|
"container",
|
||||||
|
"network",
|
||||||
|
"controller",
|
||||||
]
|
]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
@ -30,7 +33,6 @@ errno = "0.3.0"
|
|||||||
oci-spec = "0.6.4"
|
oci-spec = "0.6.4"
|
||||||
backhand = "0.14.2"
|
backhand = "0.14.2"
|
||||||
sha256 = "1.5.0"
|
sha256 = "1.5.0"
|
||||||
serde = "1.0.196"
|
|
||||||
serde_json = "1.0.113"
|
serde_json = "1.0.113"
|
||||||
walkdir = "2"
|
walkdir = "2"
|
||||||
directories = "5.0.1"
|
directories = "5.0.1"
|
||||||
@ -64,3 +66,7 @@ features = ["derive"]
|
|||||||
[workspace.dependencies.tokio]
|
[workspace.dependencies.tokio]
|
||||||
version = "1.35.1"
|
version = "1.35.1"
|
||||||
features = ["macros", "rt", "rt-multi-thread"]
|
features = ["macros", "rt", "rt-multi-thread"]
|
||||||
|
|
||||||
|
[workspace.dependencies.serde]
|
||||||
|
version = "1.0.196"
|
||||||
|
features = ["derive"]
|
||||||
|
33
container/Cargo.toml
Normal file
33
container/Cargo.toml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
[package]
|
||||||
|
name = "hyphactr"
|
||||||
|
version.workspace = true
|
||||||
|
edition = "2021"
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
anyhow = { workspace = true }
|
||||||
|
log = { workspace = true }
|
||||||
|
env_logger = { workspace = true }
|
||||||
|
walkdir = { 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 }
|
||||||
|
|
||||||
|
[dependencies.nix]
|
||||||
|
workspace = true
|
||||||
|
features = ["process"]
|
||||||
|
|
||||||
|
[dependencies.hypha]
|
||||||
|
path = "../shared"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
path = "src/lib.rs"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "hyphactr"
|
||||||
|
path = "bin/init.rs"
|
@ -1,6 +1,6 @@
|
|||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use env_logger::Env;
|
use env_logger::Env;
|
||||||
use hypha::container::init::ContainerInit;
|
use hyphactr::init::ContainerInit;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
@ -1,6 +1,6 @@
|
|||||||
use crate::shared::{LaunchInfo, LaunchNetwork};
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use futures::stream::TryStreamExt;
|
use futures::stream::TryStreamExt;
|
||||||
|
use hypha::{LaunchInfo, LaunchNetwork};
|
||||||
use ipnetwork::IpNetwork;
|
use ipnetwork::IpNetwork;
|
||||||
use log::{trace, warn};
|
use log::{trace, warn};
|
||||||
use nix::libc::{c_int, dup2, wait};
|
use nix::libc::{c_int, dup2, wait};
|
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "hypha"
|
name = "hyphactrl"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
@ -22,16 +22,13 @@ path-clean = { workspace = true }
|
|||||||
termion = { workspace = true }
|
termion = { workspace = true }
|
||||||
cli-tables = { workspace = true }
|
cli-tables = { workspace = true }
|
||||||
clap = { workspace = true }
|
clap = { workspace = true }
|
||||||
sys-mount = { workspace = true }
|
|
||||||
oci-spec = { workspace = true }
|
oci-spec = { workspace = true }
|
||||||
backhand = { workspace = true }
|
backhand = { workspace = true }
|
||||||
uuid = { workspace = true }
|
uuid = { workspace = true }
|
||||||
rtnetlink = { workspace = true }
|
|
||||||
netlink-packet-route = { workspace = true }
|
|
||||||
tokio = { workspace = true }
|
|
||||||
futures = { workspace = true }
|
|
||||||
ipnetwork = { workspace = true }
|
ipnetwork = { workspace = true }
|
||||||
smoltcp = { workspace = true }
|
|
||||||
|
[dependencies.hypha]
|
||||||
|
path = "../shared"
|
||||||
|
|
||||||
[dependencies.nix]
|
[dependencies.nix]
|
||||||
workspace = true
|
workspace = true
|
||||||
@ -54,12 +51,4 @@ path = "src/lib.rs"
|
|||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "hyphactl"
|
name = "hyphactl"
|
||||||
path = "bin/controller.rs"
|
path = "bin/control.rs"
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name = "hyphactr"
|
|
||||||
path = "bin/container.rs"
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name = "hyphanet"
|
|
||||||
path = "bin/network.rs"
|
|
@ -1,7 +1,7 @@
|
|||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use env_logger::Env;
|
use env_logger::Env;
|
||||||
use hypha::ctl::Controller;
|
use hyphactrl::ctl::Controller;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
@ -1,6 +1,4 @@
|
|||||||
pub mod autoloop;
|
pub mod autoloop;
|
||||||
pub mod container;
|
|
||||||
pub mod ctl;
|
pub mod ctl;
|
||||||
pub mod image;
|
pub mod image;
|
||||||
pub mod network;
|
|
||||||
pub mod shared;
|
pub mod shared;
|
@ -21,9 +21,6 @@ path = "../xencall"
|
|||||||
[dependencies.xenstore]
|
[dependencies.xenstore]
|
||||||
path = "../xenstore"
|
path = "../xenstore"
|
||||||
|
|
||||||
[dependencies.xenevtchn]
|
|
||||||
path = "../xenevtchn"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = { workspace = true }
|
env_logger = { workspace = true }
|
||||||
|
|
||||||
|
26
network/Cargo.toml
Normal file
26
network/Cargo.toml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
[package]
|
||||||
|
name = "hyphanet"
|
||||||
|
version.workspace = true
|
||||||
|
edition = "2021"
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
anyhow = { workspace = true }
|
||||||
|
clap = { workspace = true }
|
||||||
|
log = { workspace = true }
|
||||||
|
env_logger = { workspace = true }
|
||||||
|
rtnetlink = { workspace = true }
|
||||||
|
netlink-packet-route = { workspace = true }
|
||||||
|
tokio = { workspace = true }
|
||||||
|
futures = { workspace = true }
|
||||||
|
smoltcp = { workspace = true }
|
||||||
|
|
||||||
|
[dependencies.advmac]
|
||||||
|
path = "../libs/advmac"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
path = "src/lib.rs"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "hyphanet"
|
||||||
|
path = "bin/network.rs"
|
@ -1,7 +1,7 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use env_logger::Env;
|
use env_logger::Env;
|
||||||
use hypha::network::NetworkService;
|
use hyphanet::NetworkService;
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
struct NetworkArgs {
|
struct NetworkArgs {
|
11
shared/Cargo.toml
Normal file
11
shared/Cargo.toml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[package]
|
||||||
|
name = "hypha"
|
||||||
|
version.workspace = true
|
||||||
|
edition = "2021"
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
serde = { workspace = true }
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
path = "src/lib.rs"
|
14
shared/src/lib.rs
Normal file
14
shared/src/lib.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
pub struct LaunchNetwork {
|
||||||
|
pub link: String,
|
||||||
|
pub ipv4: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
pub struct LaunchInfo {
|
||||||
|
pub network: Option<LaunchNetwork>,
|
||||||
|
pub env: Option<Vec<String>>,
|
||||||
|
pub run: Option<Vec<String>>,
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user