Skip to content

Commit

Permalink
wasi-keyvalue: remove the Redis provider
Browse files Browse the repository at this point in the history
  • Loading branch information
iawia002 committed Aug 2, 2024
1 parent a7272b8 commit bdf178f
Show file tree
Hide file tree
Showing 15 changed files with 82 additions and 712 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ jobs:
audit: ${{ steps.calculate.outputs.audit }}
preview1-adapter: ${{ steps.calculate.outputs.preview1-adapter }}
run-dwarf: ${{ steps.calculate.outputs.run-dwarf }}
run-wasi-keyvalue: ${{ steps.calculate.outputs.run-wasi-keyvalue }}
steps:
- uses: actions/checkout@v4
- id: calculate
Expand Down Expand Up @@ -242,9 +241,6 @@ jobs:
if grep -q debug names.log; then
echo run-dwarf=true >> $GITHUB_OUTPUT
fi
if grep -q wasi-keyvalue names.log; then
echo run-wasi-keyvalue=true >> $GITHUB_OUTPUT
fi
fi
matrix="$(node ./ci/build-test-matrix.js ./commits.log ./names.log $run_full)"
echo "test-matrix={\"include\":$(echo $matrix)}" >> $GITHUB_OUTPUT
Expand All @@ -260,7 +256,6 @@ jobs:
echo audit=true >> $GITHUB_OUTPUT
echo preview1-adapter=true >> $GITHUB_OUTPUT
echo run-dwarf=true >> $GITHUB_OUTPUT
echo run-wasi-keyvalue=true >> $GITHUB_OUTPUT
fi
# Build all documentation of Wasmtime, including the C API documentation,
Expand Down Expand Up @@ -742,44 +737,6 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}

# Test the `wasmtime-wasi-keyvalue` crate. Split out from the main tests
# because it needs additional database service.
test_wasi_keyvalue:
name: Test wasi-keyvalue
runs-on: ubuntu-latest
needs: determine
if: needs.determine.outputs.run-wasi-keyvalue
# Setup redis server
services:
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust
# Install Rust targets
- run: rustup target add wasm32-wasi
- run: cargo test --all-features -p wasmtime-wasi-keyvalue
env:
RUST_BACKTRACE: 1

# common logic to cancel the entire run if this job fails
- run: gh run cancel ${{ github.run_id }}
if: failure() && github.event_name != 'pull_request'
env:
GH_TOKEN: ${{ github.token }}

# Test the `wasmtime-fuzzing` crate. Split out from the main tests because
# `--all-features` brings in OCaml, which is a pain to get setup for all
# targets.
Expand Down
44 changes: 0 additions & 44 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ criterion = { version = "0.5.0", default-features = false, features = ["html_rep
rustc-hash = "1.1.0"
libtest-mimic = "0.7.0"
semver = { version = "1.0.17", default-features = false }
redis = "0.25.4"

# =============================================================================
#
Expand Down Expand Up @@ -407,7 +406,7 @@ wasi-nn = ["dep:wasmtime-wasi-nn"]
wasi-threads = ["dep:wasmtime-wasi-threads", "threads"]
wasi-http = ["component-model", "dep:wasmtime-wasi-http", "dep:tokio", "dep:hyper"]
wasi-runtime-config = ["dep:wasmtime-wasi-runtime-config"]
wasi-keyvalue = ["dep:wasmtime-wasi-keyvalue", "wasmtime-wasi-keyvalue/redis"]
wasi-keyvalue = ["dep:wasmtime-wasi-keyvalue"]
pooling-allocator = ["wasmtime/pooling-allocator", "wasmtime-cli-flags/pooling-allocator"]
component-model = [
"wasmtime/component-model",
Expand Down
4 changes: 0 additions & 4 deletions ci/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
#
# - wasm-spec-interpreter: brings in OCaml which is a pain to configure for all
# targets, tested as part of the wastime-fuzzing CI job.
#
# - wasmtime-wasi-keyvalue: additional database service dependencies, needs its
# own CI job.

cargo test \
--workspace \
Expand All @@ -23,5 +20,4 @@ cargo test \
--exclude wasmtime-wasi-nn \
--exclude wasmtime-fuzzing \
--exclude wasm-spec-interpreter \
--exclude wasmtime-wasi-keyvalue \
$@
9 changes: 0 additions & 9 deletions crates/cli-flags/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,6 @@ wasmtime_option_group! {
pub runtime_config_var: Vec<KeyValuePair>,
/// Preset data for the In-Memory provider of WASI key-value API.
pub keyvalue_in_memory_data: Vec<KeyValuePair>,
/// Grant access to the given Redis host for the Redis provider of WASI
/// key-value API.
pub keyvalue_redis_host: Vec<String>,
/// Sets the connection timeout parameter for the Redis provider of WASI
/// key-value API.
pub keyvalue_redis_connection_timeout: Option<Duration>,
/// Sets the response timeout parameter for the Redis provider of WASI
/// key-value API.
pub keyvalue_redis_response_timeout: Option<Duration>,
}

enum Wasi {
Expand Down
8 changes: 2 additions & 6 deletions crates/test-programs/src/bin/keyvalue_main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
use test_programs::keyvalue::wasi::keyvalue::{atomics, batch, store};

fn main() {
let identifier = std::env::var("IDENTIFIER").unwrap_or("".to_string());
let bucket = store::open(&identifier).unwrap();
let bucket = store::open("").unwrap();

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

let resp = bucket.list_keys(None).unwrap();
Expand Down
10 changes: 2 additions & 8 deletions crates/wasi-keyvalue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ workspace = true

[dependencies]
anyhow = { workspace = true }
wasmtime = { workspace = true, features = ["runtime", "async", "component-model"] }
wasmtime-wasi = { workspace = true }
async-trait = { workspace = true }
url = { workspace = true }
redis = { workspace = true, optional = true, features = ["tokio-comp"] }
wasmtime = { workspace = true, features = ["runtime", "component-model"] }

[dev-dependencies]
test-programs-artifacts = { workspace = true }
wasmtime-wasi = { workspace = true }
tokio = { workspace = true, features = ["macros"] }

[features]
redis = ["dep:redis"]
26 changes: 0 additions & 26 deletions crates/wasi-keyvalue/src/bindings.rs

This file was deleted.

Loading

0 comments on commit bdf178f

Please sign in to comment.