Skip to content
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

chore: add go-libp2p@v0.33.1 for perf.yml #351

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 79 additions & 22 deletions .github/workflows/add-new-impl-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,56 +16,113 @@ permissions:
actions: write

jobs:
go:
add:
name: Add (${{ matrix.branch }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- branch: perf/go-libp2p
workflow: perf.yml
directory: perf/impl/go-libp2p
script: |
pushd $DIRECTORY
cp -r $LOCAL_MAJOR_MINOR_VERSION $REMOTE_MAJOR_MINOR_VERSION
pushd $REMOTE_MAJOR_MINOR_VERSION
sed -i "1s/$LOCAL_MAJOR_MINOR_VERSION/$REMOTE_MAJOR_MINOR_VERSION/g" go.mod
go mod tidy -go=$GO_MAJOR_MINOR_VERSION
go mod tidy
go get github.com/libp2p/go-libp2p@$REMOTE_VERSION
popd
git add .
git commit -m "chore: add go-libp2p@$REMOTE_VERSION to $DIRECTORY"
popd
pushd perf/runner
versions="$(jq '. + map(select(.implementation == "go-libp2p" and .id == env.LOCAL_MAJOR_MINOR_VERSION) | .id = env.REMOTE_MAJOR_MINOR_VERSION)' versionsInput.json)"
echo "$versions" > versionsInput.json
git add versionsInput.json
git commit -m "chore: add go-libp2p@$REMOTE_VERSION to versionsInput.json"
popd
- branch: transport-interop/go-libp2p
workflow: transport-interop.yml
directory: transport-interop/impl/go
script: |
pushd $DIRECTORY
cp -r $LOCAL_MAJOR_MINOR_VERSION $REMOTE_MAJOR_MINOR_VERSION
pushd $REMOTE_MAJOR_MINOR_VERSION
sed -i "s/image_name := go-${LOCAL_MAJOR_MINOR_VERSION}/image_name := go-${REMOTE_MAJOR_MINOR_VERSION}/g" Makefile
sed -i "s/version := ${LOCAL_MAJOR_MINOR_VERSION#v}\..*/version := ${REMOTE_VERSION#v}/g" Makefile
make version.lock
popd
git add .
git commit -m "chore: add go-libp2p@$REMOTE_VERSION to $DIRECTORY"
popd
pushd transport-interop
versions="$(jq '. + map(select(.id == "go-\(env.LOCAL_MAJOR_MINOR_VERSION)") | .id = "go-\(env.REMOTE_MAJOR_MINOR_VERSION)")' versionsInput.json)"
echo "$versions" > versionsInput.json
git add versionsInput.json
git commit -m "chore: add go-libp2p@$REMOTE_VERSION to versionsInput.json"
popd
env:
DIR: perf/impl/go-libp2p
REPO: libp2p/go-libp2p
BRANCH: perf/go-libp2p
BRANCH: ${{ matrix.branch }}
WORKFLOW: ${{ matrix.workflow }}
DIRECTORY: ${{ matrix.directory }}
steps:
- name: Checkout test-plans
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Configure git
run: |
git fetch origin $BRANCH && git checkout $BRANCH || git checkout -b $BRANCH
git rebase $GITHUB_REF -X theirs || git rebase --abort
git config --global user.email $GITHUB_ACTOR@users.noreply.github.com
git config --global user.name $GITHUB_ACTOR
- id: go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: stable
- name: Get the latest version (local)
id: local
run: ls -d v* | sort -V | tail -n-1 | xargs -I{} echo "version={}" | tee -a $GITHUB_OUTPUT
working-directory: ${{ env.DIR }}
working-directory: ${{ env.DIRECTORY }}
- name: Get the latest version (remote)
id: remote
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh api repos/$REPO/releases/latest --jq '.tag_name' | xargs -I{} echo "version={}" | tee -a $GITHUB_OUTPUT
run: gh api repos/libp2p/go-libp2p/releases/latest --jq '.tag_name' | xargs -I{} echo "version={}" | tee -a $GITHUB_OUTPUT
- id: mm
env:
REMOTE_VERSION: ${{ steps.remote.outputs.version }}
GO_VERSION: ${{ steps.go.outputs.go-version }}
run: |
echo $REMOTE_VERSION | sed 's/\.[0-9]*$//' | xargs -I{} echo "remote={}" | tee -a $GITHUB_OUTPUT
echo $GO_VERSION | sed 's/\.[0-9]*$//' | xargs -I{} echo "go={}" | tee -a $GITHUB_OUTPUT
- name: Add the latest version
if: ${{ !startsWith(steps.remote.outputs.version, steps.local.outputs.version) }}
env:
LOCAL_VERSION: ${{ steps.local.outputs.version }}
LOCAL_MAJOR_MINOR_VERSION: ${{ steps.local.outputs.version }}
REMOTE_VERSION: ${{ steps.remote.outputs.version }}
REMOTE_MAJOR_MINOR_VERSION: ${{ steps.mm.outputs.remote }}
GO_VERSION: ${{ steps.go.outputs.go-version }}
GO_MAJOR_MINOR_VERSION: ${{ steps.mm.outputs.go }}
run: ${{ matrix.script }}
- if: ${{ !startsWith(steps.remote.outputs.version, steps.local.outputs.version) }}
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
majorMinorRemoteVersion=$(echo $REMOTE_VERSION | sed 's/\.[0-9]*$//')
majorMinorGoVersion=$(echo $GO_VERSION | sed 's/\.[0-9]*$//')
cp -r $LOCAL_VERSION $majorMinorRemoteVersion
cd $majorMinorRemoteVersion
sed -i "1s/$LOCAL_VERSION/$majorMinorRemoteVersion/g" go.mod
go mod tidy -go=$majorMinorGoVersion
go mod tidy
go get github.com/libp2p/go-libp2p@$REMOTE_VERSION
git add .
git commit -m "chore: add go-libp2p@$REMOTE_VERSION to $DIR"
# push the changes
git push origin $BRANCH --force
# create a PR if an open one doesn't exist yet
if [[ $(gh pr list --state open --base $GITHUB_REF --head $BRANCH | wc -l) -eq 0 ]]; then
gh pr create --title "chore: add go-libp2p@$REMOTE_VERSION to $DIR" --body "This PR adds go-libp2p@$REMOTE_VERSION to $DIR" --head $BRANCH --base $GITHUB_REF
gh pr create --title "chore: add go-libp2p@$REMOTE_VERSION for $WORKFLOW" --body "This PR adds go-libp2p@$REMOTE_VERSION for $WORKFLOW" --head $BRANCH --base $GITHUB_REF
fi
gh workflow run perf.yml --ref $BRANCH
working-directory: ${{ env.DIR }}
gh workflow run $WORKFLOW --ref $BRANCH
2 changes: 2 additions & 0 deletions perf/impl/go-libp2p/v0.33/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
perf
.cache
12 changes: 12 additions & 0 deletions perf/impl/go-libp2p/v0.33/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
GO_FILES := $(wildcard *.go)

all: perf

perf: $(GO_FILES)
docker run --rm --user "$(shell id -u):$(shell id -g)" -v "$(shell pwd)":/usr/src/myapp -w /usr/src/myapp -e GOCACHE=/usr/src/myapp/.cache golang:$(shell awk '/^go [0-9]+\.[0-9]+$$/ {print $$2}' go.mod) go build -o perf .

clean:
rm -r .cache
rm perf

.PHONY: all clean
95 changes: 95 additions & 0 deletions perf/impl/go-libp2p/v0.33/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
module github.com/libp2p/test-plans/perf/impl/go-libp2p/v0.33

go 1.22

toolchain go1.22.1

require (
github.com/ipfs/go-log/v2 v2.5.1
github.com/libp2p/go-buffer-pool v0.1.0
github.com/libp2p/go-libp2p v0.33.1
github.com/multiformats/go-multiaddr v0.12.2
)

require (
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/elastic/gosigar v0.14.2 // indirect
github.com/flynn/noise v1.1.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/huin/goupnp v1.3.0 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
github.com/klauspost/compress v1.17.6 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/koron/go-ssdp v0.0.4 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/libp2p/go-nat v0.2.0 // indirect
github.com/libp2p/go-netroute v0.2.1 // indirect
github.com/libp2p/go-reuseport v0.4.0 // indirect
github.com/libp2p/go-yamux/v4 v4.0.1 // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/miekg/dns v1.1.58 // indirect
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multicodec v0.9.0 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-multistream v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.47.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qtls-go1-20 v0.3.4 // indirect
github.com/quic-go/quic-go v0.42.0 // indirect
github.com/quic-go/webtransport-go v0.6.0 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
go.uber.org/dig v1.17.1 // indirect
go.uber.org/fx v1.20.1 // indirect
go.uber.org/mock v0.4.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.18.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
)
Loading
Loading