Skip to content

Commit

Permalink
Merge pull request #773 from jprendes/bump-youki
Browse files Browse the repository at this point in the history
[chore] bump youki
  • Loading branch information
jprendes authored Dec 19, 2024
2 parents b7de43a + a6b2f8d commit 7c755e1
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 70 deletions.
91 changes: 41 additions & 50 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ oci-tar-builder = { path = "crates/oci-tar-builder", version = "0.4.0" }
crossbeam = { version = "0.8.4", default-features = false }
env_logger = "0.11"
libc = "0.2.168"
libcontainer = { version = "0.4.1", default-features = false }
libcontainer = { git = "https://github.com/youki-dev/youki.git", default-features = false }
log = "0.4"
nix = "0.29"
oci-spec = { version = "0.6.8", features = ["runtime"] }
oci-spec = { version = "0.7.1", features = ["runtime"] }
protobuf = "=3.2"
serde = "1.0"
serde_json = "1.0"
sha256 = "1.5.0"
tar = "0.4"
tempfile = "3.10"
tempfile = "3.14"
thiserror = "1.0"
wat = "1.220"
windows-sys = "0.59"
Expand Down
8 changes: 6 additions & 2 deletions crates/containerd-shim-wasm/src/container/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl RuntimeContext for WasiContext<'_> {
#[cfg(test)]
mod tests {
use anyhow::Result;
use oci_spec::image::Descriptor;
use oci_spec::image::{Descriptor, Digest};
use oci_spec::runtime::{ProcessBuilder, RootBuilder, SpecBuilder};

use super::*;
Expand Down Expand Up @@ -370,7 +370,11 @@ mod tests {
spec: &spec,
wasm_layers: &[WasmLayer {
layer: vec![],
config: Descriptor::new(oci_spec::image::MediaType::Other("".to_string()), 10, ""),
config: Descriptor::new(
oci_spec::image::MediaType::Other("".to_string()),
10,
Digest::try_from(format!("sha256:{:064?}", 0))?,
),
}],
platform: &Platform::default(),
};
Expand Down
10 changes: 5 additions & 5 deletions crates/containerd-shim-wasm/src/sandbox/containerd/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use containerd_client::tonic::transport::Channel;
use containerd_client::tonic::Streaming;
use containerd_client::{tonic, with_namespace};
use futures::TryStreamExt;
use oci_spec::image::{Arch, ImageManifest, MediaType, Platform};
use oci_spec::image::{Arch, Digest, ImageManifest, MediaType, Platform};
use sha256::digest;
use tokio::sync::mpsc;
use tokio_stream::wrappers::ReceiverStream;
Expand Down Expand Up @@ -259,7 +259,7 @@ impl Client {
}

#[cfg_attr(feature = "tracing", tracing::instrument(parent = tracing::Span::current(), skip_all, level = "Info"))]
async fn get_info(&self, content_digest: &str) -> Result<Info> {
async fn get_info(&self, content_digest: &Digest) -> Result<Info> {
let req = InfoRequest {
digest: content_digest.to_string(),
};
Expand Down Expand Up @@ -359,9 +359,9 @@ impl Client {
async fn get_image_manifest_and_digest(
&self,
image_name: &str,
) -> Result<(ImageManifest, String)> {
) -> Result<(ImageManifest, Digest)> {
let image = self.get_image(image_name).await?;
let image_digest = self.extract_image_content_sha(&image)?;
let image_digest = self.extract_image_content_sha(&image)?.try_into()?;
let manifest =
ImageManifest::from_reader(self.read_content(&image_digest).await?.as_slice())?;
Ok((manifest, image_digest))
Expand Down Expand Up @@ -521,7 +521,7 @@ impl Client {
let info = self.get_info(&digest_to_load).await?;
if let Some(label) = info.labels.get(precompile_id) {
// Safe to unwrap here since we already checked for the label's existence
digest_to_load.clone_from(label);
digest_to_load = label.parse()?;
log::info!(
"layer {} has pre-compiled content: {} ",
info.digest,
Expand Down
Loading

0 comments on commit 7c755e1

Please sign in to comment.