-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: v0.45.x bump min go version to 1.17 (#11686)
- Loading branch information
1 parent
e73b7ee
commit ffef0ba
Showing
16 changed files
with
254 additions
and
90 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 |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- uses: technote-space/get-diff-action@v5 | ||
id: git_diff | ||
with: | ||
|
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- name: Display go version | ||
run: go version | ||
- run: make build | ||
|
@@ -26,7 +26,7 @@ jobs: | |
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- name: Display go version | ||
run: go version | ||
- name: Install runsim | ||
|
@@ -43,7 +43,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
|
@@ -69,7 +69,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
|
@@ -97,7 +97,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
|
@@ -125,7 +125,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
|
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
- name: Install Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- name: Unshallow | ||
run: git fetch --prune --unshallow | ||
- name: Create release | ||
|
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ jobs: | |
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- name: Display go version | ||
run: go version | ||
- name: install tparse | ||
|
@@ -32,7 +32,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- uses: technote-space/get-diff-action@v4 | ||
id: git_diff | ||
with: | ||
|
@@ -49,7 +49,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- name: Display go version | ||
run: go version | ||
- uses: technote-space/get-diff-action@v4 | ||
|
@@ -102,7 +102,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
PATTERNS: | | ||
|
@@ -180,7 +180,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
PATTERNS: | | ||
|
@@ -224,7 +224,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- uses: technote-space/get-diff-action@v4 | ||
id: git_diff | ||
with: | ||
|
@@ -234,7 +234,7 @@ jobs: | |
go.sum | ||
- name: start localnet | ||
run: | | ||
make clean build-simd-linux localnet-start | ||
make clean localnet-start | ||
if: env.GIT_DIFF | ||
- name: test liveness | ||
run: | | ||
|
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
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,7 +1,14 @@ | ||
all: simd-env | ||
|
||
simd-env: | ||
docker build --tag cosmossdk/simd-env -f simd-env/Dockerfile \ | ||
$(shell git rev-parse --show-toplevel) | ||
simd-env: simd-rmi | ||
docker build --tag cosmossdk/simd -f simd-env/Dockerfile \ | ||
$(shell git rev-parse --show-toplevel) | ||
|
||
.PHONY: all simd-env | ||
simd-dlv: simd-rmi | ||
docker build --tag cosmossdk/simd -f simd-dlv/Dockerfile \ | ||
$(shell git rev-parse --show-toplevel) | ||
|
||
simd-rmi: | ||
docker rmi cosmossdk/simd 2>/dev/null; true | ||
|
||
.PHONY: all simd-env simd-dlv simd-rmi |
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,22 @@ | ||
FROM golang:1.17-alpine AS build | ||
RUN apk add build-base git linux-headers libc-dev | ||
RUN go install github.com/go-delve/delve/cmd/dlv@latest | ||
WORKDIR /work | ||
COPY go.mod go.sum /work/ | ||
RUN go mod download | ||
COPY ./ /work | ||
RUN LEDGER_ENABLED=false make COSMOS_BUILD_OPTIONS="debug,nostrip" clean build | ||
|
||
FROM alpine:3.14 AS run | ||
RUN apk add bash curl jq | ||
COPY contrib/images/simd-dlv/wrapper.sh /usr/bin/wrapper.sh | ||
|
||
VOLUME /simd | ||
COPY --from=build /work/build/simd /simd/ | ||
COPY --from=build /go/bin/dlv /usr/local/bin | ||
WORKDIR /simd | ||
|
||
EXPOSE 26656 26657 2345 | ||
ENTRYPOINT ["/usr/bin/wrapper.sh"] | ||
CMD ["start", "--log_format", "plain"] | ||
STOPSIGNAL SIGTERM |
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,37 @@ | ||
# Remote Debugging with go-delve | ||
|
||
[Delve](https://github.com/go-delve/delve) is a debugger for the Go programming language. The goal of the project is to provide a simple, full featured debugging tool for Go. Delve should be easy to invoke and easy to use. Chances are if you're using a debugger, things aren't going your way. With that in mind, Delve should stay out of your way as much as possible. | ||
|
||
## Use-case | ||
|
||
Cosmos-SDK provides you with a local network to bootstrap a chain in your machine, but how does one debug a node or module? | ||
|
||
If we start a single node, we won't be able to debug transactions as the machine will be in bootstrapping phase trying to find peers to connect too, thats why we need to start a local network. | ||
|
||
But the current `localnet-start` does not provide us with debugging tools so that's why there is a different image for debugging a local network, that is to avoid any issues in the future were debugging won't be needed. | ||
|
||
Both `simd-env` and `simd-dlv` work and run the same, except that `simd-dlv` uses `go-delve` to run the binaries. | ||
|
||
## How to use | ||
|
||
The command to start a local network in debug mode is: | ||
|
||
```shell | ||
# make localnet-debug | ||
``` | ||
|
||
The command to stop the local network and destroy its containers is: | ||
|
||
```shell | ||
# make localnet-stop | ||
``` | ||
|
||
__note: this works the same for both `localnet-start` and `localnet-debug`__ | ||
|
||
Now, by default only `simdnode0` is run in debug mode, but you can run any of the other nodes in debug mode by changing the `DEBUG` environment variable to `1` in `docker-compose.yml`. | ||
|
||
## How to connect | ||
|
||
Delve will open a port on `2345` for `simdnode0` and it will increment for each of the other nodes that have `DEBUG` set to `1`. | ||
|
||
You can connect to the debugging server either through [GoLand IDE](https://www.jetbrains.com/help/go/attach-to-running-go-processes-with-debugger.html) or you can use [delve cli](https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_connect.md) command. |
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,25 @@ | ||
#!/usr/bin/env sh | ||
set -euo pipefail | ||
set -x | ||
|
||
DEBUG=${DEBUG:-0} | ||
BINARY=/simd/${BINARY:-simd} | ||
ID=${ID:-0} | ||
LOG=${LOG:-simd.log} | ||
|
||
if ! [ -f "${BINARY}" ]; then | ||
echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder. Please use the BINARY environment variable if the name of the binary is not 'simd'" | ||
exit 1 | ||
fi | ||
|
||
export SIMDHOME="/data/node${ID}/simd" | ||
|
||
if [ "$DEBUG" -eq 1 ]; then | ||
dlv --listen=:2345 --continue --headless=true --api-version=2 --accept-multiclient exec "${BINARY}" -- --home "${SIMDHOME}" "$@" | ||
elif [ "$DEBUG" -eq 1 ] && [ -d "$(dirname "${SIMDHOME}"/"${LOG}")" ]; then | ||
dlv --listen=:2345 --continue --headless=true --api-version=2 --accept-multiclient exec "${BINARY}" -- --home "${SIMDHOME}" "$@" | tee "${SIMDHOME}/${LOG}" | ||
elif [ -d "$(dirname "${SIMDHOME}"/"${LOG}")" ]; then | ||
"${BINARY}" --home "${SIMDHOME}" "$@" | tee "${SIMDHOME}/${LOG}" | ||
else | ||
"${BINARY}" --home "${SIMDHOME}" "$@" | ||
fi |
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
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 @@ | ||
FROM golang:1.15-alpine as build | ||
FROM golang:1.17-alpine as build | ||
|
||
RUN apk add git gcc libc-dev --no-cache | ||
|
||
|
Oops, something went wrong.