Skip to content

Commit

Permalink
Merge branch 'nightly' into release/nightly/bin/nanocld/0.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leon3s authored May 31, 2024
2 parents 3b39f7f + c224844 commit 8b770bf
Show file tree
Hide file tree
Showing 61 changed files with 1,310 additions and 807 deletions.
418 changes: 263 additions & 155 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img src="https://download.next-hat.com/ressources/images/logo.png" >
<img width="200" height="200" src="https://download.next-hat.com/ressources/images/logo.png" >
<h1>Nanocl</h1>
<p>

Expand Down Expand Up @@ -35,7 +35,7 @@
`Nanocl` is all about easing your container and VM management with Rust-powered platform.
With `Nanocl`, say goodbye to complex setups and hello to easy, efficient deployments.
We stand for robust performance and efficiency with simplicity, trimming the bloat to keep your systems lean.
**_Join us and help shape the future of cloud computing - it's about time things got a bit more rusty_**.
**_Join our [discord][discord] and help shape the future of cloud computing - it's about time things got a bit more rusty_**.

## 📙 Table of Contents

Expand Down
4 changes: 2 additions & 2 deletions bin/nanocl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ serde_yaml = "0.9"
tabled = "0.15"
indicatif = "0.17"
serde_json = "1.0"
ntex = { version = "1.2", features = ["tokio", "openssl"] }
ntex = { version = "2", features = ["tokio", "openssl"] }
serde = { version = "1.0", features = ["derive"] }
clap = { version = "4.5", features = ["derive", "cargo"] }
tokio = { version = "1.36", features = ["fs"] }
Expand All @@ -70,7 +70,7 @@ nanocl_utils = { version = "0.6", features = ["unix"] }
ctrlc = "3.4"
toml = "0.8"
ring = "0.17"
nix = { version = "0.28", features = ["user"] }
nix = { version = "0.29", features = ["user"] }
dotenvy = "0.15"
openssl = "0.10"
async-recursion = "1.1"
Expand Down
6 changes: 3 additions & 3 deletions bin/nanocl/src/commands/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ fn gen_client(
url,
version: Some(version.into()),
..Default::default()
})
})?
}
api_version if state_ref.data.api_version.starts_with('v') => {
NanocldClient::connect_to(&ConnectOpts {
Expand All @@ -257,7 +257,7 @@ fn gen_client(
.ssl
.clone(),
version: Some(api_version.clone()),
})
})?
}
_ => {
let mut paths = state_ref
Expand All @@ -278,7 +278,7 @@ fn gen_client(
url,
version: Some(version.into()),
..Default::default()
})
})?
}
};
Ok(client)
Expand Down
33 changes: 28 additions & 5 deletions bin/nanocl/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::Parser;
use dotenvy::dotenv;

use nanocld_client::{ConnectOpts, NanocldClient};
use nanocld_client::{stubs::system::SslConfig, ConnectOpts, NanocldClient};
use nanocl_error::io::{IoError, IoResult};

mod utils;
Expand Down Expand Up @@ -29,7 +29,6 @@ fn create_cli_config(cli_args: &Cli) -> IoResult<CliConfig> {
}
}
let endpoint = context.endpoints.get("Nanocl").unwrap();
#[allow(unused)]
let mut host = cli_args.host.clone().unwrap_or(endpoint.host.clone());
#[cfg(any(feature = "dev", feature = "test"))]
{
Expand All @@ -40,11 +39,35 @@ fn create_cli_config(cli_args: &Cli) -> IoResult<CliConfig> {
.unwrap_or("http://nanocl.internal:8585".into());
}
}
let mut ssl = match &endpoint.ssl {
Some(ssl) => {
let cert = std::fs::read_to_string(ssl.cert.clone().unwrap())?;
let cert_key = std::fs::read_to_string(ssl.cert_key.clone().unwrap())?;
Some(SslConfig {
cert: Some(cert),
cert_key: Some(cert_key),
..Default::default()
})
}
None => None,
};
if let Ok(c) = std::env::var("CERT") {
if let Ok(ck) = std::env::var("CERT_KEY") {
ssl = Some(SslConfig {
cert: Some(c),
cert_key: Some(ck),
..Default::default()
});
}
}
if let Ok(h) = std::env::var("HOST") {
host = h;
}
let client = NanocldClient::connect_to(&ConnectOpts {
url: host.clone(),
ssl: endpoint.ssl.clone(),
ssl,
..Default::default()
});
})?;
Ok(CliConfig {
host,
client,
Expand Down Expand Up @@ -160,7 +183,7 @@ mod tests {
// Try to stop a cargo
assert_cli_ok!("cargo", "stop", CARGO_NAME);
// Try to remove cargo
assert_cli_ok!("cargo", "rm", "-yf", CARGO_NAME);
assert_cli_ok!("cargo", "rm", "-y", CARGO_NAME);
}

/// Test state file when then include other state files
Expand Down
1 change: 1 addition & 0 deletions bin/nanocl/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub mod tests {
url: "http://nanocl.internal:8585".into(),
..Default::default()
})
.expect("Failed to create a nanocl client")
}

#[macro_export]
Expand Down
5 changes: 3 additions & 2 deletions bin/nanocld/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ clap = { version = "4.5", features = ["derive"] }
url = { version = "2", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
uuid = { version = "1.8", features = ["serde", "v4"] }
ntex = { version = "1.2", features = ["tokio", "openssl"] }
ntex = { version = "2", features = ["tokio", "openssl"] }
diesel = { version = "2.1", features = [
"postgres",
"r2d2",
"chrono",
"uuid",
"serde_json",
"i-implement-a-third-party-backend-and-opt-into-breaking-changes",
] }
tokio = { version = "1.36", features = ["fs", "process", "io-std"] }
tokio-util = "0.7"
Expand All @@ -83,6 +84,6 @@ nanocl_stubs = { version = "0.15", features = ["serde", "clap"] }
nanocl_utils = { version = "0.6", features = ["unix", "ntex", "logger"] }
utoipa = { version = "4.2", features = ["yaml"], optional = true }
notify = "6.1"
ntex-cors = "1.0"
ntex-cors = "2"
rand = "0.8"
openssl = { version = "0.10" }
24 changes: 20 additions & 4 deletions bin/nanocld/specs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3643,10 +3643,8 @@ components:
description: Generic filter for list operation
properties:
where:
type: object
description: Where clause
additionalProperties:
$ref: '#/components/schemas/GenericClause'
allOf:
- $ref: '#/components/schemas/GenericWhere'
nullable: true
limit:
type: integer
Expand All @@ -3658,6 +3656,12 @@ components:
description: Offset to navigate through items
nullable: true
minimum: 0
order_by:
type: array
items:
type: string
description: Order by
nullable: true
GenericResources:
type: object
properties:
Expand Down Expand Up @@ -3688,6 +3692,18 @@ components:
Value:
type: string
nullable: true
GenericWhere:
type: object
properties:
or:
type: array
items:
type: object
additionalProperties:
$ref: '#/components/schemas/GenericClause'
nullable: true
additionalProperties:
$ref: '#/components/schemas/GenericClause'
GraphDriverData:
type: object
description: Information about the storage driver used to store the container's and image's filesystem.
Expand Down
Loading

0 comments on commit 8b770bf

Please sign in to comment.