From 9d58a5ad30c6994acc14bfc55b0f16ae5feb1956 Mon Sep 17 00:00:00 2001 From: fkneeland-figure <86616427+fkneeland-figure@users.noreply.github.com> Date: Mon, 13 Sep 2021 06:50:49 -0600 Subject: [PATCH] refactor: Cleanup rosetta-ci docker code (#10002) ## Description Add documentation for rosetta-cli dockerfile and rename folder for the rosetta-ci dockerfile. Closes: #10001 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 1 + Makefile | 6 +++--- contrib/rosetta/README.md | 7 +++++-- contrib/rosetta/{node => rosetta-ci}/Dockerfile | 2 +- contrib/rosetta/{node => rosetta-ci}/data.tar.gz | Bin contrib/rosetta/rosetta-cli/Dockerfile | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) rename contrib/rosetta/{node => rosetta-ci}/Dockerfile (90%) rename contrib/rosetta/{node => rosetta-ci}/data.tar.gz (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26c7aefd2aa0..fd52fa589362 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,6 +93,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (deps) [\#9956](https://github.com/cosmos/cosmos-sdk/pull/9956) Bump Tendermint to [v0.34.12](https://github.com/tendermint/tendermint/releases/tag/v0.34.12). * (cli) [\#9856](https://github.com/cosmos/cosmos-sdk/pull/9856) Overwrite `--sequence` and `--account-number` flags with default flag values when used with `offline=false` in `sign-batch` command. * (types) [\#10021](https://github.com/cosmos/cosmos-sdk/pull/10021) Speedup coins.AmountOf(), by removing many intermittent regex calls. +* (rosetta) [\#10001](https://github.com/cosmos/cosmos-sdk/issues/10001) Add documentation for rosetta-cli dockerfile and rename folder for the rosetta-ci dockerfile ### Bug Fixes diff --git a/Makefile b/Makefile index 86f444f80e96..b9183a2d8319 100644 --- a/Makefile +++ b/Makefile @@ -328,7 +328,7 @@ test-cover: .PHONY: test-cover test-rosetta: - docker build -t rosetta-ci:latest -f contrib/rosetta/node/Dockerfile . + docker build -t rosetta-ci:latest -f contrib/rosetta/rosetta-ci/Dockerfile . docker-compose -f contrib/rosetta/docker-compose.yaml up --abort-on-container-exit --exit-code-from test_rosetta --build .PHONY: test-rosetta @@ -513,8 +513,8 @@ localnet-stop: # builds rosetta test data dir rosetta-data: -docker container rm data_dir_build - docker build -t rosetta-ci:latest -f contrib/rosetta/node/Dockerfile . + docker build -t rosetta-ci:latest -f contrib/rosetta/rosetta-ci/Dockerfile . docker run --name data_dir_build -t rosetta-ci:latest sh /rosetta/data.sh - docker cp data_dir_build:/tmp/data.tar.gz "$(CURDIR)/contrib/rosetta/node/data.tar.gz" + docker cp data_dir_build:/tmp/data.tar.gz "$(CURDIR)/contrib/rosetta/rosetta-ci/data.tar.gz" docker container rm data_dir_build .PHONY: rosetta-data diff --git a/contrib/rosetta/README.md b/contrib/rosetta/README.md index f131c843b8ee..068bf9ed2438 100644 --- a/contrib/rosetta/README.md +++ b/contrib/rosetta/README.md @@ -15,9 +15,12 @@ Builds: Contains the required files to set up rosetta cli and make it work against its workflows -## node +## Rosetta-ci -Contains the files for a deterministic network, with fixed keys and some actions on there, to test parsing of msgs and historical balances. +Contains the files for a deterministic network, with fixed keys and some actions on there, to test parsing of msgs and historical balances. This image is used to run a simapp node and to run the rosetta server. + +## Rosetta-cli +The docker image for ./rosetta-cli/Dockerfile is on [docker hub](https://hub.docker.com/r/tendermintdev/rosetta-cli). Whenever rosetta-cli releases a new version, rosetta-cli/Dockerfile should be updated to reflect the new version and pushed to docker hub. ## Notes diff --git a/contrib/rosetta/node/Dockerfile b/contrib/rosetta/rosetta-ci/Dockerfile similarity index 90% rename from contrib/rosetta/node/Dockerfile rename to contrib/rosetta/rosetta-ci/Dockerfile index 0887f522f656..6c73d983c131 100644 --- a/contrib/rosetta/node/Dockerfile +++ b/contrib/rosetta/rosetta-ci/Dockerfile @@ -4,7 +4,7 @@ RUN apk add --no-cache tar # prepare node data WORKDIR /node -COPY ./contrib/rosetta/node/data.tar.gz data.tar.gz +COPY ./contrib/rosetta/rosetta-ci/data.tar.gz data.tar.gz RUN tar -zxvf data.tar.gz -C . # build simd diff --git a/contrib/rosetta/node/data.tar.gz b/contrib/rosetta/rosetta-ci/data.tar.gz similarity index 100% rename from contrib/rosetta/node/data.tar.gz rename to contrib/rosetta/rosetta-ci/data.tar.gz diff --git a/contrib/rosetta/rosetta-cli/Dockerfile b/contrib/rosetta/rosetta-cli/Dockerfile index f67070f6c42d..c360d37824aa 100644 --- a/contrib/rosetta/rosetta-cli/Dockerfile +++ b/contrib/rosetta/rosetta-cli/Dockerfile @@ -15,4 +15,4 @@ RUN apk add gcc libc-dev python3 --no-cache ENV PATH=$PATH:/bin -COPY --from=build /rosetta/rosetta-cli /bin/rosetta-cli +COPY --from=build /rosetta/rosetta-cli /bin/rosetta-cli \ No newline at end of file