-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update build process for tcp-packet-parse
- update the build rule to use wasm-pack for optimized binaries - update dockerfile and makefile to mount docker volume according to build rule - add wasm-bindgen dependency Signed-off-by: Rudraksh Pareek <[email protected]>
- Loading branch information
1 parent
362a962
commit 6ad4a5a
Showing
3 changed files
with
24 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ crate-type = ["cdylib"] | |
|
||
[dependencies] | ||
proxy-wasm = "0.1.0" | ||
wasm-bindgen = "0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
build: | ||
cargo +nightly build --target=wasm32-unknown-unknown --release | ||
# check wether compiled with wasm-pack | ||
ifeq ($(shell test -e ./pkg/tcp_packet_parse_bg.wasm && echo -n y),y) | ||
WASM_PATH=./pkg/tcp_packet_parse_bg.wasm | ||
endif | ||
|
||
# a small optimized binary without debug info, useful for releases | ||
build: clean | ||
wasm-pack build --release | ||
|
||
# a large binary with debug info and no optimizations, useful | ||
# while debugging | ||
build-unoptimized: clean | ||
cargo +nightly build --target=wasm32-unknown-unknown --release | ||
|
||
# read more about building .wasm binaries here: | ||
# https://rustwasm.github.io/docs/wasm-pack/commands/build.html | ||
|
||
deploy: | ||
docker-compose up --build --remove-orphans | ||
WASM_PATH=$(WASM_PATH) docker-compose up --build --remove-orphans | ||
|
||
# shows only the logs related to WASM filter/singleton | ||
# shows only the logs related to WASM filter/singleton | ||
deploy-filtered: | ||
docker-compose up --build --remove-orphans | grep "\[wasm\]\|Starting" | ||
WASM_PATH=$(WASM_PATH) docker-compose up --build --remove-orphans | grep "\[wasm\]\|Starting" | ||
|
||
run: build deploy | ||
|
||
run-filtered: build deploy-filtered | ||
|
||
clean: | ||
cargo clean | ||
cargo clean | ||
rm -rf ./pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters