Skip to content

Commit f0f3fd7

Browse files
feat: Updates tests and examples to support the new wkg deps
This updates all dependencies to have a wkg.lock but I didn't add to the gitignore for convenience. The deps are still committed in tree for backwards compatibility and they all use the new versioned logging. This looks really chunky bust is mostly dep updates/deletes Signed-off-by: Taylor Thomas <taylor@cosmonic.com>
1 parent 45b0e1c commit f0f3fd7

File tree

941 files changed

+18838
-51628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

941 files changed

+18838
-51628
lines changed

Cargo.lock

+150-160
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ normpath = { version = "1", default-features = false }
248248
notify = { version = "6", default-features = false }
249249
nuid = { version = "0.4", default-features = false }
250250
num = { version = "0.4", default-features = false }
251-
oci-distribution = { version = "0.11", default-features = false }
252-
oci-wasm = { version = "0.0.4", default-features = false }
251+
oci-client = { version = "0.13", default-features = false }
252+
oci-wasm = { version = "0.1.0", default-features = false }
253253
once_cell = { version = "1", default-features = false }
254254
opentelemetry = { version = "0.23", default-features = false }
255255
opentelemetry-appender-tracing = { version = "0.4", default-features = false }
@@ -330,17 +330,17 @@ unicase = { version = "2.7.0", default-features = false }
330330
url = { version = "2" }
331331
uuid = { version = "1", default-features = false }
332332
vaultrs = { version = "0.7", default-features = false }
333-
wadm = { version = "0.17.0", default-features = false }
333+
wadm = { version = "0.17.1", default-features = false }
334334
wadm-client = { version = "0.6.1", default-features = false }
335-
wadm-types = { version = "0.6.0", default-features = false }
335+
wadm-types = { version = "0.6.1", default-features = false }
336336
walkdir = { version = "2", default-features = false }
337337
warp = { version = "0.3", default-features = false }
338338
wascap = { version = "^0.15.0", path = "./crates/wascap", default-features = false }
339339
wash-cli = { version = "0", path = "./crates/wash-cli", default-features = false }
340340
wash-lib = { version = "^0.28.0", path = "./crates/wash-lib", default-features = false }
341341
wasi = { version = "0.13.3", default-features = false }
342-
wasm-pkg-client = { version = "0.7.4", default-features = false }
343-
wasm-pkg-core = { version = "0.7.4", default-features = false }
342+
wasm-pkg-client = { version = "0.8", default-features = false }
343+
wasm-pkg-core = { version = "0.8", default-features = false }
344344
wasi-preview1-component-adapter-provider = { version = "25", default-features = false }
345345
wasm-encoder = { version = "0.219", default-features = false }
346346
wasm-gen = { version = "0.1", default-features = false }

crates/control-interface/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async-trait = { workspace = true }
2020
bytes = { workspace = true }
2121
cloudevents-sdk = { workspace = true }
2222
futures = { workspace = true }
23-
oci-distribution = { workspace = true, features = ["rustls-tls"] }
23+
oci-client = { workspace = true, features = ["rustls-tls"] }
2424
opentelemetry = { workspace = true }
2525
opentelemetry_sdk = { workspace = true, features = [
2626
"trace",

crates/control-interface/src/types/registry.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn default_registry_type() -> String {
7272
"oci".to_string()
7373
}
7474

75-
impl TryFrom<&RegistryCredential> for oci_distribution::secrets::RegistryAuth {
75+
impl TryFrom<&RegistryCredential> for oci_client::secrets::RegistryAuth {
7676
type Error = anyhow::Error;
7777

7878
fn try_from(cred: &RegistryCredential) -> Result<Self, Self::Error> {
@@ -85,7 +85,7 @@ impl TryFrom<&RegistryCredential> for oci_distribution::secrets::RegistryAuth {
8585
username: Some(username),
8686
password: Some(password),
8787
..
88-
} => Ok(oci_distribution::secrets::RegistryAuth::Basic(
88+
} => Ok(oci_client::secrets::RegistryAuth::Basic(
8989
username.clone(),
9090
password.clone(),
9191
)),
@@ -95,7 +95,7 @@ impl TryFrom<&RegistryCredential> for oci_distribution::secrets::RegistryAuth {
9595
password: None,
9696
token: Some(token),
9797
..
98-
} => Ok(oci_distribution::secrets::RegistryAuth::Basic(
98+
} => Ok(oci_client::secrets::RegistryAuth::Basic(
9999
username.clone(),
100100
token.clone(),
101101
)),

crates/core/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ default = [
1919
]
2020
hyper-rustls = ["dep:hyper-rustls", "dep:hyper-util"]
2121
otel = []
22-
oci = ["dep:oci-distribution", "dep:oci-wasm"]
22+
oci = ["dep:oci-client", "dep:oci-wasm"]
2323

2424
[dependencies]
2525
anyhow = { workspace = true, features = ["std"] }
@@ -34,7 +34,7 @@ hyper-rustls = { workspace = true, features = [
3434
], optional = true }
3535
hyper-util = { workspace = true, optional = true }
3636
nkeys = { workspace = true }
37-
oci-distribution = { workspace = true, features = ["rustls-tls"], optional = true }
37+
oci-client = { workspace = true, features = ["rustls-tls"], optional = true }
3838
oci-wasm = { workspace = true, features = ["rustls-tls"], optional = true }
3939
once_cell = { workspace = true }
4040
provider-archive = { workspace = true }

crates/core/README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ wasmcloud-core = "0.7.0"
3333

3434
`wasmcloud-core` comes with the following features:
3535

36-
| Feature | Default? | Description |
37-
|---------------------|----------|-----------------------------------------------------------------------------------------|
38-
| hyper-rustls | yes | Enable [`hyper-rustls`][hyper-rustls] usage (see `tls` module) |
39-
| oci | yes | Enable [`oci-distribution`][oci-distribution] and [`oci-wasm`] usage (see `tls` module) |
40-
| reqwest | yes | Enable [`reqwest`][request] extensions (see `tls` module) |
41-
| rustls-native-certs | yes | Enable [`rustls-native-certs`][rustls-native-certs] (see `tls` module) |
42-
| webpki-roots | yes | Enable [`webpki-roots`][webpki-roots] (see `tls` module) |
43-
| otel | no | Enable [OpenTelemetry][otel] module support |
36+
| Feature | Default? | Description |
37+
| ------------------- | -------- | --------------------------------------------------------------------------- |
38+
| hyper-rustls | yes | Enable [`hyper-rustls`][hyper-rustls] usage (see `tls` module) |
39+
| oci | yes | Enable [`oci-client`][oci-client] and [`oci-wasm`] usage (see `tls` module) |
40+
| reqwest | yes | Enable [`reqwest`][request] extensions (see `tls` module) |
41+
| rustls-native-certs | yes | Enable [`rustls-native-certs`][rustls-native-certs] (see `tls` module) |
42+
| webpki-roots | yes | Enable [`webpki-roots`][webpki-roots] (see `tls` module) |
43+
| otel | no | Enable [OpenTelemetry][otel] module support |
4444

4545
[hyper-rustls]: https://crates.io/crates/hyper-rustls
46-
[oci-distribution]: https://crates.io/crates/oci-distribution
46+
[oci-client]: https://crates.io/crates/oci-client
4747
[reqwest]: https://crates.io/crates/reqwest
4848
[rustls-native-certs]: https://crates.io/crates/rustls-native-certs
4949
[webpki-roots]: https://crates.io/crates/webpki-roots

crates/core/src/oci.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use std::path::{Path, PathBuf};
33
use std::str::FromStr;
44

55
use anyhow::{bail, Context as _};
6-
use oci_distribution::client::ClientProtocol;
7-
use oci_distribution::client::ImageData;
8-
use oci_distribution::Reference;
6+
use oci_client::client::ClientProtocol;
7+
use oci_client::client::ImageData;
8+
use oci_client::Reference;
99
use oci_wasm::WASM_LAYER_MEDIA_TYPE;
1010
use oci_wasm::WASM_MANIFEST_MEDIA_TYPE;
1111
use tokio::fs;
@@ -36,7 +36,7 @@ pub struct OciFetcher {
3636
additional_ca_paths: Vec<PathBuf>,
3737
allow_latest: bool,
3838
allow_insecure: bool,
39-
auth: oci_distribution::secrets::RegistryAuth,
39+
auth: oci_client::secrets::RegistryAuth,
4040
}
4141

4242
impl Default for OciFetcher {
@@ -45,7 +45,7 @@ impl Default for OciFetcher {
4545
additional_ca_paths: Vec::default(),
4646
allow_latest: false,
4747
allow_insecure: false,
48-
auth: oci_distribution::secrets::RegistryAuth::Anonymous,
48+
auth: oci_client::secrets::RegistryAuth::Anonymous,
4949
}
5050
}
5151
}
@@ -158,13 +158,13 @@ impl OciFetcher {
158158
tls::load_certs_from_paths(&self.additional_ca_paths)
159159
.context("failed to load CA certs from provided paths")?
160160
.iter()
161-
.map(|cert| oci_distribution::client::Certificate {
162-
encoding: oci_distribution::client::CertificateEncoding::Der,
161+
.map(|cert| oci_client::client::Certificate {
162+
encoding: oci_client::client::CertificateEncoding::Der,
163163
data: cert.to_vec(),
164164
}),
165165
);
166166
}
167-
let c = oci_distribution::Client::new(oci_distribution::client::ClientConfig {
167+
let c = oci_client::Client::new(oci_client::client::ClientConfig {
168168
protocol,
169169
extra_root_certificates: certs,
170170
..Default::default()

crates/core/src/registry.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl From<(Option<String>, Option<String>)> for RegistryAuth {
3434
}
3535

3636
#[cfg(feature = "oci")]
37-
impl From<&RegistryAuth> for oci_distribution::secrets::RegistryAuth {
37+
impl From<&RegistryAuth> for oci_client::secrets::RegistryAuth {
3838
fn from(auth: &crate::RegistryAuth) -> Self {
3939
match auth {
4040
crate::RegistryAuth::Basic(username, password) => {
@@ -46,7 +46,7 @@ impl From<&RegistryAuth> for oci_distribution::secrets::RegistryAuth {
4646
}
4747

4848
#[cfg(feature = "oci")]
49-
impl From<RegistryAuth> for oci_distribution::secrets::RegistryAuth {
49+
impl From<RegistryAuth> for oci_client::secrets::RegistryAuth {
5050
fn from(auth: crate::RegistryAuth) -> Self {
5151
match auth {
5252
crate::RegistryAuth::Basic(username, password) => Self::Basic(username, password),

crates/core/src/tls.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ pub static NATIVE_ROOTS: Lazy<Arc<[rustls::pki_types::CertificateDer<'static>]>>
3434
});
3535

3636
#[cfg(all(feature = "rustls-native-certs", feature = "oci"))]
37-
pub static NATIVE_ROOTS_OCI: Lazy<Arc<[oci_distribution::client::Certificate]>> = Lazy::new(|| {
37+
pub static NATIVE_ROOTS_OCI: Lazy<Arc<[oci_client::client::Certificate]>> = Lazy::new(|| {
3838
NATIVE_ROOTS
3939
.iter()
40-
.map(|cert| oci_distribution::client::Certificate {
41-
encoding: oci_distribution::client::CertificateEncoding::Der,
40+
.map(|cert| oci_client::client::Certificate {
41+
encoding: oci_client::client::CertificateEncoding::Der,
4242
data: cert.to_vec(),
4343
})
4444
.collect()

crates/host/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ http-body = { workspace = true }
2727
humantime = { workspace = true }
2828
names = { workspace = true }
2929
nkeys = { workspace = true }
30-
oci-distribution = { workspace = true, features = ["rustls-tls"] }
30+
oci-client = { workspace = true, features = ["rustls-tls"] }
3131
opentelemetry-nats = { workspace = true }
3232
provider-archive = { workspace = true }
3333
rmp-serde = { workspace = true }

crates/tracing/src/traces.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ fn get_log_level_filter(log_level_override: Option<&Level>) -> EnvFilter {
325325
.add_directive("async_nats=info".parse().unwrap())
326326
.add_directive("cranelift_codegen=warn".parse().unwrap())
327327
.add_directive("hyper=info".parse().unwrap())
328-
.add_directive("oci_distribution=info".parse().unwrap());
328+
.add_directive("oci_client=info".parse().unwrap());
329329

330330
// Allow RUST_LOG to override the other directives
331331
if let Ok(rust_log) = env::var("RUST_LOG") {

crates/wash-cli/CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ The combination of wash app undeploy --all and wash app delete --all-undeployed
11321132
- <csr-id-f7582160d5bd9d7f967ada2045239bc94653cb9b/> registry image URL parsing
11331133
When URLs are submitted to `wash push` as the first argument, unless a
11341134
`--registry` is provided, the URL is parsed as an
1135-
`oci_distribution::Reference`.
1135+
`oci_client::Reference`.
11361136

11371137
It is possible for a URL like `ghcr.io/wasmCloud/img:v0.1.0` to
11381138
correctly parse *yet* fail the the `url == image.whole()` test,
@@ -1141,7 +1141,7 @@ The combination of wash app undeploy --all and wash app delete --all-undeployed
11411141

11421142
This commit performs the lowercasing of the URL and registry (if
11431143
supplied) consistently in `resolve_artifact_ref()`, ensuring that the
1144-
comparison works, and `oci_distribution::Reference`s that correctly
1144+
comparison works, and `oci_client::Reference`s that correctly
11451145
parse are used.
11461146

11471147
### Reverted

crates/wash-cli/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ indicatif = { workspace = true }
4343
nix = { workspace = true, features = ["signal"] }
4444
nkeys = { workspace = true, features = ["xkeys"] }
4545
notify = { workspace = true }
46-
oci-distribution = { workspace = true, features = ["rustls-tls"] }
46+
oci-client = { workspace = true, features = ["rustls-tls"] }
4747
oci-wasm = { workspace = true, features = ["rustls-tls"] }
4848
once_cell = { workspace = true }
4949
provider-archive = { workspace = true }
@@ -121,4 +121,4 @@ tokio = { workspace = true, features = ["macros", "net"] }
121121

122122
[package.metadata.binstall]
123123
pkg-url = "{ repo }/releases/download/{name}-v{version}/wash-{ target }{ binary-ext }"
124-
pkg-fmt = "bin"
124+
pkg-fmt = "bin"

crates/wash-cli/src/common/registry_cmd.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{collections::HashMap, path::PathBuf};
22

33
use anyhow::{bail, Context, Result};
44
use docker_credential::{get_credential, DockerCredential};
5-
use oci_distribution::Reference;
5+
use oci_client::Reference;
66
use serde_json::json;
77
use tokio::fs::File;
88
use tokio::io::AsyncWriteExt;
@@ -111,10 +111,14 @@ pub async fn registry_push(
111111
_ => resolve_registry_credentials(image.registry()).await,
112112
}?;
113113

114-
let annotations = match cmd.annotations {
115-
Some(annotations) => input_vec_to_hashmap(annotations).ok(),
116-
None => None,
117-
};
114+
let annotations = cmd.annotations.and_then(|annotations| {
115+
Some(
116+
input_vec_to_hashmap(annotations)
117+
.ok()?
118+
.into_iter()
119+
.collect(),
120+
)
121+
});
118122

119123
let (maybe_tag, digest) = push_oci_artifact(
120124
artifact_url.clone(),
@@ -151,7 +155,7 @@ fn resolve_artifact_ref(
151155
registry: &str,
152156
project_config: Option<PathBuf>,
153157
) -> Result<Reference> {
154-
// NOTE: Image URLs must be all lower case for `oci_distribution::Reference` to parse them properly
158+
// NOTE: Image URLs must be all lower case for `oci_client::Reference` to parse them properly
155159
let url = url.trim().to_ascii_lowercase();
156160
let registry = registry.trim().to_ascii_lowercase();
157161

crates/wash-cli/src/plugin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::path::PathBuf;
33
use anyhow::Context;
44
use clap::{Parser, Subcommand};
55
use futures::TryStreamExt;
6-
use oci_distribution::Reference;
6+
use oci_client::Reference;
77
use sha2::{Digest, Sha256};
88
use tokio::io::AsyncWriteExt;
99
use wash_lib::{

crates/wash-cli/tests/common/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{
88
};
99

1010
use anyhow::{bail, ensure, Context, Result};
11-
use oci_distribution::Reference;
11+
use oci_client::Reference;
1212
use rand::{distributions::Alphanumeric, Rng};
1313
use sysinfo::{ProcessExt, SystemExt};
1414
use tempfile::TempDir;
@@ -83,8 +83,8 @@ pub async fn fetch_artifact_digest(url: &str) -> Result<String> {
8383
);
8484

8585
let accept_manifest_media_types = [
86-
oci_distribution::manifest::IMAGE_MANIFEST_MEDIA_TYPE,
87-
oci_distribution::manifest::OCI_IMAGE_MEDIA_TYPE,
86+
oci_client::manifest::IMAGE_MANIFEST_MEDIA_TYPE,
87+
oci_client::manifest::OCI_IMAGE_MEDIA_TYPE,
8888
]
8989
.join(",");
9090

crates/wash-lib/CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ dangling providers/components which aren’t linked to anything<csr-unknown>
10371037
- <csr-id-f7582160d5bd9d7f967ada2045239bc94653cb9b/> registry image URL parsing
10381038
When URLs are submitted to `wash push` as the first argument, unless a
10391039
`--registry` is provided, the URL is parsed as an
1040-
`oci_distribution::Reference`.
1040+
`oci_client::Reference`.
10411041

10421042
It is possible for a URL like `ghcr.io/wasmCloud/img:v0.1.0` to
10431043
correctly parse *yet* fail the the `url == image.whole()` test,
@@ -1046,7 +1046,7 @@ dangling providers/components which aren’t linked to anything<csr-unknown>
10461046

10471047
This commit performs the lowercasing of the URL and registry (if
10481048
supplied) consistently in `resolve_artifact_ref()`, ensuring that the
1049-
comparison works, and `oci_distribution::Reference`s that correctly
1049+
comparison works, and `oci_client::Reference`s that correctly
10501050
parse are used.
10511051

10521052
### Bug Fixes (BREAKING)
@@ -1953,7 +1953,7 @@ dangling providers/components which aren’t linked to anything<csr-unknown>
19531953
- <csr-id-ae65e85bf4b8bcbc215d48664fcf6941d25de165/> v0.9.2
19541954
- <csr-id-0ed956f457a94ad390b847a46df9911e5ebb35a9/> wash v0.16.1, wash-lib v0.6.1
19551955
- <csr-id-80b104011536c03ef3c1c58a1440992defae1351/> adopt workspace dependencies
1956-
This simplifies maintenance of the repository and allows for easier
1956+
This simplifies maintenance of the repository and allows for easier
19571957
audit of the dependencies
19581958
- <csr-id-52ef5b6b1b6b01bc5e7a2c8fe3cbb2a08d4ad864/> Creates new context library
19591959
This creates a new context library with some extendable traits for

crates/wash-lib/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ ignore = { workspace = true, optional = true }
6161
indicatif = { workspace = true, optional = true }
6262
nkeys = { workspace = true }
6363
normpath = { workspace = true }
64-
oci-distribution = { workspace = true, features = ["rustls-tls"] }
64+
oci-client = { workspace = true, features = ["rustls-tls"] }
6565
oci-wasm = { workspace = true, features = ["rustls-tls"] }
6666
path-absolutize = { workspace = true, features = [
6767
"once_cell_cache",

crates/wash-lib/src/cli/mod.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use std::str::FromStr;
1515

1616
use anyhow::{bail, Context, Result};
1717
use clap::Args;
18-
use etcetera::BaseStrategy;
1918
use nkeys::{KeyPair, KeyPairType};
2019
use serde::{Deserialize, Serialize};
2120
use serde_json::json;
@@ -307,12 +306,8 @@ impl CommonPackageArgs {
307306
let dir = if let Some(dir) = self.cache.as_ref() {
308307
dir.clone()
309308
} else {
310-
// We're using native strategy here because it matches what `dirs` does with computing the cache dir
311-
etcetera::base_strategy::choose_native_strategy()
312-
.context("unable to find cache directory")?
313-
.cache_dir()
309+
FileCache::global_cache_path().context("failed to get global cache dir")?
314310
};
315-
let dir = dir.join("wkg");
316311
FileCache::new(dir).await
317312
}
318313

crates/wash-lib/src/registry.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//! Utilities for pulling and pushing artifacts to various registries
22
33
use std::{
4-
collections::HashMap,
4+
collections::BTreeMap,
55
path::{Path, PathBuf},
66
};
77

88
use anyhow::{bail, Context as _, Result};
9-
use oci_distribution::manifest::OciImageManifest;
10-
use oci_distribution::{
9+
use oci_client::manifest::OciImageManifest;
10+
use oci_client::{
1111
client::{Client, ClientConfig, ClientProtocol, Config, ImageLayer},
1212
secrets::RegistryAuth,
1313
Reference,
@@ -58,7 +58,7 @@ pub struct OciPushOptions {
5858
/// Whether or not OCI registry's certificate will be checked for validity. This will make your HTTPS connections insecure.
5959
pub insecure_skip_tls_verify: bool,
6060
/// Optional annotations you'd like to add to the pushed artifact
61-
pub annotations: Option<HashMap<String, String>>,
61+
pub annotations: Option<BTreeMap<String, String>>,
6262
}
6363

6464
/// The types of artifacts that wash supports
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
*.o

0 commit comments

Comments
 (0)