Skip to content

Commit

Permalink
feat(*): Completes spike of HA stream architecture
Browse files Browse the repository at this point in the history
This adds some code for handling the event streams and a basic setup of
the wadm binary. Much of the code in the binary will likely need to be
refactored into library code, but it is good enough to prove that things
work. I might do another follow on PR to this to maybe clean up a few more
things.

Closes wasmCloud#42

Signed-off-by: Taylor Thomas <[email protected]>
  • Loading branch information
thomastaylor312 committed Mar 5, 2023
1 parent fa5680b commit 1238599
Show file tree
Hide file tree
Showing 19 changed files with 2,703 additions and 1,320 deletions.
949 changes: 938 additions & 11 deletions Cargo.lock

Large diffs are not rendered by default.

25 changes: 22 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,38 @@ name = "wadm"
version = "0.4.0"
edition = "2021"

[features]
default = []
cli = ["clap", "tracing-opentelemetry", "tracing-subscriber", "opentelemetry", "opentelemetry-otlp", "atty", "uuid"]

[dependencies]
anyhow = "1"
async-nats = "0.27"
atty = { version = "0.2", optional = true }
clap = { version = "4", features = ["derive", "cargo", "env"], optional = true }
cloudevents-sdk = "0.7"
futures = "0.3"
# One version back to avoid clashes with 0.10 of otlp
opentelemetry = { version = "0.17", features = ["rt-tokio"], optional = true }
# 0.10 to avoid protoc dep
opentelemetry-otlp = { version = "0.10", features = ["http-proto", "reqwest-client"], optional = true }
# TODO: Actually leverage prometheus
prometheus = { version = "0.13", optional = true }
serde = "1"
serde_json = "1"
sha2 = "0.10.2"
thiserror = "1"
tokio = { version = "1", features = ["full"] }
tracing = { version = "0.1", features = ["log"] }
serde = "1"
cloudevents-sdk = "0.6"
serde_json = "1"
tracing-futures = "0.2"
tracing-opentelemetry = { version = "0.17", optional = true }
tracing-subscriber = { version = "0.3.7", features = ["env-filter", "json"], optional = true }
uuid = { version = "1", optional = true }

[dev-dependencies]
serial_test = "1"

[[bin]]
name = "wadm"
path = "bin/main.rs"
required-features = ["cli"]
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
all: build test

build:
cargo build
cargo build --features cli

ifeq ($(shell nc -czt -w1 127.0.0.1 4222 || echo fail),fail)
test::
docker run --rm -d --name wadm-test -p 127.0.0.1:4222:4222 nats:2.9 -js
cargo test -- --nocapture
$(MAKE) test
docker stop wadm-test
else
test::
cargo test -- --nocapture
test:: _test
endif

# Internal test target for reuse
_test:
cargo test -- --nocapture

.PHONY: test build all
Loading

0 comments on commit 1238599

Please sign in to comment.