-
Notifications
You must be signed in to change notification settings - Fork 588
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
base: main
Are you sure you want to change the base?
Changes from all commits
8445958
0fbe2f1
117f1ed
8330d9d
7312fac
71fb1b1
b4c7258
ebfa82a
e5616d9
30ca97b
4ddb0fb
32184df
af4fe10
1cd2408
f866ef1
836c330
1caf16b
73e6fbf
af2113c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,19 +21,28 @@ jobs: | |
build-image-at-tag: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: "${{ env.GIT_TAG }}" | ||
fetch-depth: 0 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | ||
with: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this is necessary to use the script to get the libwasm version and checksum |
||
run: make python-install-deps | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build image | ||
run: | | ||
- 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 - | ||
# this ensures the docker tag is valid. | ||
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 }} | ||
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
FROM golang:1.22-alpine3.20 as builder | ||
|
||
ARG IBC_GO_VERSION | ||
ARG LIBWASM_VERSION | ||
ARG LIBWASM_CHECKSUM | ||
|
||
# ensure the arguments are being specified for this image. | ||
RUN test -n "${IBC_GO_VERSION}" | ||
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="" | ||
|
||
# ensure the ibc go version is being specified for this image. | ||
RUN test -n "${IBC_GO_VERSION}" | ||
# 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 | ||
|
||
# Copy relevant files before go mod download. Replace directives to local paths break if local | ||
# files are not copied before go mod download. | ||
|
@@ -24,7 +34,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/ ./... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should I simply delete this file now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,14 +18,15 @@ | |
# 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/simapp | ||
|
||
RUN go mod download | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,18 +9,12 @@ replace github.com/cosmos/ibc-go/v9 => ../../../ | |
replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 | ||
|
||
require ( | ||
cosmossdk.io/api v0.7.6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. damn, 7 dependencies 🪓 |
||
cosmossdk.io/client/v2 v2.0.0-beta.5 | ||
cosmossdk.io/collections v0.4.0 | ||
cosmossdk.io/core v0.11.1 | ||
cosmossdk.io/errors v1.0.1 | ||
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 | ||
|
@@ -33,7 +27,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-20240903143218-8af14fe29dc1 | ||
google.golang.org/grpc v1.68.0 | ||
|
@@ -46,6 +39,7 @@ require ( | |
cloud.google.com/go/compute/metadata v0.5.0 // indirect | ||
cloud.google.com/go/iam v1.1.9 // indirect | ||
cloud.google.com/go/storage v1.41.0 // indirect | ||
cosmossdk.io/api v0.7.6 // indirect | ||
cosmossdk.io/depinject v1.0.0 // indirect | ||
filippo.io/edwards25519 v1.1.0 // indirect | ||
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect | ||
|
@@ -76,8 +70,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 | ||
|
@@ -171,6 +163,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 | ||
|
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.
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?
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.
yea! would be fine in follow up if you'd prefer.