From e4feac2fd6e901913be2151f603d3a2a75d8688c Mon Sep 17 00:00:00 2001 From: ArpitShukla007 Date: Mon, 7 Feb 2022 15:32:33 +0000 Subject: [PATCH 1/7] Added initial support for Tendermint v0.34.15 --- Dockerfile-all-in-one | 2 +- docker-compose.yml | 2 +- .../run-node-as-processes.md | 6 +++--- .../network-setup/k8s-deployment-template/workflow.rst | 2 +- k8s/planetmint/tendermint_container/Dockerfile | 2 +- pkg/scripts/stack.sh | 2 +- planetmint/__init__.py | 2 +- planetmint/version.py | 2 +- tests/test_config_utils.py | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Dockerfile-all-in-one b/Dockerfile-all-in-one index 736934c..d8ff513 100644 --- a/Dockerfile-all-in-one +++ b/Dockerfile-all-in-one @@ -1,7 +1,7 @@ FROM alpine:3.9 LABEL maintainer "contact@ipdb.global" -ARG TM_VERSION=v0.34.11 +ARG TM_VERSION=v0.34.15 RUN mkdir -p /usr/src/app ENV HOME /root COPY . /usr/src/app/ diff --git a/docker-compose.yml b/docker-compose.yml index 01f537d..2e99e17 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,7 +51,7 @@ services: command: '.ci/entrypoint.sh' restart: always tendermint: - image: tendermint/tendermint:v0.34.11 + image: tendermint/tendermint:v0.34.15 # volumes: # - ./tmdata:/tendermint entrypoint: '' diff --git a/docs/root/source/contributing/dev-setup-coding-and-contribution-process/run-node-as-processes.md b/docs/root/source/contributing/dev-setup-coding-and-contribution-process/run-node-as-processes.md index e5b04c5..58074ac 100644 --- a/docs/root/source/contributing/dev-setup-coding-and-contribution-process/run-node-as-processes.md +++ b/docs/root/source/contributing/dev-setup-coding-and-contribution-process/run-node-as-processes.md @@ -30,9 +30,9 @@ The version of Planetmint Server described in these docs only works well with Te ```bash $ sudo apt install -y unzip -$ wget https://github.com/tendermint/tendermint/releases/download/v0.34.11/tendermint_v0.34.11_linux_amd64.zip -$ unzip tendermint_v0.34.11_linux_amd64.zip -$ rm tendermint_v0.34.11_linux_amd64.zip +$ wget https://github.com/tendermint/tendermint/releases/download/v0.34.15/tendermint_v0.34.15_linux_amd64.zip +$ unzip tendermint_v0.34.15_linux_amd64.zip +$ rm tendermint_v0.34.15_linux_amd64.zip $ sudo mv tendermint /usr/local/bin ``` diff --git a/docs/root/source/installation/network-setup/k8s-deployment-template/workflow.rst b/docs/root/source/installation/network-setup/k8s-deployment-template/workflow.rst index 43e964f..1d0148f 100644 --- a/docs/root/source/installation/network-setup/k8s-deployment-template/workflow.rst +++ b/docs/root/source/installation/network-setup/k8s-deployment-template/workflow.rst @@ -60,7 +60,7 @@ you can do this: .. code:: $ mkdir $(pwd)/tmdata - $ docker run --rm -v $(pwd)/tmdata:/tendermint/config tendermint/tendermint:v0.34.11 init + $ docker run --rm -v $(pwd)/tmdata:/tendermint/config tendermint/tendermint:v0.34.15 init $ cat $(pwd)/tmdata/genesis.json You should see something that looks like: diff --git a/k8s/planetmint/tendermint_container/Dockerfile b/k8s/planetmint/tendermint_container/Dockerfile index 5795f81..91230fc 100644 --- a/k8s/planetmint/tendermint_container/Dockerfile +++ b/k8s/planetmint/tendermint_container/Dockerfile @@ -1,4 +1,4 @@ -FROM tendermint/tendermint:v0.34.11 +FROM tendermint/tendermint:v0.34.15 LABEL maintainer "contact@ipdb.global" WORKDIR / USER root diff --git a/pkg/scripts/stack.sh b/pkg/scripts/stack.sh index c84fa4d..ea774a0 100755 --- a/pkg/scripts/stack.sh +++ b/pkg/scripts/stack.sh @@ -17,7 +17,7 @@ stack_size=${STACK_SIZE:=4} stack_type=${STACK_TYPE:="docker"} stack_type_provider=${STACK_TYPE_PROVIDER:=""} # NOTE versions prior v0.28.0 have different priv_validator format! -tm_version=${TM_VERSION:="v0.34.11"} +tm_version=${TM_VERSION:="v0.34.15"} mongo_version=${MONGO_VERSION:="3.6"} stack_vm_memory=${STACK_VM_MEMORY:=2048} stack_vm_cpus=${STACK_VM_CPUS:=2} diff --git a/planetmint/__init__.py b/planetmint/__init__.py index 47c2643..7c3b977 100644 --- a/planetmint/__init__.py +++ b/planetmint/__init__.py @@ -71,7 +71,7 @@ config = { 'tendermint': { 'host': 'localhost', 'port': 26657, - 'version': 'v0.34.11', # look for __tm_supported_versions__ + 'version': 'v0.34.15', # look for __tm_supported_versions__ }, # FIXME: hardcoding to localmongodb for now 'database': _database_map['localmongodb'], diff --git a/planetmint/version.py b/planetmint/version.py index e77393e..1daef8f 100644 --- a/planetmint/version.py +++ b/planetmint/version.py @@ -7,4 +7,4 @@ __version__ = '0.9.0' __short_version__ = '0.9' # Supported Tendermint versions -__tm_supported_versions__ = ["0.34.11"] +__tm_supported_versions__ = ["0.34.15"] diff --git a/tests/test_config_utils.py b/tests/test_config_utils.py index a938a5f..4bcff77 100644 --- a/tests/test_config_utils.py +++ b/tests/test_config_utils.py @@ -221,7 +221,7 @@ def test_autoconfigure_read_both_from_file_and_env(monkeypatch, request): 'tendermint': { 'host': 'localhost', 'port': 26657, - 'version': 'v0.34.11' + 'version': 'v0.34.15' }, 'log': { 'file': LOG_FILE, From 8b07d05c60a00adf02f22a251006d193ec40117e Mon Sep 17 00:00:00 2001 From: Lorenz Herzberger Date: Mon, 14 Feb 2022 09:37:21 +0100 Subject: [PATCH 2/7] added linting with flake8 --- Makefile | 3 +++ docker-compose.yml | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 6e5327f..b0b87b6 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,9 @@ stop: check-deps ## Stop Planetmint logs: check-deps ## Attach to the logs @$(DC) logs -f planetmint +lint: check-deps ## Lint the Project + @$(DC) up lint + test: check-deps test-unit test-acceptance ## Run unit and acceptance tests test-unit: check-deps ## Run all tests once diff --git a/docker-compose.yml b/docker-compose.yml index 331b4f1..d5936c6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -114,3 +114,13 @@ services: - '33333:80' volumes: - ./docs/root/build/html:/usr/share/nginx/html + + # Lints project according to PEP8 + lint: + image: alpine/flake8 + command: --max-line-length 119 /planetmint /acceptance /integration /tests + volumes: + - ./planetmint:/planetmint + - ./acceptance:/acceptance + - ./integration:/integration + - ./tests:/tests \ No newline at end of file From 5924633bc939f3eb0d943feb6547124db121c22d Mon Sep 17 00:00:00 2001 From: Lorenz Herzberger Date: Mon, 14 Feb 2022 09:44:24 +0100 Subject: [PATCH 3/7] make clean now utilizes docker --- Makefile | 22 ++-------------------- docker-compose.yml | 8 +++++++- scripts/clean.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 21 deletions(-) create mode 100755 scripts/clean.sh diff --git a/Makefile b/Makefile index b0b87b6..71afc60 100644 --- a/Makefile +++ b/Makefile @@ -102,7 +102,8 @@ doc-acceptance: check-deps ## Create documentation for acceptance tests @$(DC) run --rm python-acceptance pycco -i -s /src -d /docs $(BROWSER) acceptance/python/docs/index.html -clean: clean-build clean-pyc clean-test ## Remove all build, test, coverage and Python artifacts +clean: check-deps ## Remove all build, test, coverage and Python artifacts + @$(DC) up clean @$(ECHO) "Cleaning was successful." reset: check-deps ## Stop and REMOVE all containers. WARNING: you will LOSE all data stored in Planetmint. @@ -129,22 +130,3 @@ ifndef IS_DOCKER_COMPOSE_INSTALLED @$(ECHO) @$(DC) # docker-compose is not installed, so we call it to generate an error and exit endif - -clean-build: # Remove build artifacts - @rm -fr build/ - @rm -fr dist/ - @rm -fr .eggs/ - @find . -name '*.egg-info' -exec rm -fr {} + - @find . -name '*.egg' -exec rm -f {} + - -clean-pyc: # Remove Python file artifacts - @find . -name '*.pyc' -exec rm -f {} + - @find . -name '*.pyo' -exec rm -f {} + - @find . -name '*~' -exec rm -f {} + - @find . -name '__pycache__' -exec rm -fr {} + - -clean-test: # Remove test and coverage artifacts - @find . -name '.pytest_cache' -exec rm -fr {} + - @rm -fr .tox/ - @rm -f .coverage - @rm -fr htmlcov/ diff --git a/docker-compose.yml b/docker-compose.yml index d5936c6..b62487b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -123,4 +123,10 @@ services: - ./planetmint:/planetmint - ./acceptance:/acceptance - ./integration:/integration - - ./tests:/tests \ No newline at end of file + - ./tests:/tests + + clean: + image: alpine + command: /bin/sh -c "./planetmint/scripts/clean.sh" + volumes: + - $PWD:/planetmint \ No newline at end of file diff --git a/scripts/clean.sh b/scripts/clean.sh new file mode 100755 index 0000000..a047442 --- /dev/null +++ b/scripts/clean.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# Copyright © 2020 Interplanetary Database Association e.V., +# Planetmint and IPDB software contributors. +# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) +# Code is Apache-2.0 and docs are CC-BY-4.0 + +cd planetmint + +# Remove build artifacts +rm -fr build/ +rm -fr dist/ +rm -fr .eggs/ +find . -name '*.egg-info' -exec rm -fr {} + +find . -name '*.egg' -type f -exec rm -f {} + + +# Remove Python file artifacts +find . -name '*.pyc' -exec rm -f {} + +find . -name '*.pyo' -exec rm -f {} + +find . -name '*~' -exec rm -f {} + +find . -name '__pycache__' -exec rm -fr {} + + +# Remove test and coverage artifacts +find . -name '.pytest_cache' -exec rm -fr {} + +rm -fr .tox/ +rm -f .coverage +rm -fr htmlcov/ \ No newline at end of file From f0533cf60fc4bd69072bf073dc7d3e30bf4e0300 Mon Sep 17 00:00:00 2001 From: Lorenz Herzberger Date: Mon, 14 Feb 2022 11:52:36 +0100 Subject: [PATCH 4/7] added lint phony and comment on clean step --- Makefile | 2 +- docker-compose.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 71afc60..c1d61bb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help run start stop logs test test-unit test-unit-watch test-acceptance test-integration cov doc doc-acceptance clean reset release dist check-deps clean-build clean-pyc clean-test +.PHONY: help run start stop logs lint test test-unit test-unit-watch test-acceptance test-integration cov doc doc-acceptance clean reset release dist check-deps clean-build clean-pyc clean-test .DEFAULT_GOAL := help diff --git a/docker-compose.yml b/docker-compose.yml index b62487b..1617539 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -125,6 +125,7 @@ services: - ./integration:/integration - ./tests:/tests + # Remove all build, test, coverage and Python artifacts clean: image: alpine command: /bin/sh -c "./planetmint/scripts/clean.sh" From 97c59bcdbf60a78274a1a08c006a365b14ea65f8 Mon Sep 17 00:00:00 2001 From: Lorenz Herzberger Date: Mon, 14 Feb 2022 12:16:53 +0100 Subject: [PATCH 5/7] changed doc to docs according to PRP4 --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c1d61bb..4b6ffab 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help run start stop logs lint test test-unit test-unit-watch test-acceptance test-integration cov doc doc-acceptance clean reset release dist check-deps clean-build clean-pyc clean-test +.PHONY: help run start stop logs lint test test-unit test-unit-watch test-acceptance test-integration cov docs docs-acceptance clean reset release dist check-deps clean-build clean-pyc clean-test .DEFAULT_GOAL := help @@ -92,13 +92,13 @@ cov: check-deps ## Check code coverage and open the result in the browser @$(DC) run --rm planetmint pytest -v --cov=planetmint --cov-report html $(BROWSER) htmlcov/index.html -doc: check-deps ## Generate HTML documentation and open it in the browser +docs: check-deps ## Generate HTML documentation and open it in the browser @$(DC) run --rm --no-deps bdocs make -C docs/root html @$(DC) run --rm --no-deps bdocs make -C docs/server html @$(DC) run --rm --no-deps bdocs make -C docs/contributing html $(BROWSER) docs/root/build/html/index.html -doc-acceptance: check-deps ## Create documentation for acceptance tests +docs-acceptance: check-deps ## Create documentation for acceptance tests @$(DC) run --rm python-acceptance pycco -i -s /src -d /docs $(BROWSER) acceptance/python/docs/index.html From affd543c11656d20c56165c4e31bf4fe41b40a81 Mon Sep 17 00:00:00 2001 From: Lorenz Herzberger Date: Mon, 14 Feb 2022 14:38:33 +0100 Subject: [PATCH 6/7] adjusted readme --- Makefile | 2 +- README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4b6ffab..1f5b1ff 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ stop: check-deps ## Stop Planetmint logs: check-deps ## Attach to the logs @$(DC) logs -f planetmint -lint: check-deps ## Lint the Project +lint: check-deps ## Lint the project @$(DC) up lint test: check-deps test-unit test-acceptance ## Run unit and acceptance tests diff --git a/README.md b/README.md index d0a1949..0ec040f 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,11 @@ There are also other commands you can execute: * `make start`: Run Planetmint from source and daemonize it (stop it with `make stop`). * `make stop`: Stop Planetmint. * `make logs`: Attach to the logs. +* `make lint`: Lint the project * `make test`: Run all unit and acceptance tests. * `make test-unit-watch`: Run all tests and wait. Every time you change code, tests will be run again. * `make cov`: Check code coverage and open the result in the browser. -* `make doc`: Generate HTML documentation and open it in the browser. +* `make docs`: Generate HTML documentation and open it in the browser. * `make clean`: Remove all build, test, coverage and Python artifacts. * `make reset`: Stop and REMOVE all containers. WARNING: you will LOSE all data stored in Planetmint. From 4d038783f9ec1cc8f5a9ad59d16d78e2014bee9d Mon Sep 17 00:00:00 2001 From: Lorenz Herzberger Date: Mon, 14 Feb 2022 15:14:56 +0100 Subject: [PATCH 7/7] removed broken docs steps --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 1f5b1ff..10a359e 100644 --- a/Makefile +++ b/Makefile @@ -94,8 +94,6 @@ cov: check-deps ## Check code coverage and open the result in the browser docs: check-deps ## Generate HTML documentation and open it in the browser @$(DC) run --rm --no-deps bdocs make -C docs/root html - @$(DC) run --rm --no-deps bdocs make -C docs/server html - @$(DC) run --rm --no-deps bdocs make -C docs/contributing html $(BROWSER) docs/root/build/html/index.html docs-acceptance: check-deps ## Create documentation for acceptance tests