-
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.
Signed-off-by: Lucas Fontes <[email protected]>
- Loading branch information
Showing
44 changed files
with
58 additions
and
16 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 |
---|---|---|
@@ -1,13 +1,35 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM ghcr.io/bytecodealliance/wrpc:cb43ec8 AS wrpc | ||
|
||
FROM golang:1.23 AS build | ||
ENV TINYGO_RELEASE=0.34.0 | ||
ENV WASMTOOLS_VERSION=1.221.2 | ||
ENV PATH=${PATH}:/usr/local/tinygo/bin | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
RUN <<EOF | ||
cd /tmp | ||
wget -q https://github.com/tinygo-org/tinygo/releases/download/v${TINYGO_RELEASE}/tinygo${TINYGO_RELEASE}.${TARGETOS}-${TARGETARCH}.tar.gz | ||
tar zxf tinygo${TINYGO_RELEASE}.${TARGETOS}-${TARGETARCH}.tar.gz -C /usr/local | ||
|
||
wget -q https://github.com/bytecodealliance/wasm-tools/releases/download/v${WASMTOOLS_VERSION}/wasm-tools-${WASMTOOLS_VERSION}-x86_64-linux.tar.gz | ||
tar zxf wasm-tools-${WASMTOOLS_VERSION}-x86_64-linux.tar.gz | ||
cp wasm-tools-${WASMTOOLS_VERSION}-x86_64-linux/wasm-tools /usr/local/bin/ | ||
rm -f *gz | ||
EOF | ||
|
||
RUN <<EOF | ||
go install go.k6.io/xk6/cmd/xk6@latest | ||
CGO_ENABLED=0 go install github.com/nats-io/natscli/[email protected] | ||
CGO_ENABLED=0 go install github.com/rakyll/[email protected] | ||
EOF | ||
|
||
WORKDIR /go/src/xk6-wrpc | ||
RUN go install go.k6.io/xk6/cmd/xk6@latest | ||
RUN CGO_ENABLED=0 go install github.com/nats-io/natscli/[email protected] | ||
RUN CGO_ENABLED=0 go install github.com/rakyll/[email protected] | ||
COPY . . | ||
RUN xk6 build --with xk6-wrpc=. --with github.com/grafana/xk6-dashboard@latest --with github.com/cosmonic-labs/xk6-nats@latest | ||
|
||
COPY . . | ||
RUN make build | ||
|
||
FROM alpine:latest AS base | ||
RUN apk add --no-cache \ | ||
|
@@ -22,6 +44,6 @@ COPY --from=wrpc /bin/wrpc-wasmtime /usr/bin/wrpc-wasmtime | |
COPY --from=build /go/bin/nats /usr/bin/nats | ||
COPY --from=build /go/bin/hey /usr/bin/hey | ||
COPY --from=build /go/src/xk6-wrpc/k6 /usr/bin/k6 | ||
COPY --from=build /go/src/xk6-wrpc/blaster-component/blaster-component.wasm /blaster-component.wasm | ||
COPY --from=build /go/src/xk6-wrpc/components/blaster/blaster.wasm /components/ | ||
USER k6 | ||
ENTRYPOINT ["/usr/bin/k6"] |
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,2 +1,3 @@ | ||
/internal/ | ||
/build/ | ||
/blaster.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,10 @@ | ||
all: bindgen build | ||
|
||
.PHONY: bindgen | ||
bindgen: | ||
wit-deps | ||
go generate | ||
|
||
.PHONY: build | ||
build: | ||
tinygo build -target wasip2 -wit-package wit -wit-world server -o blaster.wasm |
Binary file renamed
BIN
+419 KB
blaster-component/blaster-component.wasm → components/blaster/blaster.wasm
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
blaster-component/wasmcloud.toml → components/blaster/wasmcloud.toml
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,4 +1,4 @@ | ||
name = "blaster-component" | ||
name = "blaster" | ||
language = "tinygo" | ||
type = "component" | ||
version = "0.1.0" | ||
|
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
2 changes: 1 addition & 1 deletion
2
blaster-component/wit/deps.toml → components/blaster/wit/deps.toml
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,2 +1,2 @@ | ||
xk6-wrpc = "../../shared-wit" | ||
xk6-wrpc = "../../../shared-wit" | ||
wasi-cli = "https://github.com/WebAssembly/wasi-cli/archive/refs/tags/v0.2.0.tar.gz" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.