Compare commits

...

1 Commits

Author SHA1 Message Date
mbecker20
3c4f77cc78 0.1.11 custom DockerRunArgs Default implementation 2023-01-25 06:29:09 +00:00
10 changed files with 64 additions and 56 deletions

61
Cargo.lock generated
View File

@@ -398,7 +398,7 @@ dependencies = [
[[package]]
name = "core"
version = "0.1.10"
version = "0.1.11"
dependencies = [
"anyhow",
"async_timing_util",
@@ -414,8 +414,8 @@ dependencies = [
"hex",
"hmac",
"jwt",
"monitor_helpers 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_types 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_helpers 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_types 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"mungos",
"periphery_client",
"serde",
@@ -650,10 +650,10 @@ checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb"
[[package]]
name = "db_client"
version = "0.1.10"
version = "0.1.11"
dependencies = [
"anyhow",
"monitor_types 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_types 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"mungos",
]
@@ -1478,7 +1478,7 @@ dependencies = [
[[package]]
name = "monitor_cli"
version = "0.1.17"
version = "0.1.18"
dependencies = [
"async_timing_util",
"clap",
@@ -1489,16 +1489,16 @@ dependencies = [
"serde_derive",
"strum",
"strum_macros",
"toml 0.5.11",
"toml",
]
[[package]]
name = "monitor_client"
version = "0.1.10"
version = "0.1.11"
dependencies = [
"anyhow",
"futures-util",
"monitor_types 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_types 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"reqwest",
"serde",
"serde_derive",
@@ -1510,7 +1510,7 @@ dependencies = [
[[package]]
name = "monitor_helpers"
version = "0.1.10"
version = "0.1.11"
dependencies = [
"anyhow",
"async_timing_util",
@@ -1518,20 +1518,20 @@ dependencies = [
"bollard",
"futures",
"futures-util",
"monitor_types 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_types 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"rand",
"run_command",
"serde",
"serde_derive",
"serde_json",
"toml 0.6.0",
"toml",
]
[[package]]
name = "monitor_helpers"
version = "0.1.10"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be55fd1c4d2dc82a223f96c81ac825b6c0e6b955eedb3542e03d1a75a9df94a7"
checksum = "63b1ff7bac3697e1fc06044b669b029964b11182483ce3066e3996c5c0f66b57"
dependencies = [
"anyhow",
"async_timing_util",
@@ -1539,18 +1539,18 @@ dependencies = [
"bollard",
"futures",
"futures-util",
"monitor_types 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_types 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"rand",
"run_command",
"serde",
"serde_derive",
"serde_json",
"toml 0.6.0",
"toml",
]
[[package]]
name = "monitor_periphery"
version = "0.1.10"
version = "0.1.11"
dependencies = [
"anyhow",
"async_timing_util",
@@ -1561,8 +1561,8 @@ dependencies = [
"dotenv",
"envy",
"futures-util",
"monitor_helpers 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_types 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_helpers 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_types 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"run_command",
"serde",
"serde_derive",
@@ -1570,13 +1570,13 @@ dependencies = [
"sysinfo",
"tokio",
"tokio-util",
"toml 0.5.11",
"toml",
"tower",
]
[[package]]
name = "monitor_types"
version = "0.1.10"
version = "0.1.11"
dependencies = [
"anyhow",
"bollard",
@@ -1593,9 +1593,9 @@ dependencies = [
[[package]]
name = "monitor_types"
version = "0.1.10"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baa4230da5cad59b690e3f97b24396b11e1e716cfa530ca79aebc8aae9d39e36"
checksum = "31a6a8d9bf88d5f6f0ede8d35efa7b7018ebf4b62cf7b9d052c18eed185ca805"
dependencies = [
"anyhow",
"bollard",
@@ -1854,12 +1854,12 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
[[package]]
name = "periphery_client"
version = "0.1.10"
version = "0.1.11"
dependencies = [
"anyhow",
"futures-util",
"monitor_helpers 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_types 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_helpers 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"monitor_types 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"reqwest",
"serde",
"serde_json",
@@ -2692,15 +2692,6 @@ dependencies = [
"tracing",
]
[[package]]
name = "toml"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
dependencies = [
"serde",
]
[[package]]
name = "toml"
version = "0.6.0"

View File

@@ -1,6 +1,6 @@
[package]
name = "monitor_cli"
version = "0.1.17"
version = "0.1.18"
edition = "2021"
authors = ["MoghTech"]
description = "monitor cli | tools to setup monitor system"
@@ -18,7 +18,7 @@ async_timing_util = "0.1.14"
rand = "0.8"
serde = "1.0"
serde_derive = "1.0"
toml = "0.5"
toml = "0.6"
run_command = "0.0.5"
colored = "2"
strum = "0.24"

View File

@@ -1,6 +1,6 @@
[package]
name = "core"
version = "0.1.10"
version = "0.1.11"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -8,8 +8,8 @@ edition = "2021"
[dependencies]
# helpers = { package = "monitor_helpers", path = "../lib/helpers" }
# types = { package = "monitor_types", path = "../lib/types" }
helpers = { package = "monitor_helpers", version = "0.1.10" }
types = { package = "monitor_types", version = "0.1.10" }
helpers = { package = "monitor_helpers", version = "0.1.11" }
types = { package = "monitor_types", version = "0.1.11" }
db = { package = "db_client", path = "../lib/db_client" }
periphery = { package = "periphery_client", path = "../lib/periphery_client" }
axum_oauth2 = { path = "../lib/axum_oauth2" }

View File

@@ -1,12 +1,12 @@
[package]
name = "db_client"
version = "0.1.10"
version = "0.1.11"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
types = { package = "monitor_types", version = "0.1.10" }
types = { package = "monitor_types", version = "0.1.11" }
# types = { package = "monitor_types", path = "../types" }
mungos = "0.3.0"
anyhow = "1.0"

View File

@@ -1,6 +1,6 @@
[package]
name = "monitor_helpers"
version = "0.1.10"
version = "0.1.11"
edition = "2021"
authors = ["MoghTech"]
description = "helpers used as dependency for mogh tech monitor"
@@ -10,7 +10,7 @@ license = "GPL-3.0-or-later"
[dependencies]
# types = { package = "monitor_types", path = "../types" }
types = { package = "monitor_types", version = "0.1.10" }
types = { package = "monitor_types", version = "0.1.11" }
async_timing_util = "0.1.14"
bollard = "0.13"
anyhow = "1.0"

View File

@@ -1,6 +1,6 @@
[package]
name = "monitor_client"
version = "0.1.10"
version = "0.1.11"
edition = "2021"
authors = ["MoghTech"]
description = "a client to interact with the monitor system"
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
monitor_types = "0.1.10"
monitor_types = "0.1.11"
# monitor_types = { path = "../types" }
reqwest = { version = "0.11", features = ["json"] }
tokio-tungstenite = { version = "0.18", features=["native-tls"] }

View File

@@ -1,13 +1,13 @@
[package]
name = "periphery_client"
version = "0.1.10"
version = "0.1.11"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
helpers = { package = "monitor_helpers", version = "0.1.10" }
types = { package = "monitor_types", version = "0.1.10" }
helpers = { package = "monitor_helpers", version = "0.1.11" }
types = { package = "monitor_types", version = "0.1.11" }
# types = { package = "monitor_types", path = "../types" }
# helpers = { package = "monitor_helpers", path = "../helpers" }
tokio-tungstenite = { version = "0.18", features=["native-tls"] }

View File

@@ -1,6 +1,6 @@
[package]
name = "monitor_types"
version = "0.1.10"
version = "0.1.11"
edition = "2021"
authors = ["MoghTech"]
description = "types for the mogh tech monitor"

View File

@@ -91,7 +91,7 @@ pub struct DeploymentActionState {
}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Default, Diff, Builder)]
#[derive(Serialize, Deserialize, Debug, Clone, Diff, Builder)]
#[diff(attr(#[derive(Debug, PartialEq, Serialize)]))]
pub struct DockerRunArgs {
#[diff(attr(#[serde(skip_serializing_if = "Option::is_none")]))]
@@ -131,6 +131,23 @@ pub struct DockerRunArgs {
pub docker_account: Option<String>, // the username of the dockerhub account
}
impl Default for DockerRunArgs {
fn default() -> DockerRunArgs {
DockerRunArgs {
network: "host".to_string(),
image: Default::default(),
ports: Default::default(),
volumes: Default::default(),
environment: Default::default(),
restart: Default::default(),
post_image: Default::default(),
container_user: Default::default(),
extra_args: Default::default(),
docker_account: Default::default(),
}
}
}
fn default_network() -> String {
String::from("host")
}

View File

@@ -1,6 +1,6 @@
[package]
name = "monitor_periphery"
version = "0.1.10"
version = "0.1.11"
edition = "2021"
authors = ["MoghTech"]
description = "monitor periphery binary | run monitor periphery as system daemon"
@@ -15,8 +15,8 @@ path = "src/main.rs"
[dependencies]
# helpers = { package = "monitor_helpers", path = "../lib/helpers" }
# types = { package = "monitor_types", path = "../lib/types" }
helpers = { package = "monitor_helpers", version = "0.1.10" }
types = { package = "monitor_types", version = "0.1.10" }
helpers = { package = "monitor_helpers", version = "0.1.11" }
types = { package = "monitor_types", version = "0.1.11" }
run_command = { version = "0.0.5", features = ["async_tokio"] }
async_timing_util = "0.1.14"
tokio = { version = "1.24", features = ["full"] }
@@ -29,8 +29,8 @@ serde_json = "1.0"
bollard = "0.13"
anyhow = "1.0"
envy = "0.4"
sysinfo = "0.27.5"
toml = "0.5"
sysinfo = "0.27.7"
toml = "0.6"
daemonize = "0.4"
clap = { version = "4.0", features = ["derive"] }
futures-util = "0.3"