From 8852f16b1ca3909641ba38ee8df190b91e11ba7f Mon Sep 17 00:00:00 2001 From: punishell <33149001+punishell@users.noreply.github.com> Date: Thu, 22 Sep 2022 13:34:58 +0200 Subject: [PATCH 1/6] DOCKER_BUILDKIT=1 is not passed when using docker-compose DOCKER_BUILDKIT=1 is not passed when using docker-compose it needs to be changed to DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 in order to make e.g: make localnet-build works --- Makefile | 244 +++++++++++++++++++++++++++---------------------------- 1 file changed, 122 insertions(+), 122 deletions(-) diff --git a/Makefile b/Makefile index 90b2d33ea6c..feba1b4a418 100644 --- a/Makefile +++ b/Makefile @@ -52,10 +52,10 @@ build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) # process linker flags ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=osmosis \ - -X github.com/cosmos/cosmos-sdk/version.AppName=osmosisd \ - -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ - -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ - -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" + -X github.com/cosmos/cosmos-sdk/version.AppName=osmosisd \ + -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ + -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ + -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" ifeq (cleveldb,$(findstring cleveldb,$(OSMOSIS_BUILD_OPTIONS))) ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb @@ -66,7 +66,7 @@ ifeq (,$(findstring nostrip,$(OSMOSIS_BUILD_OPTIONS))) ldflags += -w -s endif ifeq ($(LINK_STATICALLY),true) - ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static" + ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static" endif ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) @@ -88,10 +88,10 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ $(BUILD_TARGETS): go.sum $(BUILDDIR)/ - go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./... + go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./... $(BUILDDIR)/: - mkdir -p $(BUILDDIR)/ + mkdir -p $(BUILDDIR)/ # Cross-building for arm64 from amd64 (or viceversa) takes # a lot of time due to QEMU virtualization but it's the only way (afaik) @@ -100,58 +100,58 @@ $(BUILDDIR)/: build-reproducible: build-reproducible-amd64 build-reproducible-arm64 build-reproducible-amd64: go.sum $(BUILDDIR)/ - $(DOCKER) buildx create --name osmobuilder || true - $(DOCKER) buildx use osmobuilder - $(DOCKER) buildx build \ - --build-arg GO_VERSION=$(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) \ - --platform linux/arm64 \ - -t osmosis-amd64 \ - --load \ - -f Dockerfile . - $(DOCKER) rm -f osmobinary || true - $(DOCKER) create -ti --name osmobinary osmosis-amd64 - $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-amd64 - $(DOCKER) rm -f osmobinary + $(DOCKER) buildx create --name osmobuilder || true + $(DOCKER) buildx use osmobuilder + $(DOCKER) buildx build \ + --build-arg GO_VERSION=$(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) \ + --platform linux/arm64 \ + -t osmosis-amd64 \ + --load \ + -f Dockerfile . + $(DOCKER) rm -f osmobinary || true + $(DOCKER) create -ti --name osmobinary osmosis-amd64 + $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-amd64 + $(DOCKER) rm -f osmobinary build-reproducible-arm64: go.sum $(BUILDDIR)/ - $(DOCKER) buildx create --name osmobuilder || true - $(DOCKER) buildx use osmobuilder - $(DOCKER) buildx build \ - --build-arg GO_VERSION=$(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) \ - --platform linux/arm64 \ - -t osmosis-arm64 \ - --load \ - -f Dockerfile . - $(DOCKER) rm -f osmobinary || true - $(DOCKER) create -ti --name osmobinary osmosis-arm64 - $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-arm64 - $(DOCKER) rm -f osmobinary + $(DOCKER) buildx create --name osmobuilder || true + $(DOCKER) buildx use osmobuilder + $(DOCKER) buildx build \ + --build-arg GO_VERSION=$(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) \ + --platform linux/arm64 \ + -t osmosis-arm64 \ + --load \ + -f Dockerfile . + $(DOCKER) rm -f osmobinary || true + $(DOCKER) create -ti --name osmobinary osmosis-arm64 + $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-arm64 + $(DOCKER) rm -f osmobinary build-linux: go.sum - LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build + LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build build-contract-tests-hooks: - mkdir -p $(BUILDDIR) - go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./cmd/contract_tests + mkdir -p $(BUILDDIR) + go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./cmd/contract_tests go-mod-cache: go.sum - @echo "--> Download go modules to local cache" - @go mod download + @echo "--> Download go modules to local cache" + @go mod download go.sum: go.mod - @echo "--> Ensure dependencies have not been modified" - @go mod verify + @echo "--> Ensure dependencies have not been modified" + @go mod verify draw-deps: - @# requires brew install graphviz or apt-get install graphviz - go get github.com/RobotsAndPencils/goviz - @goviz -i ./cmd/osmosisd -d 2 | dot -Tpng -o dependency-graph.png + @# requires brew install graphviz or apt-get install graphviz + go get github.com/RobotsAndPencils/goviz + @goviz -i ./cmd/osmosisd -d 2 | dot -Tpng -o dependency-graph.png clean: - rm -rf $(CURDIR)/artifacts/ + rm -rf $(CURDIR)/artifacts/ distclean: clean - rm -rf vendor/ + rm -rf vendor/ ############################################################################### ### Proto ### @@ -160,33 +160,33 @@ distclean: clean proto-all: proto-format proto-gen proto: - @echo - @echo "=========== Generate Message ============" - @echo - ./scripts/protocgen.sh - @echo - @echo "=========== Generate Complete ============" - @echo + @echo + @echo "=========== Generate Message ============" + @echo + ./scripts/protocgen.sh + @echo + @echo "=========== Generate Complete ============" + @echo test: - @go test -v ./x/... + @go test -v ./x/... docs: - @echo - @echo "=========== Generate Message ============" - @echo - ./scripts/generate-docs.sh + @echo + @echo "=========== Generate Message ============" + @echo + ./scripts/generate-docs.sh - statik -src=client/docs/static -dest=client/docs -f -m - @if [ -n "$(git status --porcelain)" ]; then \ + statik -src=client/docs/static -dest=client/docs -f -m + @if [ -n "$(git status --porcelain)" ]; then \ echo "\033[91mSwagger docs are out of sync!!!\033[0m";\ exit 1;\ else \ echo "\033[92mSwagger docs are in sync\033[0m";\ fi - @echo - @echo "=========== Generate Complete ============" - @echo + @echo + @echo "=========== Generate Complete ============" + @echo .PHONY: docs protoVer=v0.8 @@ -195,47 +195,47 @@ containerProtoGen=cosmos-sdk-proto-gen-$(protoVer) containerProtoFmt=cosmos-sdk-proto-fmt-$(protoVer) proto-gen: - @echo "Generating Protobuf files" - @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \ - sh ./scripts/protocgen.sh; fi + @echo "Generating Protobuf files" + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \ + sh ./scripts/protocgen.sh; fi proto-format: - @echo "Formatting Protobuf files" - @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \ - find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi + @echo "Formatting Protobuf files" + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \ + find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi proto-image-build: - @DOCKER_BUILDKIT=1 docker build -t $(protoImageName) -f ./proto/Dockerfile ./proto + NFTvuln1155 docker build -t $(protoImageName) -f ./proto/Dockerfile ./proto proto-image-push: - docker push $(protoImageName) + docker push $(protoImageName) ############################################################################### ### Querygen ### ############################################################################### run-querygen: - @go run cmd/querygen/main.go + @go run cmd/querygen/main.go ############################################################################### ### Devdoc ### ############################################################################### build-docs: - @cd docs && \ - while read p; do \ - (git checkout $${p} && npm install && VUEPRESS_BASE="/$${p}/" npm run build) ; \ - mkdir -p ~/output/$${p} ; \ - cp -r .vuepress/dist/* ~/output/$${p}/ ; \ - cp ~/output/$${p}/index.html ~/output ; \ - done < versions ; + @cd docs && \ + while read p; do \ + (git checkout $${p} && npm install && VUEPRESS_BASE="/$${p}/" npm run build) ; \ + mkdir -p ~/output/$${p} ; \ + cp -r .vuepress/dist/* ~/output/$${p}/ ; \ + cp ~/output/$${p}/index.html ~/output ; \ + done < versions ; sync-docs: - cd ~/output && \ - echo "role_arn = ${DEPLOYMENT_ROLE_ARN}" >> /root/.aws/config ; \ - echo "CI job = ${CIRCLE_BUILD_URL}" >> version.html ; \ - aws s3 sync . s3://${WEBSITE_BUCKET} --profile terraform --delete ; \ - aws cloudfront create-invalidation --distribution-id ${CF_DISTRIBUTION_ID} --profile terraform --path "/*" ; + cd ~/output && \ + echo "role_arn = ${DEPLOYMENT_ROLE_ARN}" >> /root/.aws/config ; \ + echo "CI job = ${CIRCLE_BUILD_URL}" >> version.html ; \ + aws s3 sync . s3://${WEBSITE_BUCKET} --profile terraform --delete ; \ + aws cloudfront create-invalidation --distribution-id ${CF_DISTRIBUTION_ID} --profile terraform --path "/*" ; .PHONY: sync-docs @@ -253,25 +253,25 @@ test: test-unit test-build test-all: check test-race test-cover test-unit: - @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock norace' $(PACKAGES_UNIT) + @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock norace' $(PACKAGES_UNIT) test-race: - @VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' $(PACKAGES_UNIT) + @VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' $(PACKAGES_UNIT) test-cover: - @VERSION=$(VERSION) go test -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic $(PACKAGES_UNIT) + @VERSION=$(VERSION) go test -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic $(PACKAGES_UNIT) test-sim-suite: - @VERSION=$(VERSION) go test -mod=readonly $(PACKAGES_SIM) + @VERSION=$(VERSION) go test -mod=readonly $(PACKAGES_SIM) test-sim-app: - @VERSION=$(VERSION) go test -mod=readonly -run ^TestFullAppSimulation -v $(PACKAGES_SIM) + @VERSION=$(VERSION) go test -mod=readonly -run ^TestFullAppSimulation -v $(PACKAGES_SIM) test-sim-determinism: - @VERSION=$(VERSION) go test -mod=readonly -run ^TestAppStateDeterminism -v $(PACKAGES_SIM) + @VERSION=$(VERSION) go test -mod=readonly -run ^TestAppStateDeterminism -v $(PACKAGES_SIM) test-sim-bench: - @VERSION=$(VERSION) go test -benchmem -run ^BenchmarkFullAppSimulation -bench ^BenchmarkFullAppSimulation -cpuprofile cpu.out $(PACKAGES_SIM) + @VERSION=$(VERSION) go test -benchmem -run ^BenchmarkFullAppSimulation -bench ^BenchmarkFullAppSimulation -cpuprofile cpu.out $(PACKAGES_SIM) # test-e2e runs a full e2e test suite # deletes any pre-existing Osmosis containers before running. @@ -287,48 +287,48 @@ test-e2e: e2e-setup test-e2e-ci # does not do any validation about the state of the Docker environment # As a result, avoid using this locally. test-e2e-ci: - @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) + @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) # test-e2e-debug runs a full e2e test suite but does # not attempt to delete Docker resources at the end. test-e2e-debug: e2e-setup - @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 + @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 # test-e2e-short runs the e2e test with only short tests. # Does not delete any of the containers after running. # Deletes any existing containers before running. # Does not use Go cache. test-e2e-short: e2e-setup - @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_SKIP_UPGRADE=True OSMOSIS_E2E_SKIP_IBC=True OSMOSIS_E2E_SKIP_STATE_SYNC=True OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 + @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_SKIP_UPGRADE=True OSMOSIS_E2E_SKIP_IBC=True OSMOSIS_E2E_SKIP_STATE_SYNC=True OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 test-mutation: - @bash scripts/mutation-test.sh $(MODULES) + @bash scripts/mutation-test.sh $(MODULES) benchmark: - @go test -mod=readonly -bench=. $(PACKAGES_UNIT) + @go test -mod=readonly -bench=. $(PACKAGES_UNIT) build-e2e-script: - mkdir -p $(BUILDDIR) - go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./tests/e2e/initialization/$(E2E_SCRIPT_NAME) + mkdir -p $(BUILDDIR) + go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./tests/e2e/initialization/$(E2E_SCRIPT_NAME) docker-build-debug: - @DOCKER_BUILDKIT=1 docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . - @DOCKER_BUILDKIT=1 docker tag osmosis:${COMMIT} osmosis:debug + NFTvuln1155 docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker tag osmosis:${COMMIT} osmosis:debug docker-build-e2e-init-chain: - @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . docker-build-e2e-init-node: - @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . e2e-setup: e2e-check-image-sha e2e-remove-resources - @echo Finished e2e environment setup, ready to start the test + @echo Finished e2e environment setup, ready to start the test e2e-check-image-sha: - tests/e2e/scripts/run/check_image_sha.sh + tests/e2e/scripts/run/check_image_sha.sh e2e-remove-resources: - tests/e2e/scripts/run/remove_stale_resources.sh + tests/e2e/scripts/run/remove_stale_resources.sh .PHONY: test-mutation @@ -337,53 +337,53 @@ e2e-remove-resources: ############################################################################### lint: - @echo "--> Running linter" - @go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" + @echo "--> Running linter" + @go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" format: - @go run github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --fix - @go run mvdan.cc/gofumpt -l -w x/ app/ ante/ tests/ - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix + @go run github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --fix + @go run mvdan.cc/gofumpt -l -w x/ app/ ante/ tests/ + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix mdlint: - @echo "--> Running markdown linter" - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" + @echo "--> Running markdown linter" + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" markdown: - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix ############################################################################### ### Localnet ### ############################################################################### localnet-keys: - . tests/localosmosis/scripts/add_keys.sh + . tests/localosmosis/scripts/add_keys.sh localnet-build: - @DOCKER_BUILDKIT=1 docker-compose -f tests/localosmosis/docker-compose.yml build + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml build localnet-build-state-export: - @docker build -t local:osmosis-se --build-arg ID=$(ID) -f tests/localosmosis/mainnet_state/Dockerfile-stateExport . + @docker build -t local:osmosis-se --build-arg ID=$(ID) -f tests/localosmosis/mainnet_state/Dockerfile-stateExport . localnet-start: - @docker-compose -f tests/localosmosis/docker-compose.yml up + @docker-compose -f tests/localosmosis/docker-compose.yml up localnet-startd: - @docker-compose -f tests/localosmosis/docker-compose.yml up -d + @docker-compose -f tests/localosmosis/docker-compose.yml up -d localnet-start-state-export: - @docker-compose -f tests/localosmosis/mainnet_state/docker-compose-state-export.yml up + @docker-compose -f tests/localosmosis/mainnet_state/docker-compose-state-export.yml up localnet-stop: - @docker-compose -f tests/localosmosis/docker-compose.yml down + @docker-compose -f tests/localosmosis/docker-compose.yml down localnet-remove: localnet-stop - rm -rf $(PWD)/tests/localosmosis/.osmosisd + rm -rf $(PWD)/tests/localosmosis/.osmosisd localnet-remove-state-export: - @docker-compose -f tests/localosmosis/mainnet_state/docker-compose-state-export.yml down + @docker-compose -f tests/localosmosis/mainnet_state/docker-compose-state-export.yml down .PHONY: all build-linux install format lint \ - go-mod-cache draw-deps clean build build-contract-tests-hooks \ - test test-all test-build test-cover test-unit test-race benchmark + go-mod-cache draw-deps clean build build-contract-tests-hooks \ + test test-all test-build test-cover test-unit test-race benchmark From ac5a8112f071a0b79928ea6b8638fa0404e6b63f Mon Sep 17 00:00:00 2001 From: punishell <33149001+punishell@users.noreply.github.com> Date: Tue, 27 Sep 2022 14:26:30 +0200 Subject: [PATCH 2/6] Update Makefile changed only from @DOCKER_BUILDKIT=1 to @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 --- Makefile | 258 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 132 insertions(+), 126 deletions(-) diff --git a/Makefile b/Makefile index feba1b4a418..e813f44f729 100644 --- a/Makefile +++ b/Makefile @@ -52,10 +52,10 @@ build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) # process linker flags ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=osmosis \ - -X github.com/cosmos/cosmos-sdk/version.AppName=osmosisd \ - -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ - -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ - -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" + -X github.com/cosmos/cosmos-sdk/version.AppName=osmosisd \ + -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ + -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ + -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" ifeq (cleveldb,$(findstring cleveldb,$(OSMOSIS_BUILD_OPTIONS))) ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb @@ -66,7 +66,7 @@ ifeq (,$(findstring nostrip,$(OSMOSIS_BUILD_OPTIONS))) ldflags += -w -s endif ifeq ($(LINK_STATICALLY),true) - ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static" + ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static" endif ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) @@ -88,10 +88,10 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ $(BUILD_TARGETS): go.sum $(BUILDDIR)/ - go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./... + go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./... $(BUILDDIR)/: - mkdir -p $(BUILDDIR)/ + mkdir -p $(BUILDDIR)/ # Cross-building for arm64 from amd64 (or viceversa) takes # a lot of time due to QEMU virtualization but it's the only way (afaik) @@ -100,58 +100,58 @@ $(BUILDDIR)/: build-reproducible: build-reproducible-amd64 build-reproducible-arm64 build-reproducible-amd64: go.sum $(BUILDDIR)/ - $(DOCKER) buildx create --name osmobuilder || true - $(DOCKER) buildx use osmobuilder - $(DOCKER) buildx build \ - --build-arg GO_VERSION=$(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) \ - --platform linux/arm64 \ - -t osmosis-amd64 \ - --load \ - -f Dockerfile . - $(DOCKER) rm -f osmobinary || true - $(DOCKER) create -ti --name osmobinary osmosis-amd64 - $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-amd64 - $(DOCKER) rm -f osmobinary + $(DOCKER) buildx create --name osmobuilder || true + $(DOCKER) buildx use osmobuilder + $(DOCKER) buildx build \ + --build-arg GO_VERSION=$(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) \ + --platform linux/arm64 \ + -t osmosis-amd64 \ + --load \ + -f Dockerfile . + $(DOCKER) rm -f osmobinary || true + $(DOCKER) create -ti --name osmobinary osmosis-amd64 + $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-amd64 + $(DOCKER) rm -f osmobinary build-reproducible-arm64: go.sum $(BUILDDIR)/ - $(DOCKER) buildx create --name osmobuilder || true - $(DOCKER) buildx use osmobuilder - $(DOCKER) buildx build \ - --build-arg GO_VERSION=$(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) \ - --platform linux/arm64 \ - -t osmosis-arm64 \ - --load \ - -f Dockerfile . - $(DOCKER) rm -f osmobinary || true - $(DOCKER) create -ti --name osmobinary osmosis-arm64 - $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-arm64 - $(DOCKER) rm -f osmobinary + $(DOCKER) buildx create --name osmobuilder || true + $(DOCKER) buildx use osmobuilder + $(DOCKER) buildx build \ + --build-arg GO_VERSION=$(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) \ + --platform linux/arm64 \ + -t osmosis-arm64 \ + --load \ + -f Dockerfile . + $(DOCKER) rm -f osmobinary || true + $(DOCKER) create -ti --name osmobinary osmosis-arm64 + $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-arm64 + $(DOCKER) rm -f osmobinary build-linux: go.sum - LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build + LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build build-contract-tests-hooks: - mkdir -p $(BUILDDIR) - go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./cmd/contract_tests + mkdir -p $(BUILDDIR) + go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./cmd/contract_tests go-mod-cache: go.sum - @echo "--> Download go modules to local cache" - @go mod download + @echo "--> Download go modules to local cache" + @go mod download go.sum: go.mod - @echo "--> Ensure dependencies have not been modified" - @go mod verify + @echo "--> Ensure dependencies have not been modified" + @go mod verify draw-deps: - @# requires brew install graphviz or apt-get install graphviz - go get github.com/RobotsAndPencils/goviz - @goviz -i ./cmd/osmosisd -d 2 | dot -Tpng -o dependency-graph.png + @# requires brew install graphviz or apt-get install graphviz + go get github.com/RobotsAndPencils/goviz + @goviz -i ./cmd/osmosisd -d 2 | dot -Tpng -o dependency-graph.png clean: - rm -rf $(CURDIR)/artifacts/ + rm -rf $(CURDIR)/artifacts/ distclean: clean - rm -rf vendor/ + rm -rf vendor/ ############################################################################### ### Proto ### @@ -160,33 +160,33 @@ distclean: clean proto-all: proto-format proto-gen proto: - @echo - @echo "=========== Generate Message ============" - @echo - ./scripts/protocgen.sh - @echo - @echo "=========== Generate Complete ============" - @echo + @echo + @echo "=========== Generate Message ============" + @echo + ./scripts/protocgen.sh + @echo + @echo "=========== Generate Complete ============" + @echo test: - @go test -v ./x/... + @go test -v ./x/... docs: - @echo - @echo "=========== Generate Message ============" - @echo - ./scripts/generate-docs.sh + @echo + @echo "=========== Generate Message ============" + @echo + ./scripts/generate-docs.sh - statik -src=client/docs/static -dest=client/docs -f -m - @if [ -n "$(git status --porcelain)" ]; then \ + statik -src=client/docs/static -dest=client/docs -f -m + @if [ -n "$(git status --porcelain)" ]; then \ echo "\033[91mSwagger docs are out of sync!!!\033[0m";\ exit 1;\ else \ echo "\033[92mSwagger docs are in sync\033[0m";\ fi - @echo - @echo "=========== Generate Complete ============" - @echo + @echo + @echo "=========== Generate Complete ============" + @echo .PHONY: docs protoVer=v0.8 @@ -195,47 +195,47 @@ containerProtoGen=cosmos-sdk-proto-gen-$(protoVer) containerProtoFmt=cosmos-sdk-proto-fmt-$(protoVer) proto-gen: - @echo "Generating Protobuf files" - @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \ - sh ./scripts/protocgen.sh; fi + @echo "Generating Protobuf files" + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \ + sh ./scripts/protocgen.sh; fi proto-format: - @echo "Formatting Protobuf files" - @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \ - find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi + @echo "Formatting Protobuf files" + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \ + find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi proto-image-build: - NFTvuln1155 docker build -t $(protoImageName) -f ./proto/Dockerfile ./proto + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker build -t $(protoImageName) -f ./proto/Dockerfile ./proto proto-image-push: - docker push $(protoImageName) + docker push $(protoImageName) ############################################################################### ### Querygen ### ############################################################################### run-querygen: - @go run cmd/querygen/main.go + @go run cmd/querygen/main.go ############################################################################### ### Devdoc ### ############################################################################### build-docs: - @cd docs && \ - while read p; do \ - (git checkout $${p} && npm install && VUEPRESS_BASE="/$${p}/" npm run build) ; \ - mkdir -p ~/output/$${p} ; \ - cp -r .vuepress/dist/* ~/output/$${p}/ ; \ - cp ~/output/$${p}/index.html ~/output ; \ - done < versions ; + @cd docs && \ + while read p; do \ + (git checkout $${p} && npm install && VUEPRESS_BASE="/$${p}/" npm run build) ; \ + mkdir -p ~/output/$${p} ; \ + cp -r .vuepress/dist/* ~/output/$${p}/ ; \ + cp ~/output/$${p}/index.html ~/output ; \ + done < versions ; sync-docs: - cd ~/output && \ - echo "role_arn = ${DEPLOYMENT_ROLE_ARN}" >> /root/.aws/config ; \ - echo "CI job = ${CIRCLE_BUILD_URL}" >> version.html ; \ - aws s3 sync . s3://${WEBSITE_BUCKET} --profile terraform --delete ; \ - aws cloudfront create-invalidation --distribution-id ${CF_DISTRIBUTION_ID} --profile terraform --path "/*" ; + cd ~/output && \ + echo "role_arn = ${DEPLOYMENT_ROLE_ARN}" >> /root/.aws/config ; \ + echo "CI job = ${CIRCLE_BUILD_URL}" >> version.html ; \ + aws s3 sync . s3://${WEBSITE_BUCKET} --profile terraform --delete ; \ + aws cloudfront create-invalidation --distribution-id ${CF_DISTRIBUTION_ID} --profile terraform --path "/*" ; .PHONY: sync-docs @@ -253,25 +253,25 @@ test: test-unit test-build test-all: check test-race test-cover test-unit: - @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock norace' $(PACKAGES_UNIT) + @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock norace' $(PACKAGES_UNIT) test-race: - @VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' $(PACKAGES_UNIT) + @VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' $(PACKAGES_UNIT) test-cover: - @VERSION=$(VERSION) go test -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic $(PACKAGES_UNIT) + @VERSION=$(VERSION) go test -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic $(PACKAGES_UNIT) test-sim-suite: - @VERSION=$(VERSION) go test -mod=readonly $(PACKAGES_SIM) + @VERSION=$(VERSION) go test -mod=readonly $(PACKAGES_SIM) test-sim-app: - @VERSION=$(VERSION) go test -mod=readonly -run ^TestFullAppSimulation -v $(PACKAGES_SIM) + @VERSION=$(VERSION) go test -mod=readonly -run ^TestFullAppSimulation -v $(PACKAGES_SIM) test-sim-determinism: - @VERSION=$(VERSION) go test -mod=readonly -run ^TestAppStateDeterminism -v $(PACKAGES_SIM) + @VERSION=$(VERSION) go test -mod=readonly -run ^TestAppStateDeterminism -v $(PACKAGES_SIM) test-sim-bench: - @VERSION=$(VERSION) go test -benchmem -run ^BenchmarkFullAppSimulation -bench ^BenchmarkFullAppSimulation -cpuprofile cpu.out $(PACKAGES_SIM) + @VERSION=$(VERSION) go test -benchmem -run ^BenchmarkFullAppSimulation -bench ^BenchmarkFullAppSimulation -cpuprofile cpu.out $(PACKAGES_SIM) # test-e2e runs a full e2e test suite # deletes any pre-existing Osmosis containers before running. @@ -287,48 +287,48 @@ test-e2e: e2e-setup test-e2e-ci # does not do any validation about the state of the Docker environment # As a result, avoid using this locally. test-e2e-ci: - @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) + @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) # test-e2e-debug runs a full e2e test suite but does # not attempt to delete Docker resources at the end. test-e2e-debug: e2e-setup - @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 + @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 # test-e2e-short runs the e2e test with only short tests. # Does not delete any of the containers after running. # Deletes any existing containers before running. # Does not use Go cache. test-e2e-short: e2e-setup - @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_SKIP_UPGRADE=True OSMOSIS_E2E_SKIP_IBC=True OSMOSIS_E2E_SKIP_STATE_SYNC=True OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 + @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_SKIP_UPGRADE=True OSMOSIS_E2E_SKIP_IBC=True OSMOSIS_E2E_SKIP_STATE_SYNC=True OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 test-mutation: - @bash scripts/mutation-test.sh $(MODULES) + @bash scripts/mutation-test.sh $(MODULES) benchmark: - @go test -mod=readonly -bench=. $(PACKAGES_UNIT) + @go test -mod=readonly -bench=. $(PACKAGES_UNIT) build-e2e-script: - mkdir -p $(BUILDDIR) - go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./tests/e2e/initialization/$(E2E_SCRIPT_NAME) + mkdir -p $(BUILDDIR) + go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./tests/e2e/initialization/$(E2E_SCRIPT_NAME) docker-build-debug: - NFTvuln1155 docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker tag osmosis:${COMMIT} osmosis:debug + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker tag osmosis:${COMMIT} osmosis:debug docker-build-e2e-init-chain: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . docker-build-e2e-init-node: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . e2e-setup: e2e-check-image-sha e2e-remove-resources - @echo Finished e2e environment setup, ready to start the test + @echo Finished e2e environment setup, ready to start the test e2e-check-image-sha: - tests/e2e/scripts/run/check_image_sha.sh + tests/e2e/scripts/run/check_image_sha.sh e2e-remove-resources: - tests/e2e/scripts/run/remove_stale_resources.sh + tests/e2e/scripts/run/remove_stale_resources.sh .PHONY: test-mutation @@ -337,53 +337,59 @@ e2e-remove-resources: ############################################################################### lint: - @echo "--> Running linter" - @go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" + @echo "--> Running linter" + @go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" format: - @go run github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --fix - @go run mvdan.cc/gofumpt -l -w x/ app/ ante/ tests/ - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix + @go run github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --fix + @go run mvdan.cc/gofumpt -l -w x/ app/ ante/ tests/ + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix mdlint: - @echo "--> Running markdown linter" - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" + @echo "--> Running markdown linter" + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" markdown: - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix ############################################################################### ### Localnet ### ############################################################################### localnet-keys: - . tests/localosmosis/scripts/add_keys.sh + . tests/localosmosis/scripts/add_keys.sh localnet-build: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml build - -localnet-build-state-export: - @docker build -t local:osmosis-se --build-arg ID=$(ID) -f tests/localosmosis/mainnet_state/Dockerfile-stateExport . + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker-compose -f tests/localosmosis/docker-compose.yml build localnet-start: - @docker-compose -f tests/localosmosis/docker-compose.yml up + @docker-compose -f tests/localosmosis/docker-compose.yml up localnet-startd: - @docker-compose -f tests/localosmosis/docker-compose.yml up -d - -localnet-start-state-export: - @docker-compose -f tests/localosmosis/mainnet_state/docker-compose-state-export.yml up + @docker-compose -f tests/localosmosis/docker-compose.yml up -d localnet-stop: - @docker-compose -f tests/localosmosis/docker-compose.yml down + @docker-compose -f tests/localosmosis/docker-compose.yml down localnet-remove: localnet-stop - rm -rf $(PWD)/tests/localosmosis/.osmosisd + rm -rf $(PWD)/tests/localosmosis/.osmosisd + +localnet-build-state-export: + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker-compose -f tests/localosmosis/state_export/docker-compose.yml build + +localnet-start-state-export: + @docker-compose -f tests/localosmosis/state_export/docker-compose.yml up + +localnet-startd-state-export: + @docker-compose -f tests/localosmosis/state_export/docker-compose.yml up -d + +localnet-stop-state-export: + @docker-compose -f tests/localosmosis/docker-compose.yml down localnet-remove-state-export: - @docker-compose -f tests/localosmosis/mainnet_state/docker-compose-state-export.yml down + rm -rf $(PWD)/tests/localosmosis/state_export/.osmosisd .PHONY: all build-linux install format lint \ - go-mod-cache draw-deps clean build build-contract-tests-hooks \ - test test-all test-build test-cover test-unit test-race benchmark + go-mod-cache draw-deps clean build build-contract-tests-hooks \ + test test-all test-build test-cover test-unit test-race benchmark From 42d7a89d806bd11b109cea8520756371e75c062e Mon Sep 17 00:00:00 2001 From: punishell <33149001+punishell@users.noreply.github.com> Date: Tue, 27 Sep 2022 14:37:19 +0200 Subject: [PATCH 3/6] Update Makefile fix spaces --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e813f44f729..d978984eeef 100644 --- a/Makefile +++ b/Makefile @@ -205,7 +205,7 @@ proto-format: find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi proto-image-build: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker build -t $(protoImageName) -f ./proto/Dockerfile ./proto + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t $(protoImageName) -f ./proto/Dockerfile ./proto proto-image-push: docker push $(protoImageName) @@ -312,14 +312,14 @@ build-e2e-script: go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./tests/e2e/initialization/$(E2E_SCRIPT_NAME) docker-build-debug: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker tag osmosis:${COMMIT} osmosis:debug + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker tag osmosis:${COMMIT} osmosis:debug docker-build-e2e-init-chain: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . docker-build-e2e-init-node: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . e2e-setup: e2e-check-image-sha e2e-remove-resources @echo Finished e2e environment setup, ready to start the test @@ -361,7 +361,7 @@ localnet-keys: . tests/localosmosis/scripts/add_keys.sh localnet-build: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker-compose -f tests/localosmosis/docker-compose.yml build + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml build localnet-start: @docker-compose -f tests/localosmosis/docker-compose.yml up @@ -376,7 +376,7 @@ localnet-remove: localnet-stop rm -rf $(PWD)/tests/localosmosis/.osmosisd localnet-build-state-export: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1docker-compose -f tests/localosmosis/state_export/docker-compose.yml build + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/state_export/docker-compose.yml build localnet-start-state-export: @docker-compose -f tests/localosmosis/state_export/docker-compose.yml up From c0935ff6b533f5482a13364464633ec00eb33bb0 Mon Sep 17 00:00:00 2001 From: punishell <33149001+punishell@users.noreply.github.com> Date: Tue, 27 Sep 2022 18:58:02 +0200 Subject: [PATCH 4/6] Update Makefile sorry for wasting your time :D --- Makefile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index d978984eeef..7b0aff0b946 100644 --- a/Makefile +++ b/Makefile @@ -205,7 +205,7 @@ proto-format: find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi proto-image-build: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t $(protoImageName) -f ./proto/Dockerfile ./proto + @DOCKER_BUILDKIT=1 docker build -t $(protoImageName) -f ./proto/Dockerfile ./proto proto-image-push: docker push $(protoImageName) @@ -312,14 +312,14 @@ build-e2e-script: go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./tests/e2e/initialization/$(E2E_SCRIPT_NAME) docker-build-debug: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker tag osmosis:${COMMIT} osmosis:debug + @DOCKER_BUILDKIT=1 docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . + @DOCKER_BUILDKIT=1 docker tag osmosis:${COMMIT} osmosis:debug docker-build-e2e-init-chain: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . + @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . docker-build-e2e-init-node: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . + @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . e2e-setup: e2e-check-image-sha e2e-remove-resources @echo Finished e2e environment setup, ready to start the test @@ -364,13 +364,13 @@ localnet-build: @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml build localnet-start: - @docker-compose -f tests/localosmosis/docker-compose.yml up + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml up localnet-startd: - @docker-compose -f tests/localosmosis/docker-compose.yml up -d + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml up -d localnet-stop: - @docker-compose -f tests/localosmosis/docker-compose.yml down + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml down localnet-remove: localnet-stop rm -rf $(PWD)/tests/localosmosis/.osmosisd @@ -379,13 +379,13 @@ localnet-build-state-export: @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/state_export/docker-compose.yml build localnet-start-state-export: - @docker-compose -f tests/localosmosis/state_export/docker-compose.yml up + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/state_export/docker-compose.yml up localnet-startd-state-export: - @docker-compose -f tests/localosmosis/state_export/docker-compose.yml up -d + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/state_export/docker-compose.yml up -d localnet-stop-state-export: - @docker-compose -f tests/localosmosis/docker-compose.yml down + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml down localnet-remove-state-export: rm -rf $(PWD)/tests/localosmosis/state_export/.osmosisd From 926991dffdc53fdf4a3bc4e772a22c80f0aa4767 Mon Sep 17 00:00:00 2001 From: punishell <33149001+punishell@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:26:10 +0200 Subject: [PATCH 5/6] Update Makefile --- Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 7b0aff0b946..92a74034d30 100644 --- a/Makefile +++ b/Makefile @@ -312,14 +312,14 @@ build-e2e-script: go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./tests/e2e/initialization/$(E2E_SCRIPT_NAME) docker-build-debug: - @DOCKER_BUILDKIT=1 docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . - @DOCKER_BUILDKIT=1 docker tag osmosis:${COMMIT} osmosis:debug + @DOCKER_BUILDKIT=1 docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . + @DOCKER_BUILDKIT=1 docker tag osmosis:${COMMIT} osmosis:debug docker-build-e2e-init-chain: - @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . + @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . docker-build-e2e-init-node: - @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . + @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . e2e-setup: e2e-check-image-sha e2e-remove-resources @echo Finished e2e environment setup, ready to start the test @@ -367,10 +367,10 @@ localnet-start: @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml up localnet-startd: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml up -d + @DOCKER_BUILDKIT=1 docker-compose -f tests/localosmosis/docker-compose.yml up -d localnet-stop: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml down + @docker-compose -f tests/localosmosis/docker-compose.yml down localnet-remove: localnet-stop rm -rf $(PWD)/tests/localosmosis/.osmosisd @@ -379,13 +379,13 @@ localnet-build-state-export: @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/state_export/docker-compose.yml build localnet-start-state-export: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/state_export/docker-compose.yml up + @docker-compose -f tests/localosmosis/state_export/docker-compose.yml up localnet-startd-state-export: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/state_export/docker-compose.yml up -d + @docker-compose -f tests/localosmosis/state_export/docker-compose.yml up -d localnet-stop-state-export: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml down + @docker-compose -f tests/localosmosis/docker-compose.yml down localnet-remove-state-export: rm -rf $(PWD)/tests/localosmosis/state_export/.osmosisd From 78063aa95ec8b4ceebdb7ecac5b9c92ada903603 Mon Sep 17 00:00:00 2001 From: punishell <33149001+punishell@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:27:24 +0200 Subject: [PATCH 6/6] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 92a74034d30..32d648dce34 100644 --- a/Makefile +++ b/Makefile @@ -364,7 +364,7 @@ localnet-build: @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml build localnet-start: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml up + @docker-compose -f tests/localosmosis/docker-compose.yml up localnet-startd: @DOCKER_BUILDKIT=1 docker-compose -f tests/localosmosis/docker-compose.yml up -d