-
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-metrics example
- 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
4119d3c
commit f743c0c
Showing
3 changed files
with
18 additions
and
7 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
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,26 @@ | ||
build: | ||
# check wether compiled with wasm-pack | ||
ifeq ($(shell test -e ./pkg/tcp_metrics_bg.wasm && echo -n y),y) | ||
WASM_PATH=./pkg/tcp_metrics_bg.wasm | ||
endif | ||
|
||
# a small optimized binary without debug info, useful for releases | ||
build: clean | ||
wasm-pack build --release | ||
|
||
build-unoptimized: clean | ||
cargo +nightly build --target=wasm32-unknown-unknown --release | ||
|
||
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 | ||
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