-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nim ping test #70
Merged
Merged
Nim ping test #70
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4d55f50
Nim ping test
Menduist c8e4b32
Working interop
Menduist 311e8d4
Add nim toml
Menduist 446cf46
Add CI
Menduist ec04210
fix workflow name
Menduist 4234e61
Delete go-rust specifics
Menduist b1b2b27
Merge remote-tracking branch 'origin/master' into nim
Menduist 17f07e1
Merge remote-tracking branch 'origin/master' into nim
Menduist c535e02
Update .github/workflows/ping-interop-latest.yml
Menduist 31cf4bc
Merge remote-tracking branch 'origin/master' into nim
Menduist eebee6d
Merge remote-tracking branch 'fork/nim' into nim
Menduist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,45 @@ | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
testground_endpoint: | ||
type: string | ||
required: false | ||
description: testground endpoint | ||
custom_git_reference: | ||
description: the git commit or branch we're going to use for the custom target | ||
required: false | ||
type: string | ||
custom_git_target: | ||
description: the custom git fork url we're going to use for the custom target (github.com/some-fork/rust-libp2p) | ||
required: false | ||
type: string | ||
custom_interop_target: | ||
description: in the case of cross-implementation testing, the implementation target (go | rust | nim) | ||
required: false | ||
type: string | ||
push: | ||
pull_request: | ||
|
||
name: libp2p ping - all tests with testground. | ||
|
||
jobs: | ||
run-all-ping-latest: | ||
uses: "./.github/workflows/run-composition.yml" | ||
with: | ||
composition_file: "ping/_compositions/all-interop-latest.toml" | ||
custom_git_target: ${{ github.event.inputs.custom_git_target }} # nothing or "some-fork/go-libp2p" | ||
custom_git_reference: ${{ github.event.inputs.custom_git_reference }} # a git reference | ||
custom_interop_target: ${{ github.event.inputs.custom_interop_target }} # go | rust | ||
testground_endpoint: ${{ github.event.inputs.testground_endpoint }} | ||
test_repository: ${{ (github.event.inputs && '') || github.repository }} | ||
test_ref: ${{ (github.event.inputs && '') || github.event.pull_request.head.sha || github.sha }} | ||
run-all-ping-all: | ||
uses: "./.github/workflows/run-composition.yml" | ||
with: | ||
composition_file: "ping/_compositions/all-interop.toml" | ||
custom_git_target: ${{ github.event.inputs.custom_git_target }} # nothing or "some-fork/go-libp2p" | ||
custom_git_reference: ${{ github.event.inputs.custom_git_reference }} # a git reference | ||
custom_interop_target: ${{ github.event.inputs.custom_interop_target }} # go | rust | ||
testground_endpoint: ${{ github.event.inputs.testground_endpoint }} | ||
test_repository: ${{ (github.event.inputs && '') || github.repository }} | ||
test_ref: ${{ (github.event.inputs && '') || github.event.pull_request.head.sha || github.sha }} |
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,133 @@ | ||
[metadata] | ||
name = "all-latest-{{ or $.Env.InteropTarget "-" }}-{{ or $.Env.GitReference "" }}" | ||
|
||
[global] | ||
plan = "libp2p/ping" | ||
case = "ping" | ||
runner = "local:docker" | ||
concurrent_builds = 1 | ||
|
||
[global.build_config] | ||
enable_go_build_cache = false # see https://github.com/testground/testground/issues/1361 | ||
# disable testground's goproxy which hangs on github runners. | ||
go_proxy_mode = "remote" | ||
go_proxy_url = "https://proxy.golang.org" | ||
|
||
{{ with (load_resource "./go.toml") }} | ||
{{ with (index .groups 0) }} | ||
[[groups]] | ||
id = "go-latest-{{ .Id }}" | ||
instances = { count = 1 } | ||
builder = "docker:go" | ||
|
||
[groups.build] | ||
selectors = ['{{ .Selector }}'] | ||
|
||
[groups.build_config] | ||
path = "./go/" | ||
build_base_image = 'golang:{{ .GoVersion }}-buster' | ||
modfile = "{{ .Modfile }}" | ||
{{ end }} | ||
|
||
{{ if eq $.Env.InteropTarget "go" }} | ||
{{ if $.Env.GitReference }} | ||
{{ with .custom }} | ||
[[groups]] | ||
id = "go-custom-{{ $.Env.GitReference }}" | ||
instances = { count = 1 } | ||
builder = "docker:go" | ||
|
||
[groups.build] | ||
selectors = ['{{ .Selector }}'] | ||
|
||
[[groups.build.dependencies]] | ||
module = "github.com/libp2p/go-libp2p" | ||
version = "{{ $.Env.GitReference }}" | ||
{{ if $.Env.GitTarget }} | ||
target = "{{ $.Env.GitTarget }}" | ||
{{ end }} | ||
|
||
[groups.build_config] | ||
path = "./go/" | ||
build_base_image = 'golang:{{ .GoVersion }}-buster' | ||
modfile = "{{ .Modfile }}" | ||
|
||
[groups.build_config.dockerfile_extensions] | ||
# deal with dependency changes in master until we create the new vx.y.z instance | ||
pre_build = """ | ||
RUN cd ${PLAN_DIR} && \ | ||
go mod download github.com/libp2p/go-libp2p && \ | ||
go mod tidy -compat={{ .GoVersion }} | ||
""" | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ with (load_resource "./rust.toml") }} | ||
{{ with (index .groups 0) }} | ||
[[groups]] | ||
id = "rust-latest-{{ .Id }}" | ||
instances = { count = 1 } | ||
builder = "docker:generic" | ||
|
||
[groups.build_config] | ||
path = "./rust/" | ||
|
||
[groups.build_config.build_args] | ||
CARGO_FEATURES = '{{ .CargoFeatures }}' | ||
{{ end }} | ||
|
||
{{ if eq $.Env.InteropTarget "rust" }} | ||
{{ if $.Env.GitReference }} | ||
{{ with .custom }} | ||
[[groups]] | ||
id = "rust-custom-{{ $.Env.GitReference }}" | ||
instances = { count = 1 } | ||
builder = "docker:generic" | ||
|
||
[groups.build_config] | ||
path = "./rust/" | ||
|
||
[groups.build_config.build_args] | ||
CARGO_FEATURES = '{{ .CargoFeatures }}' | ||
CARGO_REMOVE = '{{ .CargoFeatures }}' | ||
CARGO_PATCH = """ | ||
{{ .CargoFeatures }} = {package = "libp2p", git = "https://{{ or $.Env.GitTarget "github.com/libp2p/rust-libp2p" }}", rev = "{{ $.Env.GitReference }}", default_features = false, features = [ "websocket", "mplex", "yamux", "tcp", "ping", "noise", "dns", "async-std", "rsa" ], optional = true} | ||
""" | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ with (load_resource "./nim.toml") }} | ||
{{ with (index .groups 0) }} | ||
[[groups]] | ||
id = "nim-latest-{{ .Id }}" | ||
instances = { count = 1 } | ||
builder = "docker:generic" | ||
|
||
[groups.build_config] | ||
path = "./nim/" | ||
[groups.build_config.build_args] | ||
Libp2pVersion = '{{ .Id }}' | ||
NimVersion = '{{ .NimVersion }}' | ||
{{ end }} | ||
|
||
{{ if eq $.Env.InteropTarget "nim" }} | ||
{{ if $.Env.GitReference }} | ||
{{ with .custom }} | ||
[[groups]] | ||
id = "nim-custom-{{ $.Env.GitReference }}" | ||
instances = { count = 1 } | ||
builder = "docker:generic" | ||
|
||
[groups.build_config] | ||
path = "./nim/" | ||
[groups.build_config.build_args] | ||
Libp2pVersion = '#{{ $.Env.GitReference }}' | ||
NimVersion = '{{ .NimVersion }}' | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} |
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,186 @@ | ||
[metadata] | ||
name = "all-cross-version" | ||
|
||
[global] | ||
plan = "libp2p/ping" | ||
case = "ping" | ||
runner = "local:docker" | ||
concurrent_builds = 1 | ||
|
||
[global.build_config] | ||
enable_go_build_cache = false # see https://github.com/testground/testground/issues/1361 | ||
# disable testground's goproxy which hangs on github runners. | ||
go_proxy_mode = "remote" | ||
go_proxy_url = "https://proxy.golang.org" | ||
|
||
{{ with (load_resource "./go.toml") }} | ||
{{ range .groups }} | ||
[[groups]] | ||
id = "{{ .Id }}" | ||
instances = { count = 1 } | ||
builder = "docker:go" | ||
|
||
[groups.build] | ||
selectors = ['{{ .Selector }}'] | ||
|
||
[groups.build_config] | ||
path = "./go/" | ||
build_base_image = 'golang:{{ .GoVersion }}-buster' | ||
modfile = "{{ .Modfile }}" | ||
{{ end }} | ||
|
||
{{ with .master }} | ||
[[groups]] | ||
id = "master" | ||
instances = { count = 1 } | ||
builder = "docker:go" | ||
|
||
[groups.build] | ||
selectors = ['{{ .Selector }}'] | ||
|
||
[[groups.build.dependencies]] | ||
module = "github.com/libp2p/go-libp2p" | ||
version = "master" | ||
|
||
[groups.build_config] | ||
path = "./go/" | ||
build_base_image = 'golang:{{ .GoVersion }}-buster' | ||
modfile = "{{ .Modfile }}" | ||
|
||
[groups.build_config.dockerfile_extensions] | ||
# deal with dependency changes in master until we create the new vx.y.z instance | ||
pre_build = """ | ||
RUN cd ${PLAN_DIR} && \ | ||
go mod download github.com/libp2p/go-libp2p && \ | ||
go mod tidy -compat={{ .GoVersion }} | ||
""" | ||
{{ end }} | ||
|
||
{{ if eq $.Env.InteropTarget "go" }} | ||
{{ if $.Env.GitReference }} | ||
{{ with .custom }} | ||
[[groups]] | ||
id = "custom-go" | ||
instances = { count = 1 } | ||
builder = "docker:go" | ||
|
||
[groups.build] | ||
selectors = ['{{ .Selector }}'] | ||
|
||
[[groups.build.dependencies]] | ||
module = "github.com/libp2p/go-libp2p" | ||
version = "{{ $.Env.GitReference }}" | ||
{{ if $.Env.GitTarget }} | ||
target = "{{ $.Env.GitTarget }}" | ||
{{ end }} | ||
|
||
[groups.build_config] | ||
path = "./go/" | ||
build_base_image = 'golang:{{ .GoVersion }}-buster' | ||
modfile = "{{ .Modfile }}" | ||
|
||
[groups.build_config.dockerfile_extensions] | ||
# deal with dependency changes in master until we create the new vx.y.z instance | ||
pre_build = """ | ||
RUN cd ${PLAN_DIR} && \ | ||
go mod download github.com/libp2p/go-libp2p && \ | ||
go mod tidy -compat={{ .GoVersion }} | ||
""" | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ with (load_resource "./rust.toml") }} | ||
{{ range .groups }} | ||
[[groups]] | ||
id = "rust-{{ .Id }}" | ||
instances = { count = 1 } | ||
builder = "docker:generic" | ||
|
||
[groups.build_config] | ||
path = "./rust/" | ||
|
||
[groups.build_config.build_args] | ||
CARGO_FEATURES = '{{ .CargoFeatures }}' | ||
{{ end }} | ||
|
||
{{ with .master }} | ||
[[groups]] | ||
id = "rust-master" | ||
instances = { count = 1 } | ||
builder = "docker:generic" | ||
|
||
[groups.build_config] | ||
path = "./rust/" | ||
|
||
[groups.build_config.build_args] | ||
CARGO_FEATURES = '{{ .CargoFeatures }}' | ||
{{ end }} | ||
|
||
{{ if eq $.Env.InteropTarget "rust" }} | ||
{{ if $.Env.GitReference }} | ||
{{ with .custom }} | ||
[[groups]] | ||
id = "custom-rust" | ||
instances = { count = 1 } | ||
builder = "docker:generic" | ||
|
||
[groups.build_config] | ||
path = "./rust/" | ||
|
||
[groups.build_config.build_args] | ||
CARGO_FEATURES = '{{ .CargoFeatures }}' | ||
CARGO_REMOVE = '{{ .CargoFeatures }}' | ||
CARGO_PATCH = """ | ||
{{ .CargoFeatures }} = {package = "libp2p", git = "https://{{ or $.Env.GitTarget "github.com/libp2p/rust-libp2p" }}", rev = "{{ $.Env.GitReference }}", default_features = false, features = [ "websocket", "mplex", "yamux", "tcp", "ping", "noise", "dns", "async-std", "rsa" ], optional = true} | ||
""" | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ with (load_resource "./nim.toml") }} | ||
{{ range .groups }} | ||
[[groups]] | ||
id = "nim-latest-{{ .Id }}" | ||
instances = { count = 1 } | ||
builder = "docker:generic" | ||
|
||
[groups.build_config] | ||
path = "./nim/" | ||
[groups.build_config.build_args] | ||
Libp2pVersion = '{{ .Id }}' | ||
NimVersion = '{{ .NimVersion }}' | ||
{{ end }} | ||
|
||
{{ with .custom }} | ||
[[groups]] | ||
id = "nim-unstable" | ||
instances = { count = 1 } | ||
builder = "docker:generic" | ||
|
||
[groups.build_config] | ||
path = "./nim/" | ||
[groups.build_config.build_args] | ||
Libp2pVersion = '#unstable' | ||
NimVersion = '{{ .NimVersion }}' | ||
{{ end }} | ||
|
||
{{ if eq $.Env.InteropTarget "nim" }} | ||
{{ if $.Env.GitReference }} | ||
{{ with .custom }} | ||
[[groups]] | ||
id = "nim-custom-{{ $.Env.GitReference }}" | ||
instances = { count = 1 } | ||
builder = "docker:generic" | ||
|
||
[groups.build_config] | ||
path = "./nim/" | ||
[groups.build_config.build_args] | ||
Libp2pVersion = '#{{ $.Env.GitReference }}' | ||
NimVersion = '{{ .NimVersion }}' | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} |
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,6 @@ | ||
[custom] | ||
NimVersion = "1.6.8" | ||
|
||
[[groups]] | ||
Id = "1.0.0" | ||
NimVersion = "1.6.8" |
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,14 @@ | ||
ARG NimVersion="latest" | ||
FROM nimlang/nim:${NimVersion}-alpine as builder | ||
|
||
RUN nimble install -y "https://github.com/status-im/testground-nim-sdk@#c282ff68c08ef85a7ca011e077e3e69eb1a6edec" | ||
|
||
ARG Libp2pVersion="#unstable" | ||
RUN nimble install -y "libp2p@${Libp2pVersion}" | ||
FROM builder | ||
|
||
ARG PLAN_PATH="./" | ||
COPY ./plan/${PLAN_PATH} ./plan | ||
RUN cd plan && nimble install -dy && nim c -d:chronicles_log_level=NOTICE main.nim | ||
|
||
ENTRYPOINT ["plan/main"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of introducing a new workflow file, how about including nim in
ping-interop.yml
. I don't see a reason why we should treat Go or Rust special.Maybe @MarcoPolo has opinions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping-interop.yml
will call thego-rust-interop.toml
compositionSo it could just call the
all-interop.toml
instead, but then thego-rust-interop.toml
will never be called, and maybe it should be removed?We would just have:
[language].toml
: list of versions of that implem[language]-cross-versions.toml
: test every version of that implemall-interop-latest.toml
: test last version of every implemall-interop.toml
: test every version of every implemThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this in my latest commit, we can revert if not happy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a high level I am in favor of this. I will take a detailed look now.