-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from redbadger/products-service-spin
Deployment of products service to local wasmCloud
- Loading branch information
Showing
78 changed files
with
648 additions
and
463 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
*.wasm |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
### Deploy to local wasmCloud | ||
|
||
## Setup | ||
|
||
### wasmCloud | ||
|
||
Install `wash` with `brew install wash`. | ||
|
||
```bash | ||
wash --version | ||
# wash 0.30.0 | ||
``` | ||
|
||
run | ||
|
||
```bash | ||
wash up -d | ||
``` | ||
|
||
### Build and sign the components | ||
|
||
```bash | ||
./build_and_sign.fish | ||
``` | ||
|
||
### Deploy the components with `wadm` | ||
|
||
```bash | ||
./up.fish | ||
``` | ||
|
||
### Delete the application with `wadm` | ||
|
||
```bash | ||
./down.fish | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env fish | ||
|
||
set SCRIPT_DIR (dirname (realpath (status -f))) | ||
set OUTPUT_DIR $SCRIPT_DIR/signed/ | ||
set COMPONENT_DIR (realpath $SCRIPT_DIR/../wasm-components/rust) | ||
set INPUT_DIR $COMPONENT_DIR/target/wasm32-wasip2/release/ | ||
|
||
mkdir -p $OUTPUT_DIR | ||
|
||
pushd $COMPONENT_DIR | ||
|
||
### cargo | ||
# cargo build --release | ||
# pushd $INPUT_DIR | ||
# for component in data_init inventory_service orders_service products_service http_controller notification_service | ||
# wash claims sign {$component}.wasm | ||
# mv {$component}_s.wasm $OUTPUT_DIR | ||
# end | ||
# popd | ||
|
||
### wash | ||
for component in data-init inventory-service orders-service products-service http-controller notification-service | ||
pushd $component | ||
RUSTUP_TOOLCHAIN=stable wash build | ||
set COMPONENT (string replace -a '-' _ $component) | ||
cp build/{$COMPONENT}_s.wasm $OUTPUT_DIR | ||
popd | ||
end | ||
|
||
popd |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env fish | ||
|
||
wash down --all | ||
|
||
pushd /tmp | ||
if test -f wash-ui.pid | ||
set PID (cat wash-ui.pid) | ||
rm -f wash-ui.pid wash-ui.out | ||
if test -n "$PID" | ||
kill $PID | ||
end | ||
end | ||
popd |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env fish | ||
|
||
./stop.fish | ||
./start.fish |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env fish | ||
|
||
wash app deploy ./wadm.yaml |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env fish | ||
|
||
wash app delete ./wadm.yaml |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env fish | ||
|
||
wash up -d | ||
|
||
pushd /tmp | ||
status job-control full | ||
nohup wash ui > wash-ui.out & | ||
cat wash-ui.out | ||
set PID $last_pid | ||
echo $PID > wash-ui.pid | ||
popd |
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Wasm Components | ||
|
||
The Wasm Components and their various configurations for deployment. | ||
|
||
They are currently written in Rust, but could be written in any language that compiles to Wasm. | ||
|
||
## Components | ||
|
||
### [Data init](rust/data-init) | ||
- sets up the various data stores | ||
|
||
### [HTTP controller](rust/http-controller) | ||
- routes HTTP requests to the appropriate service | ||
|
||
### [Products Service](rust/products-service) | ||
- manages the products in **key-value store** | ||
|
||
### [Inventory Service](rust/inventory-service) | ||
- manages the inventory of products in **postgres** | ||
|
||
### [Orders Service](rust/orders-service) | ||
- manages the orders in **postgres** | ||
- calls `inventory-service` | ||
- does not call `products-service`, although it probs should | ||
- publishes `OrderNotification` events to **NATS** | ||
|
||
### [Notification Service](rust/notification-service) | ||
- subscribes to `OrderNotification` events from **NATS** | ||
- prints received messages to `stdout` |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Oops, something went wrong.