Skip to content

Commit

Permalink
Merge pull request #285 from bots-garden/gardening-before-040
Browse files Browse the repository at this point in the history
Gardening before `0.0.4`
  • Loading branch information
k33g authored Jun 25, 2023
2 parents 19a159f + 8a91933 commit d17eef8
Show file tree
Hide file tree
Showing 40 changed files with 933 additions and 465 deletions.
2 changes: 1 addition & 1 deletion capsctl/description.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CapsCtl v0.3.9 🥒 [cucumber]
CapsCtl v0.4.0 🌶️ [chili pepper]
2 changes: 1 addition & 1 deletion capsule-cli/description.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[CLI] v0.3.9 🥒 [cucumber]
[CLI] v0.4.0 🌶️ [chili pepper]
2 changes: 1 addition & 1 deletion capsule-cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require github.com/tetratelabs/wazero v1.1.0 // indirect

require (
github.com/bots-garden/capsule-host-sdk v0.0.4
github.com/bots-garden/capsule-host-sdk v0.0.5
github.com/gofiber/fiber/v2 v2.44.0
)

Expand Down
2 changes: 1 addition & 1 deletion capsule-http/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ tasks:
- |
hey -n 300 -c 100 -m POST \
-H "Content-Type: application/json; charset=utf-8" \
-d "${JSON_DATA}" ${PROTOCOL}://${DOMAIN}:${HTTP_PORT} > capsule_xp.http.stress.report.0.4.0.txt
-d "${JSON_DATA}" ${PROTOCOL}://${DOMAIN}:${HTTP_PORT} > capsule.http.stress.report.0.4.0.txt
#- killport ${HTTP_PORT}

build-hey:
Expand Down
56 changes: 28 additions & 28 deletions capsule-http/capsule.http.stress.report.0.4.0.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@

Summary:
Total: 0.1811 secs
Slowest: 0.1136 secs
Fastest: 0.0011 secs
Average: 0.0468 secs
Requests/sec: 1656.8637
Total: 0.1022 secs
Slowest: 0.0604 secs
Fastest: 0.0037 secs
Average: 0.0283 secs
Requests/sec: 2934.1867

Total data: 15900 bytes
Size/request: 53 bytes

Response time histogram:
0.001 [1] |■
0.012 [53] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.024 [18] |■■■■■■■■■■■■■
0.035 [30] |■■■■■■■■■■■■■■■■■■■■■
0.046 [45] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.057 [23] |■■■■■■■■■■■■■■■■
0.069 [57] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.080 [28] |■■■■■■■■■■■■■■■■■■■■
0.091 [27] |■■■■■■■■■■■■■■■■■■■
0.102 [14] |■■■■■■■■■■
0.114 [4] |■■■
0.004 [1] |■
0.009 [14] |■■■■■■■■
0.015 [32] |■■■■■■■■■■■■■■■■■■■
0.021 [60] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.026 [51] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.032 [16] |■■■■■■■■■
0.038 [69] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.043 [11] |■■■■■■
0.049 [14] |■■■■■■■■
0.055 [11] |■■■■■■
0.060 [21] |■■■■■■■■■■■■


Latency distribution:
10% in 0.0022 secs
25% in 0.0243 secs
50% in 0.0488 secs
75% in 0.0675 secs
90% in 0.0848 secs
95% in 0.0920 secs
99% in 0.1041 secs
10% in 0.0111 secs
25% in 0.0191 secs
50% in 0.0254 secs
75% in 0.0366 secs
90% in 0.0500 secs
95% in 0.0557 secs
99% in 0.0603 secs

Details (average, fastest, slowest):
DNS+dialup: 0.0024 secs, 0.0011 secs, 0.1136 secs
DNS-lookup: 0.0020 secs, 0.0000 secs, 0.0188 secs
req write: 0.0003 secs, 0.0000 secs, 0.0029 secs
resp wait: 0.0440 secs, 0.0011 secs, 0.1136 secs
resp read: 0.0001 secs, 0.0000 secs, 0.0023 secs
DNS+dialup: 0.0043 secs, 0.0037 secs, 0.0604 secs
DNS-lookup: 0.0069 secs, 0.0000 secs, 0.0267 secs
req write: 0.0003 secs, 0.0000 secs, 0.0082 secs
resp wait: 0.0196 secs, 0.0003 secs, 0.0341 secs
resp read: 0.0002 secs, 0.0000 secs, 0.0136 secs

Status code distribution:
[200] 300 responses
Expand Down
46 changes: 0 additions & 46 deletions capsule-http/capsule_xp.http.stress.report.0.4.0.txt

This file was deleted.

2 changes: 1 addition & 1 deletion capsule-http/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
)

require (
github.com/bots-garden/capsule-host-sdk v0.0.4
github.com/bots-garden/capsule-host-sdk v0.0.5
github.com/gofiber/fiber/v2 v2.45.0
github.com/tetratelabs/wazero v1.2.0
golang.ngrok.com/ngrok v1.0.0
Expand Down
Empty file added capsule-http/tests/.gitignore
Empty file.
4 changes: 4 additions & 0 deletions capsule-http/tests/faas/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
tmp/*.wasm
*.wasm
capsctl
capsule-http


80 changes: 80 additions & 0 deletions capsule-http/tests/faas/BuildTasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: '3'

tasks:

hello-functions:
cmds:
- | # hello-default
cd functions/hello-default
tinygo build -o hello-default.wasm \
-scheduler=none \
--no-debug \
-target wasi ./main.go
ls -lh *.wasm
mv hello-default.wasm ../..
- | # hello-blue
cd functions/hello-blue
tinygo build -o hello-blue.wasm \
-scheduler=none \
--no-debug \
-target wasi ./main.go
ls -lh *.wasm
mv hello-blue.wasm ../..
- | # hello-green
cd functions/hello-green
tinygo build -o hello-green.wasm \
-scheduler=none \
--no-debug \
-target wasi ./main.go
ls -lh *.wasm
mv hello-green.wasm ../..
- | # hello-orange
cd functions/hello-orange
tinygo build -o hello-orange.wasm \
-scheduler=none \
--no-debug \
-target wasi ./main.go
ls -lh *.wasm
mv hello-orange.wasm ../..
capsctl:
description: >
Build capsctl, and copy the binary to the current directory
`/capsule/capsule-http/tests/faas`
cmds:
- |
echo "📦 Building capsctl..."
cd ../../../capsctl
pwd
go build -ldflags="-s -w" -o capsctl
ls -lh capsctl
mv capsctl ../capsule-http/tests/faas
cd ../capsule-http/tests/faas
./capsctl --version
capsule-http:
description: >
Build capsule-http, and copy the binary to the current directory
`/capsule/capsule-http/tests/faas`
cmds:
- |
echo "📦 Building capsule-http..."
cd ../..
pwd
go build -ldflags="-s -w" -o capsule-http
ls -lh capsule-http
mv capsule-http ./tests/faas
cd ./tests/faas
./capsule-http --version
# Build of capsule-http
install-capsule-http:
cmds:
- |
echo "📦 Building capsule-http..."
cd ../..
pwd
go build -ldflags="-s -w" -o capsule-http
ls -lh capsule-http
sudo cp capsule-http /usr/local/bin/capsule-http
capsule-http --version
44 changes: 44 additions & 0 deletions capsule-http/tests/faas/CallTasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: '3'

env:
CAPSULE_FAAS_TOKEN: "ILOVEPANDAS"
CAPSULE_MAIN_PROCESS_URL: "http://capsule-ide.local:8080"

tasks:

orange:
cmds:
- |
curl -X POST ${CAPSULE_MAIN_PROCESS_URL}/functions/hello/orange \
-H 'Content-Type: text/plain; charset=utf-8' \
-d 'Bob Morane'
orange_two:
cmds:
- |
curl -X POST ${CAPSULE_MAIN_PROCESS_URL}/functions/hello/orange_two \
-H 'Content-Type: text/plain; charset=utf-8' \
-d 'Bob Morane'
green:
cmds:
- |
curl -X POST ${CAPSULE_MAIN_PROCESS_URL}/functions/hello/green \
-H 'Content-Type: text/plain; charset=utf-8' \
-d 'Bob Morane'
blue:
cmds:
- |
curl -X POST ${CAPSULE_MAIN_PROCESS_URL}/functions/hello/blue \
-H 'Content-Type: text/plain; charset=utf-8' \
-d 'Bob Morane'
default:
description: >
The `default` revision can be call without specifying `default` into the route
cmds:
- |
curl -X POST ${CAPSULE_MAIN_PROCESS_URL}/functions/hello \
-H 'Content-Type: text/plain; charset=utf-8' \
-d 'Bob Morane'
51 changes: 51 additions & 0 deletions capsule-http/tests/faas/DropTasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: '3'

description: >
`CAPSULE_FAAS_TOKEN` and `CAPSULE_MAIN_PROCESS_URL` are required
to run `capsctl`
env:
CAPSULE_FAAS_TOKEN: "ILOVEPANDAS"
CAPSULE_MAIN_PROCESS_URL: "http://capsule-ide.local:8080"

tasks:

orange:
cmds:
- |
./capsctl \
--cmd=drop \
--name=hello \
--revision=orange
orange_two:
cmds:
- |
./capsctl \
--cmd=drop \
--name=hello \
--revision=orange_two
green:
cmds:
- |
./capsctl \
--cmd=drop \
--name=hello \
--revision=green
blue:
cmds:
- |
./capsctl \
--cmd=drop \
--name=hello \
--revision=blue
default:
cmds:
- |
./capsctl \
--cmd=drop \
--name=hello \
--revision=default
29 changes: 29 additions & 0 deletions capsule-http/tests/faas/DuplicateTasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3'

description: >
`CAPSULE_FAAS_TOKEN` and `CAPSULE_MAIN_PROCESS_URL` are required
to run `capsctl`
env:
CAPSULE_FAAS_TOKEN: "ILOVEPANDAS"
CAPSULE_MAIN_PROCESS_URL: "http://capsule-ide.local:8080"

tasks:

orange:
cmds:
- |
./capsctl \
--cmd=duplicate \
--name=hello \
--revision=orange \
--newRevision=orange_two
orange_two:
cmds:
- |
./capsctl \
--cmd=duplicate \
--name=hello \
--revision=orange_two \
--newRevision=orange
Loading

0 comments on commit d17eef8

Please sign in to comment.