aurae-runtime / aurae

Distributed systems runtime daemon written in Rust.
https://aurae.io
Apache License 2.0
1.85k stars 91 forks source link

Implement Cache for CRI #385

Closed krisnova closed 1 year ago

krisnova commented 1 year ago

Right now the CRI service code is blocked on adding a caching mechanism to the code base (similar to what we have done with cells).

Can we please add the get/set cache code into the cri_service.rs file in place of the existing todo's?

For example in order for us to stop a pod sandbox:

    async fn stop_pod_sandbox(
        &self,
        _request: Request<StopPodSandboxRequest>,
    ) -> Result<Response<StopPodSandboxResponse>, Status> {
        // TODO: Pull sandbox from cache
        // TODO: sandbox.kill()
        todo!()
    }

We need to first have the cached pod sandbox available, then we can call sandbox.kill() on the item retrieved from the cache.

krisnova commented 1 year ago

CC @dmah42

dmah42 commented 1 year ago

which branch are you working on that has the TODOs?

dmah42 commented 1 year ago

i think i found it on main

dmah42 commented 1 year ago

there are some nuances here that i'd like to get clarity on:

  1. the high level object is a PodSandbox with lower level Container objects. right now, the thing called a "sandbox" is actually a Container. so should the cache be at the container level or the pod sandbox level?
  2. we use both libcontainer::container and aurae_proto::cri, which define things like ContainerStatus for example. should we be mapping between them or is this unexpected?
krisnova commented 1 year ago

@dmah42 hopefully you saw my comment: https://github.com/aurae-runtime/aurae/pull/388#discussion_r1103509601

I might push some changes to your branch today if i can find the time/energy