Skip to content

Commit 5ba5cf0

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

File tree

5 files changed

+617
-0
lines changed

5 files changed

+617
-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+
"wasmer": "wasip1-wasm-wasmer",
105106
"wasmtime": "wasip1-wasm-wasmtime",
106107
"wazero": "wasip1-wasm-wazero",
107108
"windows": "windows-amd64-2016",
@@ -329,6 +330,11 @@ var Hosts = map[string]*HostConfig{
329330
ContainerImage: "linux-x86-stretch:latest",
330331
SSHUsername: "root",
331332
},
333+
"host-linux-amd64-wasip1-wasm-wasmer": {
334+
Notes: "Container with wasmer for testing wasip1/wasm.",
335+
ContainerImage: "wasip1-wasm-wasmer:latest",
336+
SSHUsername: "root",
337+
},
332338
"host-linux-amd64-wasip1-wasm-wasmtime": {
333339
Notes: "Container with wasmtime for testing wasip1/wasm.",
334340
ContainerImage: "wasip1-wasm-wasmtime:latest",
@@ -3205,6 +3211,37 @@ func init() {
32053211
"GO_DISABLE_OUTBOUND_NETWORK=1", "GOWASIRUNTIME=wasmtime",
32063212
},
32073213
})
3214+
addBuilder(BuildConfig{
3215+
Name: "wasip1-wasm-wasmer",
3216+
HostType: "host-linux-amd64-wasip1-wasm-wasmer",
3217+
KnownIssues: []int{59907},
3218+
buildsRepo: func(repo, branch, goBranch string) bool {
3219+
b := buildRepoByDefault(repo) && atLeastGo1(goBranch, 21)
3220+
switch repo {
3221+
case "benchmarks", "debug", "perf", "talks", "tools", "tour", "website":
3222+
// Don't test these golang.org/x repos.
3223+
b = false
3224+
}
3225+
if repo != "go" && !(branch == "master" && goBranch == "master") {
3226+
// For golang.org/x repos, don't test non-latest versions.
3227+
b = false
3228+
}
3229+
return b
3230+
},
3231+
distTestAdjust: func(run bool, distTest string, isNormalTry bool) bool {
3232+
if isNormalTry && (strings.Contains(distTest, "/internal/") || distTest == "reboot") {
3233+
// Skip some tests in an attempt to speed up normal trybots, inherited from CL 121938.
3234+
run = false
3235+
}
3236+
return run
3237+
},
3238+
numTryTestHelpers: 3,
3239+
env: []string{
3240+
"GOOS=wasip1", "GOARCH=wasm", "GOHOSTOS=linux", "GOHOSTARCH=amd64",
3241+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/workdir/go/misc/wasm",
3242+
"GO_DISABLE_OUTBOUND_NETWORK=1", "GOWASIRUNTIME=wasmer",
3243+
},
3244+
})
32083245
}
32093246

32103247
// 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
@@ -665,6 +665,9 @@ func TestBuilderConfig(t *testing.T) {
665665
{b("wasip1-wasm-wasmtime", "go"), onlyPost},
666666
{b("[email protected]", "go"), onlyPost},
667667
{b("[email protected]", "go"), none},
668+
{b("wasip1-wasm-wasmer", "go"), onlyPost},
669+
{b("[email protected]", "go"), onlyPost},
670+
{b("[email protected]", "go"), none},
668671
// Test wasip1/wasm on a subset of golang.org/x repos:
669672
{b("wasip1-wasm-wazero", "arch"), onlyPost},
670673
{b("wasip1-wasm-wazero", "crypto"), onlyPost},
@@ -690,6 +693,18 @@ func TestBuilderConfig(t *testing.T) {
690693
{b("wasip1-wasm-wasmtime", "tools"), none},
691694
{b("wasip1-wasm-wasmtime", "tour"), none},
692695
{b("wasip1-wasm-wasmtime", "website"), none},
696+
{b("wasip1-wasm-wasmer", "arch"), onlyPost},
697+
{b("wasip1-wasm-wasmer", "crypto"), onlyPost},
698+
{b("wasip1-wasm-wasmer", "sys"), onlyPost},
699+
{b("wasip1-wasm-wasmer", "net"), onlyPost},
700+
{b("wasip1-wasm-wasmer", "benchmarks"), none},
701+
{b("wasip1-wasm-wasmer", "debug"), none},
702+
{b("wasip1-wasm-wasmer", "mobile"), none},
703+
{b("wasip1-wasm-wasmer", "perf"), none},
704+
{b("wasip1-wasm-wasmer", "talks"), none},
705+
{b("wasip1-wasm-wasmer", "tools"), none},
706+
{b("wasip1-wasm-wasmer", "tour"), none},
707+
{b("wasip1-wasm-wasmer", "website"), none},
693708

694709
// Race builders. Linux for all, GCE builders for
695710
// post-submit, and only post-submit for "go" for
@@ -736,6 +751,7 @@ func TestBuilderConfig(t *testing.T) {
736751
{b("js-wasm", "exp"), none},
737752
{b("wasip1-wasm-wazero", "exp"), none},
738753
{b("wasip1-wasm-wasmtime", "exp"), none},
754+
{b("wasip1-wasm-wasmer", "exp"), none},
739755

740756
// exp is experimental; it doesn't test against release branches.
741757
{b("[email protected]", "exp"), none},
@@ -764,6 +780,7 @@ func TestBuilderConfig(t *testing.T) {
764780
{b("js-wasm", "build"), none},
765781
{b("wasip1-wasm-wazero", "build"), none},
766782
{b("wasip1-wasm-wasmtime", "build"), none},
783+
{b("wasip1-wasm-wasmer", "build"), none},
767784
{b("android-386-emu", "build"), none},
768785
{b("android-amd64-emu", "build"), none},
769786

env/wasip1-wasm-wasmer/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 curl
11+
12+
# A copy of https://raw.githubusercontent.com/wasmerio/wasmer-install/master/install.sh.
13+
COPY install.sh install.sh
14+
15+
RUN bash install.sh v3.3.0
16+
17+
FROM ${REPO}/linux-x86-sid:20221109
18+
19+
COPY --from=builder /root/.wasmer/bin/wasmer /usr/local/bin/wasmer
20+
21+
CMD ["/usr/local/bin/stage0"]

env/wasip1-wasm-wasmer/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)