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 14 commits into
base: main
Choose a base branch
from

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented Oct 14, 2024

Description

The general idea:

  • top level simapp should contain all our modules and support a binary for all e2e tests
  • adds wasm to top level simapp, along with build requirements in workflow + Dockerfile
  • left 08-wasm Docker image for release building (instead of adding more conditionals into the workflows for the switch over point)
  • e2e's run off CI should use the simd image, running against older branches requires using existing release tag, or building new image via manual wasm build
  • left wasm e2e workflow to prevent wasm e2e test from being run on every pr

ref: #7231


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against the correct branch (see CONTRIBUTING.md).
  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@colin-axner colin-axner marked this pull request as ready for review October 14, 2024 09:47
@colin-axner colin-axner marked this pull request as draft October 14, 2024 09:47
@@ -569,6 +614,7 @@ func NewSimApp(
mockModule,

// IBC light clients
wasm.NewAppModule(app.WasmClientKeeper), // TODO(damian): see if we want to pass the lightclient module here, keeper is used in AppModule.RegisterServices etc
Copy link
Contributor Author

Choose a reason for hiding this comment

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

copied this over, is this todo still relevant? I'm not sure I see how the light client module could be passed?

@colin-axner colin-axner marked this pull request as ready for review October 14, 2024 09:56
@colin-axner colin-axner marked this pull request as draft October 14, 2024 09:56
@colin-axner colin-axner marked this pull request as ready for review October 14, 2024 10:04
@colin-axner colin-axner marked this pull request as draft October 14, 2024 10:04
@colin-axner colin-axner marked this pull request as ready for review October 14, 2024 10:15
@colin-axner colin-axner marked this pull request as draft October 14, 2024 10:15
@colin-axner colin-axner marked this pull request as ready for review October 14, 2024 10:23
@colin-axner colin-axner marked this pull request as draft October 14, 2024 10:23
@colin-axner colin-axner marked this pull request as ready for review October 14, 2024 10:28
@colin-axner colin-axner marked this pull request as draft October 14, 2024 10:28
@colin-axner colin-axner marked this pull request as ready for review October 14, 2024 10:41
@colin-axner colin-axner marked this pull request as draft October 14, 2024 10:41
@colin-axner colin-axner marked this pull request as ready for review October 14, 2024 12:52
@colin-axner colin-axner marked this pull request as draft October 14, 2024 12:52
@colin-axner colin-axner marked this pull request as ready for review October 14, 2024 13:38
@colin-axner colin-axner marked this pull request as draft October 14, 2024 13:38
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.

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)

- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

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.

@@ -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.

@colin-axner colin-axner marked this pull request as ready for review October 14, 2024 13:52
Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

left some initial comments, loving the direction these changes are headed in

@@ -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

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.

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)

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.

Copy link
Contributor

Choose a reason for hiding this comment

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


func main() {
rootCmd := cmd.NewRootCmd()
if err := svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this stay in until we remove all references to the wasm dockerfile? (Think it is still referenced in some fork workflows)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like that direction. I can split this work up:

  • add wasm into top level simapp
  • switch over wasm workflows to main workflow (I think there's some consideration around image building off release branches)
  • remove simd in wasm directory + Dockerfile (removes unnecessary deps)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went through the reference in the fork workflow and it looks like running wasm tests on forks is currently disabled

@colin-axner colin-axner marked this pull request as draft October 15, 2024 08:10
@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

damn, 7 dependencies 🪓

@colin-axner colin-axner marked this pull request as ready for review October 16, 2024 11:14
@colin-axner colin-axner marked this pull request as draft October 16, 2024 11:21
@colin-axner colin-axner marked this pull request as ready for review October 17, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants