Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRI Implementation from #433 #437

Closed
wants to merge 4 commits into from
Closed
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
238 changes: 238 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions auraed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ chrono = "0.4.9"
clone3 = "0.2.3"
fancy-regex = { workspace = true }
futures = "0.3.23"
vmm = { path = "../crates/hypervisor/src/vmm" } # Rename the "vmm" crate to "hypervisor"
ipnetwork = "0.20.0"
iter_tools = "0.1.4"
libc = "0.2" # TODO: Nix comes with libc, can we rely on that?
Expand Down
28 changes: 26 additions & 2 deletions auraed/src/cri/runtime_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,32 @@ impl runtime_service_server::RuntimeService for RuntimeService {
// // Metadata
// let metadata = config.metadata.expect("metadata from config");
//
// // TODO: Pull sandbox from cache
// // TODO schedule as tenant container
// let sandbox_id = request.into_inner().pod_sandbox_id;
// let mut sandboxes = self.sandboxes.lock().await;
// let sandbox = sandboxes.get(&sandbox_id)?;
//
// let scoped_syscall = create_syscall();
// // Initialize a new container builder with the AURAE_SELF_IDENTIFIER name as the "init" container running a recursive Auraed
// let container_builder = ContainerBuilder::new(
// "test-123".to_string(),
// scoped_syscall.as_ref(),
// );
//
// let container_path = crate::AURAED_RUNTIME
// .get()
// .expect("runtime")
// .pods_dir()
// .join(sandbox_id.clone());
//
// // Define the init container startup environment
//
// let tenant_container = container_builder
// .with_root_path(container_path).expect("setting pods directory")
// .as_tenant().build().expect("to add a tenant container");
//
//
// tenant_container.start().expect("starting container");
//

todo!()
}
Expand Down
27 changes: 4 additions & 23 deletions auraed/src/cri/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,16 @@
#![allow(dead_code)]

use libcontainer::container::Container;
use hypervisor::Vmm;

#[derive(Debug, Clone, Default)]
pub struct Sandbox {
/// The unique name of the Pod sandbox at runtime.
///
/// Note: This is the name of the "Pod" that can typically be associated
/// back the AURAE_RUNTIME_DIR value (which is typically "/var/run/aurae").
///
/// Note: This also is a copy of the value that is used in the cache hashmap
/// to access the Pod sandbox in the internal cache mechanism.
/// The unique name of the Pod Sandbox.
name: String,

/// Init containers are the "preliminary" container that is used to begin
/// the isolation process in a sandbox.
///
/// The init container will most often be a spawned "auraed" instance
/// running in a new namespace isolation zone that is unshared from the
/// host namespaces.
pub(crate) init: Container,

/// Tenants are the arbitrary workloads running alongside the init
/// containers in an Aurae pod.
///
/// These are usually things like an OCI compatible container image such
/// as "nginx" or "busybox".
///
/// In the case of large enterprise workload management, these specifically
/// are "your app".
pub(crate) tenants: Vec<Container>,

pub(crate) _vinit: hypervisor::Vmm,
}

pub struct SandboxBuilder {
Expand Down
Loading