Skip to content
Merged
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
13 changes: 10 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ jobs:
# The KVM job supplies both the host runtime and Agentd explicitly,
# so this archive needs neither download nor embedded binary features.
mold -run cargo nextest archive -p microsandbox --tests \
--no-default-features --features keyring,net \
--no-default-features --features keyring,local,net \
--archive-file artifacts/rust-integration-tests.tar.zst

- name: Upload nextest archive
Expand Down Expand Up @@ -548,15 +548,15 @@ jobs:
$ErrorActionPreference = "Stop"
. "$env:GITHUB_WORKSPACE\vendor\libkrunfw\scripts\msvc-env.ps1"
Set-MsvcEnvironment -Architecture ${{ matrix.vs_arch }} -HostArchitecture ${{ matrix.vs_host_arch }}
cargo +stable test --no-default-features --features net -p microsandbox-runtime --lib --target ${{ matrix.rust_target }} test_bind_rootfs_backend_exposes_host_file_and_init
cargo +stable test --no-default-features --features net,runner -p microsandbox-runtime --lib --target ${{ matrix.rust_target }} test_bind_rootfs_backend_exposes_host_file_and_init

- name: Test bind rootfs patches
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
. "$env:GITHUB_WORKSPACE\vendor\libkrunfw\scripts\msvc-env.ps1"
Set-MsvcEnvironment -Architecture ${{ matrix.vs_arch }} -HostArchitecture ${{ matrix.vs_host_arch }}
cargo +stable test --no-default-features --features net -p microsandbox --lib --target ${{ matrix.rust_target }} sandbox::patch::tests::bind_patch_
cargo +stable test --no-default-features --features local,net -p microsandbox --lib --target ${{ matrix.rust_target }} sandbox::patch::tests::bind_patch_

- name: Test Windows DNS resolver
shell: pwsh
Expand Down Expand Up @@ -750,6 +750,13 @@ jobs:
- name: Clippy
run: cargo +stable clippy --workspace --exclude microsandbox-agentd -- -D warnings

- name: Check Rust SDK feature surfaces
run: |
cargo +stable check -p microsandbox --no-default-features --features cloud,net
cargo +stable check -p microsandbox --no-default-features --features local,net
cargo +stable check -p microsandbox-runtime --no-default-features --features client,net
cargo +stable check -p microsandbox-network --no-default-features

- name: Docs
env:
RUSTDOCFLAGS: "-D warnings"
Expand Down
30 changes: 1 addition & 29 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ microsandbox-image = { version = "=0.6.14", path = "crates/image" }
microsandbox-metrics = { version = "=0.6.14", path = "crates/metrics" }
microsandbox-types = { version = "=0.6.14", path = "packages/microsandbox-types/rust" }
microsandbox-migration = { version = "=0.6.14", path = "crates/migration" }
microsandbox-network = { version = "=0.6.14", path = "crates/network" }
microsandbox-network = { version = "=0.6.14", path = "crates/network", default-features = false }
microsandbox-protocol = { version = "=0.6.14", path = "crates/protocol" }
microsandbox-runtime = { version = "=0.6.14", path = "crates/runtime", default-features = false }
microsandbox-utils = { version = "=0.6.14", path = "crates/utils" }
Expand Down
6 changes: 3 additions & 3 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ futures.workspace = true
indicatif.workspace = true
ipnetwork = { workspace = true, optional = true }
libc.workspace = true
microsandbox.workspace = true
microsandbox = { workspace = true, features = ["local"] }
microsandbox-db.workspace = true
microsandbox-filesystem.workspace = true
microsandbox-image.workspace = true
microsandbox-migration.workspace = true
microsandbox-network = { workspace = true, optional = true }
microsandbox-network = { workspace = true, features = ["engine"], optional = true }
microsandbox-protocol.workspace = true
microsandbox-runtime.workspace = true
microsandbox-runtime = { workspace = true, features = ["runner"] }
microsandbox-types.workspace = true
microsandbox-utils.workspace = true
rand.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/lib/log_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub fn init_tracing(log_level: Option<LogLevel>, ansi: bool) {
if let Some(level) = log_level {
// Silence oci_client logs — the crate logs the auth token in debug mode
// See: https://github.com/oras-project/rust-oci-client/issues/254
let filter = EnvFilter::new(level.as_tracing_level().to_string())
let filter = EnvFilter::new(level.as_str())
.add_directive("oci_client=info".parse::<Directive>().unwrap());

tracing_subscriber::fmt()
Expand Down
3 changes: 1 addition & 2 deletions crates/image/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ async-compression = { workspace = true, features = ["gzip", "tokio", "zstd"] }
chrono.workspace = true
futures.workspace = true
hex.workspace = true
libc.workspace = true
microsandbox-utils.workspace = true
microsandbox-types.workspace = true
oci-client.workspace = true
oci-spec.workspace = true
rustls-pki-types.workspace = true
Expand All @@ -28,7 +28,6 @@ sha2.workspace = true
tar.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["fs", "io-util", "rt", "sync"] }
tokio-util.workspace = true
tracing.workspace = true

[target.'cfg(windows)'.dependencies]
Expand Down
45 changes: 0 additions & 45 deletions crates/image/lib/auth.rs

This file was deleted.

3 changes: 1 addition & 2 deletions crates/image/lib/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
)]

mod archive;
mod auth;
mod cache;
mod config;
pub(crate) mod crc32c;
Expand Down Expand Up @@ -45,11 +44,11 @@ pub use archive::{
ImageArchiveFormat, ImageLoadOptions, ImageSaveConfig, ImageSaveLayer, ImageSaveRequest,
LoadedImage, load_archive, save_archive, save_docker_archive,
};
pub use auth::RegistryAuth;
pub use cache::{CachedImageMetadata, CachedLayerMetadata, FlatRootfsRef, GlobalCache};
pub use config::ImageConfig;
pub use digest::Digest;
pub use error::{ImageError, ImageResult};
pub use microsandbox_types::RegistryAuth;
pub use oci_client::Reference;
pub use platform::{Arch, Os, Platform};
pub use progress::{PullProgress, PullProgressHandle, PullProgressSender, progress_channel};
Expand Down
10 changes: 8 additions & 2 deletions crates/image/lib/registry/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ use oci_client::{
};
use rustls_pki_types::{CertificateDer, pem::PemObject};

use microsandbox_types::RegistryAuth;

use crate::{
auth::RegistryAuth,
cache::GlobalCache,
error::{ImageError, ImageResult},
platform::Platform,
Expand Down Expand Up @@ -44,7 +45,12 @@ impl RegistryBuilder {

/// Set authentication credentials for the registry.
pub fn auth(mut self, auth: RegistryAuth) -> Self {
self.auth = (&auth).into();
self.auth = match auth {
RegistryAuth::Anonymous => oci_client::secrets::RegistryAuth::Anonymous,
RegistryAuth::Basic { username, password } => {
oci_client::secrets::RegistryAuth::Basic(username, password)
}
};
self
}

Expand Down
1 change: 0 additions & 1 deletion crates/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ path = "lib/lib.rs"
chrono.workspace = true
libc.workspace = true
thiserror.workspace = true
tracing.workspace = true

[target.'cfg(target_os = "windows")'.dependencies]
windows-sys = { version = "0.61.2", features = ["Win32_Foundation", "Win32_Security", "Win32_System_Memory", "Win32_System_Threading"] }
Expand Down
Loading