Skip to content

Commit bfc10d9

Browse files
authored
wasi-keyvalue: remove the Redis provider (bytecodealliance#9062)
* wasi-keyvalue: remove the Redis provider * fix cargo check * cargo vet prune
1 parent dbc503f commit bfc10d9

File tree

16 files changed

+82
-720
lines changed

16 files changed

+82
-720
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ jobs:
197197
audit: ${{ steps.calculate.outputs.audit }}
198198
preview1-adapter: ${{ steps.calculate.outputs.preview1-adapter }}
199199
run-dwarf: ${{ steps.calculate.outputs.run-dwarf }}
200-
run-wasi-keyvalue: ${{ steps.calculate.outputs.run-wasi-keyvalue }}
201200
steps:
202201
- uses: actions/checkout@v4
203202
- id: calculate
@@ -242,9 +241,6 @@ jobs:
242241
if grep -q debug names.log; then
243242
echo run-dwarf=true >> $GITHUB_OUTPUT
244243
fi
245-
if grep -q wasi-keyvalue names.log; then
246-
echo run-wasi-keyvalue=true >> $GITHUB_OUTPUT
247-
fi
248244
fi
249245
matrix="$(node ./ci/build-test-matrix.js ./commits.log ./names.log $run_full)"
250246
echo "test-matrix={\"include\":$(echo $matrix)}" >> $GITHUB_OUTPUT
@@ -260,7 +256,6 @@ jobs:
260256
echo audit=true >> $GITHUB_OUTPUT
261257
echo preview1-adapter=true >> $GITHUB_OUTPUT
262258
echo run-dwarf=true >> $GITHUB_OUTPUT
263-
echo run-wasi-keyvalue=true >> $GITHUB_OUTPUT
264259
fi
265260
266261
# Build all documentation of Wasmtime, including the C API documentation,
@@ -742,44 +737,6 @@ jobs:
742737
env:
743738
GH_TOKEN: ${{ github.token }}
744739

745-
# Test the `wasmtime-wasi-keyvalue` crate. Split out from the main tests
746-
# because it needs additional database service.
747-
test_wasi_keyvalue:
748-
name: Test wasi-keyvalue
749-
runs-on: ubuntu-latest
750-
needs: determine
751-
if: needs.determine.outputs.run-wasi-keyvalue
752-
# Setup redis server
753-
services:
754-
redis:
755-
# Docker Hub image
756-
image: redis
757-
# Set health checks to wait until redis has started
758-
options: >-
759-
--health-cmd "redis-cli ping"
760-
--health-interval 10s
761-
--health-timeout 5s
762-
--health-retries 5
763-
ports:
764-
# Maps port 6379 on service container to the host
765-
- 6379:6379
766-
steps:
767-
- uses: actions/checkout@v4
768-
with:
769-
submodules: true
770-
- uses: ./.github/actions/install-rust
771-
# Install Rust targets
772-
- run: rustup target add wasm32-wasi
773-
- run: cargo test --all-features -p wasmtime-wasi-keyvalue
774-
env:
775-
RUST_BACKTRACE: 1
776-
777-
# common logic to cancel the entire run if this job fails
778-
- run: gh run cancel ${{ github.run_id }}
779-
if: failure() && github.event_name != 'pull_request'
780-
env:
781-
GH_TOKEN: ${{ github.token }}
782-
783740
# Test the `wasmtime-fuzzing` crate. Split out from the main tests because
784741
# `--all-features` brings in OCaml, which is a pain to get setup for all
785742
# targets.

Cargo.lock

Lines changed: 0 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ criterion = { version = "0.5.0", default-features = false, features = ["html_rep
332332
rustc-hash = "1.1.0"
333333
libtest-mimic = "0.7.0"
334334
semver = { version = "1.0.17", default-features = false }
335-
redis = "0.25.4"
336335

337336
# =============================================================================
338337
#
@@ -407,7 +406,7 @@ wasi-nn = ["dep:wasmtime-wasi-nn"]
407406
wasi-threads = ["dep:wasmtime-wasi-threads", "threads"]
408407
wasi-http = ["component-model", "dep:wasmtime-wasi-http", "dep:tokio", "dep:hyper"]
409408
wasi-runtime-config = ["dep:wasmtime-wasi-runtime-config"]
410-
wasi-keyvalue = ["dep:wasmtime-wasi-keyvalue", "wasmtime-wasi-keyvalue/redis"]
409+
wasi-keyvalue = ["dep:wasmtime-wasi-keyvalue"]
411410
pooling-allocator = ["wasmtime/pooling-allocator", "wasmtime-cli-flags/pooling-allocator"]
412411
component-model = [
413412
"wasmtime/component-model",

ci/run-tests.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
#
1313
# - wasm-spec-interpreter: brings in OCaml which is a pain to configure for all
1414
# targets, tested as part of the wastime-fuzzing CI job.
15-
#
16-
# - wasmtime-wasi-keyvalue: additional database service dependencies, needs its
17-
# own CI job.
1815

1916
cargo test \
2017
--workspace \
@@ -23,5 +20,4 @@ cargo test \
2320
--exclude wasmtime-wasi-nn \
2421
--exclude wasmtime-fuzzing \
2522
--exclude wasm-spec-interpreter \
26-
--exclude wasmtime-wasi-keyvalue \
2723
$@

crates/cli-flags/src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,6 @@ wasmtime_option_group! {
329329
pub runtime_config_var: Vec<KeyValuePair>,
330330
/// Preset data for the In-Memory provider of WASI key-value API.
331331
pub keyvalue_in_memory_data: Vec<KeyValuePair>,
332-
/// Grant access to the given Redis host for the Redis provider of WASI
333-
/// key-value API.
334-
pub keyvalue_redis_host: Vec<String>,
335-
/// Sets the connection timeout parameter for the Redis provider of WASI
336-
/// key-value API.
337-
pub keyvalue_redis_connection_timeout: Option<Duration>,
338-
/// Sets the response timeout parameter for the Redis provider of WASI
339-
/// key-value API.
340-
pub keyvalue_redis_response_timeout: Option<Duration>,
341332
}
342333

343334
enum Wasi {

crates/test-programs/src/bin/keyvalue_main.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
use test_programs::keyvalue::wasi::keyvalue::{atomics, batch, store};
22

33
fn main() {
4-
let identifier = std::env::var("IDENTIFIER").unwrap_or("".to_string());
5-
let bucket = store::open(&identifier).unwrap();
4+
let bucket = store::open("").unwrap();
65

7-
if identifier != "" {
8-
// for In-Memory provider, we have preset this data
9-
assert_eq!(atomics::increment(&bucket, "atomics_key", 5).unwrap(), 5);
10-
}
6+
// we have preset this `atomics_key` with value 5
117
assert_eq!(atomics::increment(&bucket, "atomics_key", 1).unwrap(), 6);
128

139
let resp = bucket.list_keys(None).unwrap();

crates/wasi-keyvalue/Cargo.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ workspace = true
1212

1313
[dependencies]
1414
anyhow = { workspace = true }
15-
wasmtime = { workspace = true, features = ["runtime", "async", "component-model"] }
16-
wasmtime-wasi = { workspace = true }
17-
async-trait = { workspace = true }
18-
url = { workspace = true }
19-
redis = { workspace = true, optional = true, features = ["tokio-comp"] }
15+
wasmtime = { workspace = true, features = ["runtime", "component-model", "std"] }
2016

2117
[dev-dependencies]
2218
test-programs-artifacts = { workspace = true }
19+
wasmtime-wasi = { workspace = true }
2320
tokio = { workspace = true, features = ["macros"] }
24-
25-
[features]
26-
redis = ["dep:redis"]

crates/wasi-keyvalue/src/bindings.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)