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

refactor: remove unnecessary deps from 08-wasm by reusing top level simapp binary #7445

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8445958
refactor: move 08-wasm to use top level simapp for binary
colin-axner Oct 14, 2024
0fbe2f1
refactor: add wasm build info to top level docker build file
colin-axner Oct 14, 2024
117f1ed
fix: update workflow build file
colin-axner Oct 14, 2024
8330d9d
chore: update workflow files to include wasm args
colin-axner Oct 14, 2024
7312fac
fix: test docker build with libwasm args
colin-axner Oct 14, 2024
71fb1b1
fix: small adjustments to workflow file
colin-axner Oct 14, 2024
b4c7258
fix? dockerfile
colin-axner Oct 14, 2024
ebfa82a
chore: slight adjustment to workflow
colin-axner Oct 14, 2024
e5616d9
Merge branch 'main' into colin/7231-rm-wasm-callbacks-bin-logic
colin-axner Oct 14, 2024
30ca97b
fix: dockerfile
colin-axner Oct 14, 2024
4ddb0fb
Merge branch 'colin/7231-rm-wasm-callbacks-bin-logic' of github.com:c…
colin-axner Oct 14, 2024
32184df
chore: refactor workflows
colin-axner Oct 16, 2024
af4fe10
refactor: remove more unnecessary deps
colin-axner Oct 16, 2024
1cd2408
Merge branch 'main' of github.com:cosmos/ibc-go into colin/7231-rm-wa…
colin-axner Oct 17, 2024
f866ef1
Merge branch 'main' into colin/7231-rm-wasm-callbacks-bin-logic
DimitrisJim Nov 11, 2024
836c330
chore: fix post merge issues.
DimitrisJim Nov 11, 2024
1caf16b
Merge branch 'main' into colin/7231-rm-wasm-callbacks-bin-logic
DimitrisJim Nov 11, 2024
73e6fbf
Merge branch 'main' into colin/7231-rm-wasm-callbacks-bin-logic
DimitrisJim Nov 12, 2024
af2113c
chore: fix workflow file.
DimitrisJim Nov 12, 2024
74367d9
Merge branch 'main' into colin/7231-rm-wasm-callbacks-bin-logic
DimitrisJim Nov 19, 2024
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
8 changes: 8 additions & 0 deletions .github/workflows/build-simd-image-from-tag.yml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I try to remove all the custom wasm workflows? I feel like now that we have a single place for a simapp, we should just be building a single simd. What do people think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea! would be fine in follow up if you'd prefer.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
with:
ref: "${{ env.GIT_TAG }}"
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
damiannolan marked this conversation as resolved.
Show resolved Hide resolved
run: make python-install-deps
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
Expand All @@ -33,6 +38,9 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: |
version="$(scripts/get-libwasm-version.py --get-version)"
checksum="$(scripts/get-libwasm-version.py --get-checksum)"

# remove any `/` characters from the docker tag and replace them with a -
docker_tag="$(echo $GIT_TAG | sed 's/[^a-zA-Z0-9\.]/-/g')"
docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" --build-arg IBC_GO_VERSION=${{ inputs.ibc-go-version }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docker.yml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice if someone could double check all the workflow changes, especially release.yml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also add the install python step here? (unless I am not seeing something)

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
context: .
tags: ${{ steps.meta.outputs.tags }}
build-args: |
version="$(scripts/get-libwasm-version.py --get-version)"
checksum="$(scripts/get-libwasm-version.py --get-checksum)"

IBC_GO_VERSION=main

- name: Test simd is runnable
Expand All @@ -52,4 +55,7 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
version="$(scripts/get-libwasm-version.py --get-version)"
checksum="$(scripts/get-libwasm-version.py --get-checksum)"

IBC_GO_VERSION=main
20 changes: 19 additions & 1 deletion .github/workflows/e2e-test-workflow-call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: ${{ inputs.build-and-push-docker-image }}
- uses: actions/setup-python@v5
if: ${{ inputs.build-and-push-docker-image }}
with:
python-version: '3.10'

- name: Install dependencies
if: ${{ inputs.build-and-push-docker-image }}
run: make python-install-deps

- name: Determine Build arguments
if: ${{ inputs.build-and-push-docker-image }}
id: build-args
run: |
echo "version=$(scripts/get-libwasm-version.py --get-version)" >> $GITHUB_OUTPUT
echo "checksum=$(scripts/get-libwasm-version.py --get-checksum)" >> $GITHUB_OUTPUT

- name: Log in to the Container registry
if: ${{ inputs.build-and-push-docker-image }}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
Expand All @@ -139,6 +155,8 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
build-args: |
IBC_GO_VERSION=${{ github.ref_name }}
LIBWASM_VERSION=${{ steps.build-args.outputs.version }}
LIBWASM_CHECKSUM=${{ steps.build-args.outputs.checksum }}

docker-build-wasm:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -313,4 +331,4 @@ jobs:
with:
name: '${{ matrix.entrypoint }}-${{ matrix.test }}'
path: e2e/diagnostics
retention-days: 5
retention-days: 5
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: make python-install-deps

- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
Expand All @@ -59,3 +61,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
build-args: |
IBC_GO_VERSION=${{ github.ref_name }}
version="$(scripts/get-libwasm-version.py --get-version)"
checksum="$(scripts/get-libwasm-version.py --get-checksum)"

13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
FROM golang:1.22-alpine3.20 as builder
ARG IBC_GO_VERSION

ARG LIBWASM_VERSION
ARG LIBWASM_CHECKSUM

RUN test -n "${LIBWASM_VERSION}"
RUN test -n "${LIBWASM_CHECKSUM}"

RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make;

ENV GOPATH=""

# Grab the static library and copy it to location that will be found by the linker flag `-lwasmvm_muslc`.
ADD https://github.com/CosmWasm/wasmvm/releases/download/${LIBWASM_VERSION}/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep ${LIBWASM_CHECKSUM}
RUN cp /lib/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.a

# ensure the ibc go version is being specified for this image.
RUN test -n "${IBC_GO_VERSION}"

Expand All @@ -24,7 +35,7 @@ COPY go.sum .

RUN go mod download

RUN make build
RUN cd simapp && GOOS=linux GOARCH=amd64 go build -mod=readonly -tags "netgo ledger muslc" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=sim -X github.com/cosmos/cosmos-sdk/version.AppName=simd -X github.com/cosmos/cosmos-sdk/version.Version= -X github.com/cosmos/cosmos-sdk/version.Commit= -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger muslc," -w -s -linkmode=external -extldflags "-Wl,-z,muldefs -static"' -trimpath -o /go/build/ ./...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like -linkmode=external -extldflags "-Wl,-z,muldefs -static" is not usually included when we run make build. Should I try to include these changes there as well? Folks okay if I hardcode it for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did a quick peek into changing this, but ran into a little difficulties, so I'll let someone be my guest if they want to adjust it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can open an issue but personally fine with hardcoding it for now, seems like a nice to have someone can pick up in future.


FROM alpine:3.18
ARG IBC_GO_VERSION
Expand Down
4 changes: 0 additions & 4 deletions e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,6 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE=
cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k=
cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y=
cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ=
cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q=
cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4=
cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc=
cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8=
cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ=
cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw=
Expand Down
3 changes: 2 additions & 1 deletion modules/light-clients/08-wasm/Dockerfile
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I simply delete this file now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ RUN cp /lib/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.a
# Copy relevant files before go mod download. Replace directives to local paths break if local
# files are not copied before go mod download.
ADD internal internal
ADD simapp simapp

Check notice

Code scanning / SonarCloud

Prefer COPY over ADD for copying local resources Low

Replace this ADD instruction with a COPY instruction. See more on SonarQube Cloud
ADD testing testing
ADD modules modules
ADD LICENSE LICENSE

COPY go.mod .
COPY go.sum .

WORKDIR /go/modules/light-clients/08-wasm
#WORKDIR /go/modules/light-clients/08-wasm

RUN go mod download

Expand Down
8 changes: 1 addition & 7 deletions modules/light-clients/08-wasm/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ require (
cosmossdk.io/log v1.4.1
cosmossdk.io/math v1.3.0
cosmossdk.io/store v1.1.1
cosmossdk.io/tools/confix v0.1.2
cosmossdk.io/x/circuit v0.1.1
cosmossdk.io/x/evidence v0.1.1
cosmossdk.io/x/feegrant v0.1.1
cosmossdk.io/x/tx v0.13.5
cosmossdk.io/x/upgrade v0.1.4
github.com/CosmWasm/wasmvm/v2 v2.1.2
Expand All @@ -33,7 +29,6 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/spf13/cast v1.7.0
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142
google.golang.org/grpc v1.67.1
Expand Down Expand Up @@ -77,8 +72,6 @@ require (
github.com/cosmos/iavl v1.2.0 // indirect
github.com/cosmos/ics23/go v0.11.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/creachadair/atomicfile v0.3.1 // indirect
github.com/creachadair/tomledit v0.0.24 // indirect
github.com/danieljoos/wincred v1.2.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
Expand Down Expand Up @@ -172,6 +165,7 @@ require (
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.19.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
Expand Down
12 changes: 0 additions & 12 deletions modules/light-clients/08-wasm/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,6 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE=
cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k=
cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y=
cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4=
cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo=
cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ=
cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q=
cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4=
cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc=
cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8=
cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ=
cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw=
cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38=
Expand Down Expand Up @@ -370,10 +362,6 @@ github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5n
github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q=
github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU=
github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ=
github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs=
Expand Down
Loading
Loading