From 5b761ef3b1c1c3afb8e81fc5e3e80bc02937b32b Mon Sep 17 00:00:00 2001 From: chatton Date: Mon, 21 Aug 2023 12:51:13 +0100 Subject: [PATCH 01/12] chore: adding dockerfile for callbacks simapp --- Dockerfile.callbacks | 29 ++ .../testing/simapp/simd/cmd/cmd_test.go | 25 ++ .../callbacks/testing/simapp/simd/cmd/root.go | 305 ++++++++++++++++++ .../callbacks/testing/simapp/simd/main.go | 24 ++ 4 files changed, 383 insertions(+) create mode 100644 Dockerfile.callbacks create mode 100644 modules/apps/callbacks/testing/simapp/simd/cmd/cmd_test.go create mode 100644 modules/apps/callbacks/testing/simapp/simd/cmd/root.go create mode 100644 modules/apps/callbacks/testing/simapp/simd/main.go diff --git a/Dockerfile.callbacks b/Dockerfile.callbacks new file mode 100644 index 00000000000..8d43787b291 --- /dev/null +++ b/Dockerfile.callbacks @@ -0,0 +1,29 @@ +FROM golang:1.20-alpine3.18 as builder + +RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make; + +ENV GOPATH="" +ENV GOMODULE="on" + +# 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 testing testing +ADD modules modules +ADD LICENSE LICENSE + +COPY go.mod . +COPY go.sum . + +WORKDIR modules/apps/callbacks + +RUN go mod download + +RUN GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false go build -mod=readonly -tags "netgo ledger" -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," -w -s' -trimpath -o /go/build/ ./... + +FROM alpine:3.18 + +COPY --from=builder /go/build/simd /bin/simd + +ENTRYPOINT ["simd"] + diff --git a/modules/apps/callbacks/testing/simapp/simd/cmd/cmd_test.go b/modules/apps/callbacks/testing/simapp/simd/cmd/cmd_test.go new file mode 100644 index 00000000000..2a034ea25da --- /dev/null +++ b/modules/apps/callbacks/testing/simapp/simd/cmd/cmd_test.go @@ -0,0 +1,25 @@ +package cmd_test + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + + "github.com/cosmos/ibc-go/v7/testing/simapp" + "github.com/cosmos/ibc-go/v7/testing/simapp/simd/cmd" +) + +func TestInitCmd(t *testing.T) { + rootCmd := cmd.NewRootCmd() + rootCmd.SetArgs([]string{ + "init", // Test the init cmd + "simapp-test", // Moniker + fmt.Sprintf("--%s=%s", cli.FlagOverwrite, "true"), // Overwrite genesis.json, in case it already exists + }) + + require.NoError(t, svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome)) +} diff --git a/modules/apps/callbacks/testing/simapp/simd/cmd/root.go b/modules/apps/callbacks/testing/simapp/simd/cmd/root.go new file mode 100644 index 00000000000..ef4106c1337 --- /dev/null +++ b/modules/apps/callbacks/testing/simapp/simd/cmd/root.go @@ -0,0 +1,305 @@ +package cmd + +import ( + "errors" + "io" + "os" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/config" + "github.com/cosmos/cosmos-sdk/client/debug" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/keys" + "github.com/cosmos/cosmos-sdk/client/pruning" + "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/client/snapshot" + "github.com/cosmos/cosmos-sdk/server" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/crisis" + genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + + dbm "github.com/cometbft/cometbft-db" + cmtcfg "github.com/cometbft/cometbft/config" + "github.com/cometbft/cometbft/libs/log" + + "github.com/cosmos/ibc-go/modules/apps/callbacks/testing/simapp" + "github.com/cosmos/ibc-go/modules/apps/callbacks/testing/simapp/params" +) + +// NewRootCmd creates a new root command for simd. It is called once in the +// main function. +func NewRootCmd() *cobra.Command { + // we "pre"-instantiate the application for getting the injected/configured encoding configuration + tempApp := simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(simapp.DefaultNodeHome)) + encodingConfig := params.EncodingConfig{ + InterfaceRegistry: tempApp.InterfaceRegistry(), + Codec: tempApp.AppCodec(), + TxConfig: tempApp.TxConfig(), + Amino: tempApp.LegacyAmino(), + } + + initClientCtx := client.Context{}. + WithCodec(encodingConfig.Codec). + WithInterfaceRegistry(encodingConfig.InterfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithLegacyAmino(encodingConfig.Amino). + WithInput(os.Stdin). + WithAccountRetriever(types.AccountRetriever{}). + WithHomeDir(simapp.DefaultNodeHome). + WithViper("") // In simapp, we don't use any prefix for env variables. + + rootCmd := &cobra.Command{ + Use: "simd", + Short: "simulation app", + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) + + initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) + if err != nil { + return err + } + + initClientCtx, err = config.ReadFromClientConfig(initClientCtx) + if err != nil { + return err + } + + if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { + return err + } + + customAppTemplate, customAppConfig := initAppConfig() + customTMConfig := initTendermintConfig() + + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig) + }, + } + + initRootCmd(rootCmd, encodingConfig) + + return rootCmd +} + +// initTendermintConfig helps to override default Tendermint Config values. +// return cmtcfg.DefaultConfig if no custom configuration is required for the application. +func initTendermintConfig() *cmtcfg.Config { + cfg := cmtcfg.DefaultConfig() + + // these values put a higher strain on node memory + // cfg.P2P.MaxNumInboundPeers = 100 + // cfg.P2P.MaxNumOutboundPeers = 40 + + return cfg +} + +// initAppConfig helps to override default appConfig template and configs. +// return "", nil if no custom configuration is required for the application. +func initAppConfig() (string, interface{}) { + // The following code snippet is just for reference. + + // WASMConfig defines configuration for the wasm module. + type WASMConfig struct { + // This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries + QueryGasLimit uint64 `mapstructure:"query_gas_limit"` + + // Address defines the gRPC-web server to listen on + LruSize uint64 `mapstructure:"lru_size"` + } + + type CustomAppConfig struct { + serverconfig.Config + + WASM WASMConfig `mapstructure:"wasm"` + } + + // Optionally allow the chain developer to overwrite the SDK's default + // server config. + srvCfg := serverconfig.DefaultConfig() + // The SDK's default minimum gas price is set to "" (empty value) inside + // app.toml. If left empty by validators, the node will halt on startup. + // However, the chain developer can set a default app.toml value for their + // validators here. + // + // In summary: + // - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their + // own app.toml config, + // - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their + // own app.toml to override, or use this default value. + // + // In simapp, we set the min gas prices to 0. + srvCfg.MinGasPrices = "0stake" + // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default + + customAppConfig := CustomAppConfig{ + Config: *srvCfg, + WASM: WASMConfig{ + LruSize: 1, + QueryGasLimit: 300000, + }, + } + + customAppTemplate := serverconfig.DefaultConfigTemplate + ` +[wasm] +# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries +query_gas_limit = 300000 +# This is the number of wasm vm instances we keep cached in memory for speed-up +# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally +lru_size = 0` + + return customAppTemplate, customAppConfig +} + +func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { + cfg := sdk.GetConfig() + cfg.Seal() + + rootCmd.AddCommand( + genutilcli.InitCmd(simapp.ModuleBasics, simapp.DefaultNodeHome), + debug.Cmd(), + config.Cmd(), + pruning.PruningCmd(newApp), + snapshot.Cmd(newApp), + ) + + server.AddCommands(rootCmd, simapp.DefaultNodeHome, newApp, appExport, addModuleInitFlags) + + // add keybase, auxiliary RPC, query, genesis, and tx child commands + rootCmd.AddCommand( + rpc.StatusCommand(), + genesisCommand(encodingConfig), + queryCommand(), + txCommand(), + keys.Commands(simapp.DefaultNodeHome), + ) +} + +func addModuleInitFlags(startCmd *cobra.Command) { + crisis.AddModuleInitFlags(startCmd) +} + +// genesisCommand builds genesis-related `simd genesis` command. Users may provide application specific commands as a parameter +func genesisCommand(encodingConfig params.EncodingConfig, cmds ...*cobra.Command) *cobra.Command { + cmd := genutilcli.GenesisCoreCommand(encodingConfig.TxConfig, simapp.ModuleBasics, simapp.DefaultNodeHome) + + for _, subCmd := range cmds { + cmd.AddCommand(subCmd) + } + return cmd +} + +func queryCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "query", + Aliases: []string{"q"}, + Short: "Querying subcommands", + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetAccountCmd(), + rpc.ValidatorCommand(), + rpc.BlockCommand(), + authcmd.QueryTxsByEventsCmd(), + authcmd.QueryTxCmd(), + ) + + simapp.ModuleBasics.AddQueryCommands(cmd) + + return cmd +} + +func txCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "tx", + Short: "Transactions subcommands", + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetSignCommand(), + authcmd.GetSignBatchCommand(), + authcmd.GetMultiSignCommand(), + authcmd.GetMultiSignBatchCmd(), + authcmd.GetValidateSignaturesCommand(), + authcmd.GetBroadcastCommand(), + authcmd.GetEncodeCommand(), + authcmd.GetDecodeCommand(), + authcmd.GetAuxToFeeCommand(), + ) + + simapp.ModuleBasics.AddTxCommands(cmd) + + return cmd +} + +// newApp creates the application +func newApp( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + appOpts servertypes.AppOptions, +) servertypes.Application { + baseappOptions := server.DefaultBaseappOptions(appOpts) + + return simapp.NewSimApp( + logger, db, traceStore, true, + appOpts, + baseappOptions..., + ) +} + +// appExport creates a new simapp (optionally at a given height) and exports state. +func appExport( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + height int64, + forZeroHeight bool, + jailAllowedAddrs []string, + appOpts servertypes.AppOptions, + modulesToExport []string, +) (servertypes.ExportedApp, error) { + var simApp *simapp.SimApp + + // this check is necessary as we use the flag in x/upgrade. + // we can exit more gracefully by checking the flag here. + homePath, ok := appOpts.Get(flags.FlagHome).(string) + if !ok || homePath == "" { + return servertypes.ExportedApp{}, errors.New("application home not set") + } + + viperAppOpts, ok := appOpts.(*viper.Viper) + if !ok { + return servertypes.ExportedApp{}, errors.New("appOpts is not viper.Viper") + } + + // overwrite the FlagInvCheckPeriod + viperAppOpts.Set(server.FlagInvCheckPeriod, 1) + appOpts = viperAppOpts + + if height != -1 { + simApp = simapp.NewSimApp(logger, db, traceStore, false, appOpts) + + if err := simApp.LoadHeight(height); err != nil { + return servertypes.ExportedApp{}, err + } + } else { + simApp = simapp.NewSimApp(logger, db, traceStore, true, appOpts) + } + + return simApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) +} diff --git a/modules/apps/callbacks/testing/simapp/simd/main.go b/modules/apps/callbacks/testing/simapp/simd/main.go new file mode 100644 index 00000000000..632c87573e5 --- /dev/null +++ b/modules/apps/callbacks/testing/simapp/simd/main.go @@ -0,0 +1,24 @@ +package main + +import ( + "os" + + "github.com/cosmos/cosmos-sdk/server" + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + + "github.com/cosmos/ibc-go/modules/apps/callbacks/testing/simapp" + "github.com/cosmos/ibc-go/modules/apps/callbacks/testing/simapp/simd/cmd" +) + +func main() { + rootCmd := cmd.NewRootCmd() + if err := svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome); err != nil { + switch e := err.(type) { + case server.ErrorCode: + os.Exit(e.Code) + + default: + os.Exit(1) + } + } +} From 7499227b8fe743e5045c55e0a1d661c0ad0129d1 Mon Sep 17 00:00:00 2001 From: chatton Date: Mon, 21 Aug 2023 12:55:19 +0100 Subject: [PATCH 02/12] ci: adding workflow to build and push callbacks simd docker image to ghcr --- .../build-callbacks-simd-image-from-tag.yml | 35 +++++++++++++++++++ Dockerfile.callbacks | 1 - 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-callbacks-simd-image-from-tag.yml diff --git a/.github/workflows/build-callbacks-simd-image-from-tag.yml b/.github/workflows/build-callbacks-simd-image-from-tag.yml new file mode 100644 index 00000000000..3fa54556834 --- /dev/null +++ b/.github/workflows/build-callbacks-simd-image-from-tag.yml @@ -0,0 +1,35 @@ +name: Build Callbacks Simd Image +on: + workflow_dispatch: + inputs: + tag: + description: 'The tag of the image to build' + required: true + type: string + +env: + REGISTRY: ghcr.io + ORG: cosmos + IMAGE_NAME: ibc-go-callbacks-simd + GIT_TAG: "${{ inputs.tag }}" + +jobs: + build-image-at-tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: "${{ env.GIT_TAG }}" + fetch-depth: 0 + - name: Log in to the Container registry + uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build image + run: | + # remove any `/` characters from the docker tag and replace them with a - + docker_tag="$(echo $GIT_TAG | sed 's/\//-/')" + docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" -f Dockerfile.callbacks + docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" diff --git a/Dockerfile.callbacks b/Dockerfile.callbacks index 8d43787b291..668bf643e84 100644 --- a/Dockerfile.callbacks +++ b/Dockerfile.callbacks @@ -26,4 +26,3 @@ FROM alpine:3.18 COPY --from=builder /go/build/simd /bin/simd ENTRYPOINT ["simd"] - From 6eb9a4840011fd8e12199be1d1693710034b2b0a Mon Sep 17 00:00:00 2001 From: chatton Date: Mon, 21 Aug 2023 13:33:03 +0100 Subject: [PATCH 03/12] chore: move dockerfile into callbacks dir --- .github/workflows/build-callbacks-simd-image-from-tag.yml | 2 +- Dockerfile.callbacks => modules/apps/callbacks/Dockerfile | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Dockerfile.callbacks => modules/apps/callbacks/Dockerfile (100%) diff --git a/.github/workflows/build-callbacks-simd-image-from-tag.yml b/.github/workflows/build-callbacks-simd-image-from-tag.yml index 3fa54556834..2d1bb4bdfdb 100644 --- a/.github/workflows/build-callbacks-simd-image-from-tag.yml +++ b/.github/workflows/build-callbacks-simd-image-from-tag.yml @@ -31,5 +31,5 @@ jobs: run: | # remove any `/` characters from the docker tag and replace them with a - docker_tag="$(echo $GIT_TAG | sed 's/\//-/')" - docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" -f Dockerfile.callbacks + docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" -f modules/apps/callbacks/Dockerfile docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" diff --git a/Dockerfile.callbacks b/modules/apps/callbacks/Dockerfile similarity index 100% rename from Dockerfile.callbacks rename to modules/apps/callbacks/Dockerfile From f845b3e43bd156fdd414de1c66162d817ae03a42 Mon Sep 17 00:00:00 2001 From: chatton Date: Mon, 21 Aug 2023 13:39:52 +0100 Subject: [PATCH 04/12] chore: removed duplicate test --- .../testing/simapp/simd/cmd/cmd_test.go | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 modules/apps/callbacks/testing/simapp/simd/cmd/cmd_test.go diff --git a/modules/apps/callbacks/testing/simapp/simd/cmd/cmd_test.go b/modules/apps/callbacks/testing/simapp/simd/cmd/cmd_test.go deleted file mode 100644 index 2a034ea25da..00000000000 --- a/modules/apps/callbacks/testing/simapp/simd/cmd/cmd_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package cmd_test - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/require" - - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - - "github.com/cosmos/ibc-go/v7/testing/simapp" - "github.com/cosmos/ibc-go/v7/testing/simapp/simd/cmd" -) - -func TestInitCmd(t *testing.T) { - rootCmd := cmd.NewRootCmd() - rootCmd.SetArgs([]string{ - "init", // Test the init cmd - "simapp-test", // Moniker - fmt.Sprintf("--%s=%s", cli.FlagOverwrite, "true"), // Overwrite genesis.json, in case it already exists - }) - - require.NoError(t, svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome)) -} From 376507ba02433ee7fba8afddd920edd18e071175 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Tue, 22 Aug 2023 12:30:39 +0100 Subject: [PATCH 05/12] Update modules/apps/callbacks/Dockerfile Co-authored-by: Jim Fasarakis-Hilliard --- modules/apps/callbacks/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apps/callbacks/Dockerfile b/modules/apps/callbacks/Dockerfile index 668bf643e84..d81cee1389e 100644 --- a/modules/apps/callbacks/Dockerfile +++ b/modules/apps/callbacks/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20-alpine3.18 as builder +FROM golang:1.21-alpine3.18 as builder RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make; From 869a976eef2c755250eef8ab9787484aeb6575a4 Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 22 Aug 2023 12:44:05 +0100 Subject: [PATCH 06/12] chore: fix linters --- modules/apps/callbacks/ibc_middleware_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/apps/callbacks/ibc_middleware_test.go b/modules/apps/callbacks/ibc_middleware_test.go index c995450ce50..78e2daf4669 100644 --- a/modules/apps/callbacks/ibc_middleware_test.go +++ b/modules/apps/callbacks/ibc_middleware_test.go @@ -774,6 +774,7 @@ func (s *CallbacksTestSuite) TestProcessCallback() { func() { executionGas := callbackData.ExecutionGasLimit expGasConsumed = executionGas + //nolint: unparam callbackExecutor = func(cachedCtx sdk.Context) error { cachedCtx.GasMeter().ConsumeGas(expGasConsumed+1, "callbackExecutor gas consumption") return nil @@ -811,6 +812,7 @@ func (s *CallbacksTestSuite) TestProcessCallback() { executionGas := callbackData.ExecutionGasLimit callbackData.CommitGasLimit = executionGas + 1 expGasConsumed = executionGas + //nolint: unparam callbackExecutor = func(cachedCtx sdk.Context) error { cachedCtx.GasMeter().ConsumeGas(executionGas+1, "callbackExecutor oog panic") return nil @@ -843,6 +845,7 @@ func (s *CallbacksTestSuite) TestProcessCallback() { ctx = s.chainB.GetContext() // set a callback executor that will always succeed after consuming expGasConsumed + //nolint: unparam callbackExecutor = func(cachedCtx sdk.Context) error { cachedCtx.GasMeter().ConsumeGas(expGasConsumed, "callbackExecutor gas consumption") return nil From c6e4e6292084077f5713f71caede77126d488dd9 Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 22 Aug 2023 12:51:09 +0100 Subject: [PATCH 07/12] chore: temporarily trigger workflow --- .github/workflows/build-callbacks-simd-image-from-tag.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-callbacks-simd-image-from-tag.yml b/.github/workflows/build-callbacks-simd-image-from-tag.yml index 2d1bb4bdfdb..63bf6906a0a 100644 --- a/.github/workflows/build-callbacks-simd-image-from-tag.yml +++ b/.github/workflows/build-callbacks-simd-image-from-tag.yml @@ -1,5 +1,6 @@ name: Build Callbacks Simd Image on: + pull_request: workflow_dispatch: inputs: tag: From b42fd13ff689d16a119d2fc2d4ca089e97c61995 Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 22 Aug 2023 12:52:31 +0100 Subject: [PATCH 08/12] remove tag --- .github/workflows/build-callbacks-simd-image-from-tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-callbacks-simd-image-from-tag.yml b/.github/workflows/build-callbacks-simd-image-from-tag.yml index 63bf6906a0a..cb0e03132f7 100644 --- a/.github/workflows/build-callbacks-simd-image-from-tag.yml +++ b/.github/workflows/build-callbacks-simd-image-from-tag.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - ref: "${{ env.GIT_TAG }}" +# ref: "${{ env.GIT_TAG }}" fetch-depth: 0 - name: Log in to the Container registry uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc From 8bfed4d914127e9c758d9e62f73b690766e3e47e Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 22 Aug 2023 12:58:19 +0100 Subject: [PATCH 09/12] hard code tag --- .github/workflows/build-callbacks-simd-image-from-tag.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-callbacks-simd-image-from-tag.yml b/.github/workflows/build-callbacks-simd-image-from-tag.yml index cb0e03132f7..6979efece95 100644 --- a/.github/workflows/build-callbacks-simd-image-from-tag.yml +++ b/.github/workflows/build-callbacks-simd-image-from-tag.yml @@ -1,6 +1,5 @@ name: Build Callbacks Simd Image on: - pull_request: workflow_dispatch: inputs: tag: @@ -31,6 +30,6 @@ jobs: - name: Build image run: | # remove any `/` characters from the docker tag and replace them with a - - docker_tag="$(echo $GIT_TAG | sed 's/\//-/')" + docker_tag="pr-4406" docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" -f modules/apps/callbacks/Dockerfile docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" From 9eaf7dc015e907cb0da51908670e9f5f7c8daa36 Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 22 Aug 2023 13:00:20 +0100 Subject: [PATCH 10/12] re-enable --- .github/workflows/build-callbacks-simd-image-from-tag.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-callbacks-simd-image-from-tag.yml b/.github/workflows/build-callbacks-simd-image-from-tag.yml index 6979efece95..948904129f7 100644 --- a/.github/workflows/build-callbacks-simd-image-from-tag.yml +++ b/.github/workflows/build-callbacks-simd-image-from-tag.yml @@ -1,5 +1,6 @@ name: Build Callbacks Simd Image on: + pull_request: workflow_dispatch: inputs: tag: From a05c16318b3152d3924cc3eb730551c871d824d8 Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 22 Aug 2023 14:17:43 +0100 Subject: [PATCH 11/12] chore: revert to previous state --- .github/workflows/build-callbacks-simd-image-from-tag.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-callbacks-simd-image-from-tag.yml b/.github/workflows/build-callbacks-simd-image-from-tag.yml index 948904129f7..2d1bb4bdfdb 100644 --- a/.github/workflows/build-callbacks-simd-image-from-tag.yml +++ b/.github/workflows/build-callbacks-simd-image-from-tag.yml @@ -1,6 +1,5 @@ name: Build Callbacks Simd Image on: - pull_request: workflow_dispatch: inputs: tag: @@ -20,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v3 with: -# ref: "${{ env.GIT_TAG }}" + ref: "${{ env.GIT_TAG }}" fetch-depth: 0 - name: Log in to the Container registry uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc @@ -31,6 +30,6 @@ jobs: - name: Build image run: | # remove any `/` characters from the docker tag and replace them with a - - docker_tag="pr-4406" + docker_tag="$(echo $GIT_TAG | sed 's/\//-/')" docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" -f modules/apps/callbacks/Dockerfile docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" From dfc13aa63c8fd9b732e7ba59e9bacdec44e073a1 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 23 Aug 2023 15:23:39 +0100 Subject: [PATCH 12/12] chore: adding readme to outline purpose of testing directory --- modules/apps/callbacks/testing/simapp/README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 modules/apps/callbacks/testing/simapp/README.md diff --git a/modules/apps/callbacks/testing/simapp/README.md b/modules/apps/callbacks/testing/simapp/README.md new file mode 100644 index 00000000000..7ee00030c45 --- /dev/null +++ b/modules/apps/callbacks/testing/simapp/README.md @@ -0,0 +1,7 @@ +# Callbacks Testing SimApp + +This testing directory is a duplicate of the ibc-go testing directory. +It is only here as a way of creating a separate SimApp binary to avoid introducing a dependency on the callbacks +module from within ibc-go. + +The simapp can be built with the workflow found [here](../../../../../.github/workflows/build-callbacks-simd-image-from-tag.yml).