Skip to content

Commit fc985e8

Browse files
johanbrandhorstgopherbot
authored andcommitted
all: add wasmedge wasip1 runner
The wasmedge runner provides the wasmedge.org WASI runtime for testing the wasip1 implementation. For golang/go#60097 Change-Id: I1148977296d00163f638d4fcc7a916c58c6d17c5 Reviewed-on: https://go-review.googlesource.com/c/build/+/493696 Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Auto-Submit: Johan Brandhorst-Satzkorn <[email protected]> Run-TryBot: Johan Brandhorst-Satzkorn <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 5ba5cf0 commit fc985e8

File tree

5 files changed

+1654
-0
lines changed

5 files changed

+1654
-0
lines changed

dashboard/builders.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ var slowBotAliases = map[string]string{
102102
"solaris": "solaris-amd64-oraclerel",
103103
"solaris-amd64": "solaris-amd64-oraclerel",
104104
"wasm": "js-wasm-node18",
105+
"wasmedge": "wasip1-wasm-wasmedge",
105106
"wasmer": "wasip1-wasm-wasmer",
106107
"wasmtime": "wasip1-wasm-wasmtime",
107108
"wazero": "wasip1-wasm-wazero",
@@ -330,6 +331,11 @@ var Hosts = map[string]*HostConfig{
330331
ContainerImage: "linux-x86-stretch:latest",
331332
SSHUsername: "root",
332333
},
334+
"host-linux-amd64-wasip1-wasm-wasmedge": {
335+
Notes: "Container with wasmedge for testing wasip1/wasm.",
336+
ContainerImage: "wasip1-wasm-wasmedge:latest",
337+
SSHUsername: "root",
338+
},
333339
"host-linux-amd64-wasip1-wasm-wasmer": {
334340
Notes: "Container with wasmer for testing wasip1/wasm.",
335341
ContainerImage: "wasip1-wasm-wasmer:latest",
@@ -3242,6 +3248,37 @@ func init() {
32423248
"GO_DISABLE_OUTBOUND_NETWORK=1", "GOWASIRUNTIME=wasmer",
32433249
},
32443250
})
3251+
addBuilder(BuildConfig{
3252+
Name: "wasip1-wasm-wasmedge",
3253+
HostType: "host-linux-amd64-wasip1-wasm-wasmedge",
3254+
KnownIssues: []int{60097},
3255+
buildsRepo: func(repo, branch, goBranch string) bool {
3256+
b := buildRepoByDefault(repo) && atLeastGo1(goBranch, 21)
3257+
switch repo {
3258+
case "benchmarks", "debug", "perf", "talks", "tools", "tour", "website":
3259+
// Don't test these golang.org/x repos.
3260+
b = false
3261+
}
3262+
if repo != "go" && !(branch == "master" && goBranch == "master") {
3263+
// For golang.org/x repos, don't test non-latest versions.
3264+
b = false
3265+
}
3266+
return b
3267+
},
3268+
distTestAdjust: func(run bool, distTest string, isNormalTry bool) bool {
3269+
if isNormalTry && (strings.Contains(distTest, "/internal/") || distTest == "reboot") {
3270+
// Skip some tests in an attempt to speed up normal trybots, inherited from CL 121938.
3271+
run = false
3272+
}
3273+
return run
3274+
},
3275+
numTryTestHelpers: 3,
3276+
env: []string{
3277+
"GOOS=wasip1", "GOARCH=wasm", "GOHOSTOS=linux", "GOHOSTARCH=amd64",
3278+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/workdir/go/misc/wasm",
3279+
"GO_DISABLE_OUTBOUND_NETWORK=1", "GOWASIRUNTIME=wasmedge",
3280+
},
3281+
})
32453282
}
32463283

32473284
// addBuilder adds c to the Builders map after doing some checks.

dashboard/builders_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,9 @@ func TestBuilderConfig(t *testing.T) {
668668
{b("wasip1-wasm-wasmer", "go"), onlyPost},
669669
{b("[email protected]", "go"), onlyPost},
670670
{b("[email protected]", "go"), none},
671+
{b("wasip1-wasm-wasmedge", "go"), onlyPost},
672+
{b("[email protected]", "go"), onlyPost},
673+
{b("[email protected]", "go"), none},
671674
// Test wasip1/wasm on a subset of golang.org/x repos:
672675
{b("wasip1-wasm-wazero", "arch"), onlyPost},
673676
{b("wasip1-wasm-wazero", "crypto"), onlyPost},
@@ -705,6 +708,18 @@ func TestBuilderConfig(t *testing.T) {
705708
{b("wasip1-wasm-wasmer", "tools"), none},
706709
{b("wasip1-wasm-wasmer", "tour"), none},
707710
{b("wasip1-wasm-wasmer", "website"), none},
711+
{b("wasip1-wasm-wasmedge", "arch"), onlyPost},
712+
{b("wasip1-wasm-wasmedge", "crypto"), onlyPost},
713+
{b("wasip1-wasm-wasmedge", "sys"), onlyPost},
714+
{b("wasip1-wasm-wasmedge", "net"), onlyPost},
715+
{b("wasip1-wasm-wasmedge", "benchmarks"), none},
716+
{b("wasip1-wasm-wasmedge", "debug"), none},
717+
{b("wasip1-wasm-wasmedge", "mobile"), none},
718+
{b("wasip1-wasm-wasmedge", "perf"), none},
719+
{b("wasip1-wasm-wasmedge", "talks"), none},
720+
{b("wasip1-wasm-wasmedge", "tools"), none},
721+
{b("wasip1-wasm-wasmedge", "tour"), none},
722+
{b("wasip1-wasm-wasmedge", "website"), none},
708723

709724
// Race builders. Linux for all, GCE builders for
710725
// post-submit, and only post-submit for "go" for
@@ -752,6 +767,7 @@ func TestBuilderConfig(t *testing.T) {
752767
{b("wasip1-wasm-wazero", "exp"), none},
753768
{b("wasip1-wasm-wasmtime", "exp"), none},
754769
{b("wasip1-wasm-wasmer", "exp"), none},
770+
{b("wasip1-wasm-wasmedge", "exp"), none},
755771

756772
// exp is experimental; it doesn't test against release branches.
757773
{b("[email protected]", "exp"), none},
@@ -781,6 +797,7 @@ func TestBuilderConfig(t *testing.T) {
781797
{b("wasip1-wasm-wazero", "build"), none},
782798
{b("wasip1-wasm-wasmtime", "build"), none},
783799
{b("wasip1-wasm-wasmer", "build"), none},
800+
{b("wasip1-wasm-wasmedge", "build"), none},
784801
{b("android-386-emu", "build"), none},
785802
{b("android-amd64-emu", "build"), none},
786803

env/wasip1-wasm-wasmedge/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2023 The Go Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style
3+
# license that can be found in the LICENSE file.
4+
5+
ARG REPO
6+
7+
FROM debian:latest as builder
8+
LABEL maintainer="[email protected]"
9+
10+
RUN apt-get update && apt-get -y install python3 git
11+
12+
# A copy of https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.py.
13+
COPY install.py install.py
14+
15+
RUN python3 install.py --version 0.12.0
16+
17+
FROM ${REPO}/linux-x86-sid:20221109
18+
19+
COPY --from=builder /root/.wasmedge/bin/wasmedge /usr/local/bin/wasmedge
20+
21+
CMD ["/usr/local/bin/stage0"]

env/wasip1-wasm-wasmedge/Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2023 The Go Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style
3+
# license that can be found in the LICENSE file.
4+
5+
IMAGE_NAME=$(shell basename $(CURDIR))
6+
PROD_REPO=gcr.io/symbolic-datum-552
7+
8+
usage:
9+
echo "Use prod or dev targets. For dev, specify your Docker repository with the REPO=foo argument." ; exit 1
10+
11+
prod: Dockerfile
12+
docker build -t $(PROD_REPO)/$(IMAGE_NAME):latest --build-arg REPO=$(PROD_REPO) -f Dockerfile .
13+
14+
pushprod: prod
15+
docker push $(PROD_REPO)/$(IMAGE_NAME):latest
16+
17+
# You must provide a REPO=your-repo-name arg when you make
18+
# this target. REPO is the name of the Docker repository
19+
# that will be prefixed to the name of the image being built.
20+
dev: Dockerfile
21+
docker build -t $(REPO)/$(IMAGE_NAME):latest --build-arg REPO=$(REPO) -f Dockerfile .
22+
docker push $(REPO)/$(IMAGE_NAME):latest

0 commit comments

Comments
 (0)