From 86180eaba8d424f1f990d682d37b93738b3937d6 Mon Sep 17 00:00:00 2001 From: mujx Date: Thu, 21 Jul 2022 16:03:43 +0300 Subject: [PATCH 01/11] docker: Revamp docker-compose files to use all protocols --- docs/introduction/howtoget.rst | 94 +++++++++++++++++++++-- scripts/docker/alpha.yml | 27 +++++++ scripts/docker/core.yml | 48 ++++++++++++ scripts/docker/docker-compose-generic.yml | 45 ----------- scripts/docker/entrypoint.inc.sh | 8 +- scripts/docker/entrypoint.sh | 1 + scripts/docker/ithaca.yml | 27 +++++++ scripts/docker/jakarta.yml | 27 +++++++ scripts/docker/kathmandu.yml | 27 +++++++ 9 files changed, 247 insertions(+), 57 deletions(-) create mode 100644 scripts/docker/alpha.yml create mode 100644 scripts/docker/core.yml delete mode 100644 scripts/docker/docker-compose-generic.yml create mode 100644 scripts/docker/ithaca.yml create mode 100644 scripts/docker/jakarta.yml create mode 100644 scripts/docker/kathmandu.yml diff --git a/docs/introduction/howtoget.rst b/docs/introduction/howtoget.rst index e612e8db3e43..44f936de1d41 100644 --- a/docs/introduction/howtoget.rst +++ b/docs/introduction/howtoget.rst @@ -149,14 +149,92 @@ automatically generated and published on `DockerHub `_. This provides a convenient way to run an always up-to-date ``tezos-node``. -One way to run those Docker images is with Docker Compose. -An example Docker Compose script is provided in -:src:`scripts/docker/docker-compose-generic.yml`. -It launches a node, a baker, and an accuser for protocol Alpha. -You can adapt it to run the baker and accuser for other protocols -by replacing all instances of ``alpha`` to e.g. ``014-PtKathma`` for Kathmandu. -Replacing the value of the ``PROTOCOL`` environment variable is enough -but you may want to update the ``hostname`` and the container name too. +One way to run those Docker images is with `docker-compose `_. +We provide ``docker-compose`` files for all active +protocols. You can pick one and start with the following command (we'll assume alpha on this guide): + +:: + + cd scripts/docker + docker-compose -f alpha.yml up + +The above command will launch a node, a client, a baker, and an accuser for +the Alpha protocol. + +You can open a new shell session and run ``docker ps`` in it, to display all the available containers, e.g.:: + + 8f3638fae48c docker.io/tezos/tezos:latest tezos-node 3 minutes ago Up 3 minutes ago 0.0.0.0:8732->8732/tcp, 0.0.0.0:9732->9732/tcp node-alpha + 8ba4d6077e2d docker.io/tezos/tezos:latest tezos-baker --liq... 3 minutes ago Up 31 seconds ago baker-alpha + 3ee7fcbc2158 docker.io/tezos/tezos:latest tezos-accuser 3 minutes ago Up 35 seconds ago accuser-alpha + + +The node's RPC interface will be available on localhost and can be queried with ``tezos-client``. + +:: + + docker exec node-alpha tezos-client rpc list + +The docker image used throughout the docker-compose files is fetched from upstream, but you can also +build one locally and reference it. Run the following commands to build the image: + +:: + + # Pick the current opam_repository_tag value found in the scripts/version.sh file. + export BUILD_DEPS_IMAGE_VERSION=fe613ae6e399204434c4be3e8d8d82662832d352 + export COMMIT_SHORT_SHA=$(git rev-parse --short HEAD) + export COMMIT_DATETIME=$(git show -s --pretty=format:%ci HEAD) + export COMMIT_TAG=$(git describe --tags --always) + + docker build \ + -t tezos_build:latest \ + -f build.Dockerfile \ + --build-arg BASE_IMAGE=registry.gitlab.com/tezos/opam-repository \ + --build-arg BASE_IMAGE_VERSION=runtime-build-dependencies--${BUILD_DEPS_IMAGE_VERSION} \ + --build-arg BUILD_IMAGE_VERSION=runtime-build-dependencies--${BUILD_DEPS_IMAGE_VERSION} \ + --build-arg GIT_SHORTREF=${COMMIT_SHORT_SHA} \ + --build-arg GIT_DATETIME=${COMMIT_DATETIME} \ + --build-arg GIT_VERSION=${COMMIT_TAG} . + + +And then update the docker-compose file (e.g., ``alpha.yml``) with the docker tag:: + + node: + image: tezos_build:latest + ... + +Lastly, the entrypoint script (:src:`scripts/docker/entrypoint.sh`) provides the following configurable +environment variables: + +- ``DATA_DIR``: The directory to store the node's data (defaults to ``/var/run/tezos``). +- ``NODE_HOST``: The name of the node container (defaults to ``node``). +- ``NODE_RPC_PORT``: The RPC port to listen to (defaults to ``8732``). +- ``NODE_RPC_ADDR``: The RPC address that the node will listen to (defaults to ``localhost``). +- ``PROTOCOL``: The protocol that will be used. + +These variables can be set in the docker-compose file, as demonstrated in ``alpha.yml``:: + + node: + ... + environment: + PROTOCOL: alpha + ... + +If the above options are not enough, you can always replace the default ``entrypoint`` and ``command`` fields. + +:: + + version: "3" + services: + node: + container_name: node-alpha + entrypoint: /bin/sh + command: /etc/my-init-script.sh + volumes: + - ./my-init-script.sh:/etc/my-init-script.sh + - ... + environment: + PROTOCOL: alpha + ... .. _building_with_opam: diff --git a/scripts/docker/alpha.yml b/scripts/docker/alpha.yml new file mode 100644 index 000000000000..322a06da01d8 --- /dev/null +++ b/scripts/docker/alpha.yml @@ -0,0 +1,27 @@ +version: "3" +services: + node: + extends: + file: core.yml + service: node + container_name: node-alpha + environment: + PROTOCOL: alpha + baker: + extends: + file: core.yml + service: baker + container_name: baker-alpha + environment: + PROTOCOL: alpha + accuser: + extends: + file: core.yml + service: accuser + container_name: accuser-alpha + environment: + PROTOCOL: alpha + +volumes: + node_data: {} + client_data: {} diff --git a/scripts/docker/core.yml b/scripts/docker/core.yml new file mode 100644 index 000000000000..eeac93692034 --- /dev/null +++ b/scripts/docker/core.yml @@ -0,0 +1,48 @@ +# +# Core docker-compose file that runs the default settings for all the components. +# + +version: "3" +services: + node: + image: tezos/tezos:latest + hostname: node + command: tezos-node + container_name: node + ports: + - 9732:9732 + - 8732:8732 + environment: + NODE_RPC_ADDR: "0.0.0.0" + volumes: + - node_data:/var/run/tezos/node + - client_data:/var/run/tezos/client + restart: on-failure + + baker: + image: tezos/tezos:latest + hostname: baker + container_name: baker + command: tezos-baker --liquidity-baking-toggle-vote on + environment: + NODE_RPC_ADDR: "0.0.0.0" + volumes: + - client_data:/var/run/tezos/client + - node_data:/var/run/tezos/node + restart: on-failure + + accuser: + image: tezos/tezos:latest + hostname: accuser + command: tezos-accuser + container_name: accuser + environment: + NODE_RPC_ADDR: "0.0.0.0" + volumes: + - client_data:/var/run/tezos/client + - node_data:/var/run/tezos/node + restart: on-failure + +volumes: + node_data: {} + client_data: {} diff --git a/scripts/docker/docker-compose-generic.yml b/scripts/docker/docker-compose-generic.yml deleted file mode 100644 index 12273c03e7e8..000000000000 --- a/scripts/docker/docker-compose-generic.yml +++ /dev/null @@ -1,45 +0,0 @@ -version: "2" -services: - - node: - image: tezos/tezos:latest - hostname: node - command: octez-node - ports: - - 9732:9732 - expose: - - '8732' - volumes: - - node_data:/var/run/tezos/node - - client_data:/var/run/tezos/client - restart: on-failure - - ## Duplicate the `baker/accuser` containers for each PROTOCOL - ## in file `active_protocol_versions` - baker-alpha: - image: tezos/tezos:latest - hostname: baker-alpha - environment: - - PROTOCOL=alpha - command: octez-baker - links: - - node - volumes: - - client_data:/var/run/tezos/client - restart: on-failure - - accuser-alpha: - image: tezos/tezos:latest - hostname: accuser-alpha - environment: - - PROTOCOL=alpha - command: octez-accuser - links: - - node - volumes: - - client_data:/var/run/tezos/client - restart: on-failure - -volumes: - node_data: - client_data: diff --git a/scripts/docker/entrypoint.inc.sh b/scripts/docker/entrypoint.inc.sh index 133313a83b10..8c5cde928ee0 100644 --- a/scripts/docker/entrypoint.inc.sh +++ b/scripts/docker/entrypoint.inc.sh @@ -117,15 +117,15 @@ launch_node() { echo "Configuring the node..." "$node" config init \ --data-dir "$node_data_dir" \ - --rpc-addr "[::]:$NODE_RPC_PORT" \ - --allow-all-rpc "[::]:$NODE_RPC_PORT" \ + --rpc-addr "$NODE_RPC_ADDR:$NODE_RPC_PORT" \ + --allow-all-rpc "$NODE_RPC_ADDR:$NODE_RPC_PORT" $config_args else echo "Updating the node configuration..." "$node" config update \ --data-dir "$node_data_dir" \ - --rpc-addr "[::]:$NODE_RPC_PORT" \ - --allow-all-rpc "[::]:$NODE_RPC_PORT" \ + --rpc-addr "$NODE_RPC_ADDR:$NODE_RPC_PORT" \ + --allow-all-rpc "$NODE_RPC_ADDR:$NODE_RPC_PORT" $config_args fi diff --git a/scripts/docker/entrypoint.sh b/scripts/docker/entrypoint.sh index 03d1feec77a0..bc7fa86c0607 100755 --- a/scripts/docker/entrypoint.sh +++ b/scripts/docker/entrypoint.sh @@ -9,6 +9,7 @@ bin_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")" : "${NODE_HOST:="node"}" : "${NODE_RPC_PORT:="8732"}" +: "${NODE_RPC_ADDR:="localhost"}" : "${PROTOCOL:="unspecified-PROTOCOL-variable"}" diff --git a/scripts/docker/ithaca.yml b/scripts/docker/ithaca.yml new file mode 100644 index 000000000000..651b68821b32 --- /dev/null +++ b/scripts/docker/ithaca.yml @@ -0,0 +1,27 @@ +version: "3" +services: + node: + extends: + file: core.yml + service: node + container_name: node-ithaca + environment: + PROTOCOL: 012-Psithaca + baker: + extends: + file: core.yml + service: baker + container_name: baker-ithaca + environment: + PROTOCOL: 012-Psithaca + accuser: + extends: + file: core.yml + service: accuser + container_name: accuser-ithaca + environment: + PROTOCOL: 012-Psithaca + +volumes: + node_data: {} + client_data: {} diff --git a/scripts/docker/jakarta.yml b/scripts/docker/jakarta.yml new file mode 100644 index 000000000000..7915af907024 --- /dev/null +++ b/scripts/docker/jakarta.yml @@ -0,0 +1,27 @@ +version: "3" +services: + node: + extends: + file: core.yml + service: node + container_name: node-jakarta + environment: + PROTOCOL: 013-PtJakart + baker: + extends: + file: core.yml + service: baker + container_name: baker-jakarta + environment: + PROTOCOL: 013-PtJakart + accuser: + extends: + file: core.yml + service: accuser + container_name: accuser-jakarta + environment: + PROTOCOL: 013-PtJakart + +volumes: + node_data: {} + client_data: {} diff --git a/scripts/docker/kathmandu.yml b/scripts/docker/kathmandu.yml new file mode 100644 index 000000000000..492fdc4ebb53 --- /dev/null +++ b/scripts/docker/kathmandu.yml @@ -0,0 +1,27 @@ +version: "3" +services: + node: + extends: + file: core.yml + service: node + container_name: node-kathmandu + environment: + PROTOCOL: 014-PtKathma + baker: + extends: + file: core.yml + service: baker + container_name: baker-kathmandu + environment: + PROTOCOL: 014-PtKathma + accuser: + extends: + file: core.yml + service: accuser + container_name: accuser-kathmandu + environment: + PROTOCOL: 014-PtKathma + +volumes: + node_data: {} + client_data: {} -- GitLab From eb2ce5f5164a4d7495bd4fad13fdeaee062f2cd4 Mon Sep 17 00:00:00 2001 From: mujx Date: Thu, 8 Sep 2022 18:25:54 +0300 Subject: [PATCH 02/11] docs: Simplify build instructions for the docker images --- docs/introduction/howtoget.rst | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/docs/introduction/howtoget.rst b/docs/introduction/howtoget.rst index 44f936de1d41..bc4b81278c0b 100644 --- a/docs/introduction/howtoget.rst +++ b/docs/introduction/howtoget.rst @@ -179,27 +179,14 @@ build one locally and reference it. Run the following commands to build the imag :: - # Pick the current opam_repository_tag value found in the scripts/version.sh file. - export BUILD_DEPS_IMAGE_VERSION=fe613ae6e399204434c4be3e8d8d82662832d352 - export COMMIT_SHORT_SHA=$(git rev-parse --short HEAD) - export COMMIT_DATETIME=$(git show -s --pretty=format:%ci HEAD) - export COMMIT_TAG=$(git describe --tags --always) - - docker build \ - -t tezos_build:latest \ - -f build.Dockerfile \ - --build-arg BASE_IMAGE=registry.gitlab.com/tezos/opam-repository \ - --build-arg BASE_IMAGE_VERSION=runtime-build-dependencies--${BUILD_DEPS_IMAGE_VERSION} \ - --build-arg BUILD_IMAGE_VERSION=runtime-build-dependencies--${BUILD_DEPS_IMAGE_VERSION} \ - --build-arg GIT_SHORTREF=${COMMIT_SHORT_SHA} \ - --build-arg GIT_DATETIME=${COMMIT_DATETIME} \ - --build-arg GIT_VERSION=${COMMIT_TAG} . + ./scripts/ci/create_docker_image.build.sh + ./scripts/ci/create_docker_image.minimal.sh And then update the docker-compose file (e.g., ``alpha.yml``) with the docker tag:: node: - image: tezos_build:latest + image: tezos:latest ... Lastly, the entrypoint script (:src:`scripts/docker/entrypoint.sh`) provides the following configurable -- GitLab From 309c1ca730f3a8bf8ec416b05d16c4804d867c95 Mon Sep 17 00:00:00 2001 From: mujx Date: Sun, 18 Sep 2022 20:15:46 +0300 Subject: [PATCH 03/11] docs: Add more sections on docker-compose --- docs/introduction/howtoget.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/introduction/howtoget.rst b/docs/introduction/howtoget.rst index bc4b81278c0b..891dd3c43142 100644 --- a/docs/introduction/howtoget.rst +++ b/docs/introduction/howtoget.rst @@ -141,7 +141,7 @@ listed by ``dnf repoinfo``. .. _using_docker_images: -Using Docker images +Using Docker images & docker-compose ------------------- For every change committed in the GitLab repository, Docker images are @@ -174,6 +174,9 @@ The node's RPC interface will be available on localhost and can be queried with docker exec node-alpha tezos-client rpc list +Building Docker images locally +------------------------------ + The docker image used throughout the docker-compose files is fetched from upstream, but you can also build one locally and reference it. Run the following commands to build the image: @@ -189,6 +192,9 @@ And then update the docker-compose file (e.g., ``alpha.yml``) with the docker ta image: tezos:latest ... +Docker image configuration +------------------------------ + Lastly, the entrypoint script (:src:`scripts/docker/entrypoint.sh`) provides the following configurable environment variables: -- GitLab From 2aa4e0d7b74fa89a72a786db6f8632ebc52894a5 Mon Sep 17 00:00:00 2001 From: mujx Date: Thu, 22 Sep 2022 15:19:21 +0300 Subject: [PATCH 04/11] docs: Mention the removal of old docker-compose files --- docs/developer/howto-freeze-protocols.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/developer/howto-freeze-protocols.rst b/docs/developer/howto-freeze-protocols.rst index 6df7a07e8140..83cc4b5428ac 100644 --- a/docs/developer/howto-freeze-protocols.rst +++ b/docs/developer/howto-freeze-protocols.rst @@ -92,6 +92,12 @@ the plugin in the file ``proto_XXX/lib_plugin/plugin_registration.ml``. Other plugins should be evaluated case-by-case. At the moment of writing, the ``Mempool`` plugin is the only one that can be safely removed. +Remove old docker-compose files +------------------------------- + +The docker-compose file with the corresponding protocol name can be removed from the +``scripts/docker`` directory. + Add an Entry in ``CHANGES.rst`` ------------------------------- -- GitLab From d113a144fc2294d21d3fc4aa04afa6fa9932765f Mon Sep 17 00:00:00 2001 From: Romain Date: Thu, 22 Sep 2022 14:02:59 +0000 Subject: [PATCH 05/11] docs: Capitalize titles on the documentation --- docs/developer/howto-freeze-protocols.rst | 2 +- docs/introduction/howtoget.rst | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/developer/howto-freeze-protocols.rst b/docs/developer/howto-freeze-protocols.rst index 83cc4b5428ac..533a4acfc8aa 100644 --- a/docs/developer/howto-freeze-protocols.rst +++ b/docs/developer/howto-freeze-protocols.rst @@ -92,7 +92,7 @@ the plugin in the file ``proto_XXX/lib_plugin/plugin_registration.ml``. Other plugins should be evaluated case-by-case. At the moment of writing, the ``Mempool`` plugin is the only one that can be safely removed. -Remove old docker-compose files +Remove Old Docker-Compose Files ------------------------------- The docker-compose file with the corresponding protocol name can be removed from the diff --git a/docs/introduction/howtoget.rst b/docs/introduction/howtoget.rst index 891dd3c43142..f6c825bb2df1 100644 --- a/docs/introduction/howtoget.rst +++ b/docs/introduction/howtoget.rst @@ -141,8 +141,8 @@ listed by ``dnf repoinfo``. .. _using_docker_images: -Using Docker images & docker-compose -------------------- +Using Docker Images And Docker-Compose +-------------------------------------- For every change committed in the GitLab repository, Docker images are automatically generated and published on `DockerHub @@ -174,7 +174,7 @@ The node's RPC interface will be available on localhost and can be queried with docker exec node-alpha tezos-client rpc list -Building Docker images locally +Building Docker Images Locally ------------------------------ The docker image used throughout the docker-compose files is fetched from upstream, but you can also @@ -192,8 +192,8 @@ And then update the docker-compose file (e.g., ``alpha.yml``) with the docker ta image: tezos:latest ... -Docker image configuration ------------------------------- +Docker Image Configuration +-------------------------- Lastly, the entrypoint script (:src:`scripts/docker/entrypoint.sh`) provides the following configurable environment variables: -- GitLab From efb2451db593172a1be8e8f7c9ae91cd68ec80c5 Mon Sep 17 00:00:00 2001 From: mujx Date: Thu, 22 Sep 2022 17:51:57 +0300 Subject: [PATCH 06/11] docs: Prefix all docker-compose container with octez --- scripts/docker/alpha.yml | 18 +++++++++--------- scripts/docker/core.yml | 21 ++++++++++++--------- scripts/docker/ithaca.yml | 18 +++++++++--------- scripts/docker/jakarta.yml | 18 +++++++++--------- scripts/docker/kathmandu.yml | 18 +++++++++--------- 5 files changed, 48 insertions(+), 45 deletions(-) diff --git a/scripts/docker/alpha.yml b/scripts/docker/alpha.yml index 322a06da01d8..6b84344d3ee5 100644 --- a/scripts/docker/alpha.yml +++ b/scripts/docker/alpha.yml @@ -1,24 +1,24 @@ version: "3" services: - node: + octez-node: extends: file: core.yml - service: node - container_name: node-alpha + service: octez-node + container_name: octez-node-alpha environment: PROTOCOL: alpha - baker: + octez-baker: extends: file: core.yml - service: baker - container_name: baker-alpha + service: octez-baker + container_name: octez-baker-alpha environment: PROTOCOL: alpha - accuser: + octez-accuser: extends: file: core.yml - service: accuser - container_name: accuser-alpha + service: octez-accuser + container_name: octez-accuser-alpha environment: PROTOCOL: alpha diff --git a/scripts/docker/core.yml b/scripts/docker/core.yml index eeac93692034..ab8b80cdccec 100644 --- a/scripts/docker/core.yml +++ b/scripts/docker/core.yml @@ -4,40 +4,43 @@ version: "3" services: - node: + octez-node: image: tezos/tezos:latest - hostname: node + hostname: octez-node command: tezos-node - container_name: node + container_name: octez-node ports: - 9732:9732 - 8732:8732 environment: NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node volumes: - node_data:/var/run/tezos/node - client_data:/var/run/tezos/client restart: on-failure - baker: + octez-baker: image: tezos/tezos:latest - hostname: baker - container_name: baker + hostname: octez-baker + container_name: octez-baker command: tezos-baker --liquidity-baking-toggle-vote on environment: NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node volumes: - client_data:/var/run/tezos/client - node_data:/var/run/tezos/node restart: on-failure - accuser: + octez-accuser: image: tezos/tezos:latest - hostname: accuser + hostname: octez-accuser command: tezos-accuser - container_name: accuser + container_name: octez-accuser environment: NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node volumes: - client_data:/var/run/tezos/client - node_data:/var/run/tezos/node diff --git a/scripts/docker/ithaca.yml b/scripts/docker/ithaca.yml index 651b68821b32..6834706ffde6 100644 --- a/scripts/docker/ithaca.yml +++ b/scripts/docker/ithaca.yml @@ -1,24 +1,24 @@ version: "3" services: - node: + octez-node: extends: file: core.yml - service: node - container_name: node-ithaca + service: octez-node + container_name: octez-node-ithaca environment: PROTOCOL: 012-Psithaca - baker: + octez-baker: extends: file: core.yml - service: baker - container_name: baker-ithaca + service: octez-baker + container_name: octez-baker-ithaca environment: PROTOCOL: 012-Psithaca - accuser: + octez-accuser: extends: file: core.yml - service: accuser - container_name: accuser-ithaca + service: octez-accuser + container_name: octez-accuser-ithaca environment: PROTOCOL: 012-Psithaca diff --git a/scripts/docker/jakarta.yml b/scripts/docker/jakarta.yml index 7915af907024..69eb29376175 100644 --- a/scripts/docker/jakarta.yml +++ b/scripts/docker/jakarta.yml @@ -1,24 +1,24 @@ version: "3" services: - node: + octez-node: extends: file: core.yml - service: node - container_name: node-jakarta + service: octez-node + container_name: octez-node-jakarta environment: PROTOCOL: 013-PtJakart - baker: + octez-baker: extends: file: core.yml - service: baker - container_name: baker-jakarta + service: octez-baker + container_name: octez-baker-jakarta environment: PROTOCOL: 013-PtJakart - accuser: + octez-accuser: extends: file: core.yml - service: accuser - container_name: accuser-jakarta + service: octez-accuser + container_name: octez-accuser-jakarta environment: PROTOCOL: 013-PtJakart diff --git a/scripts/docker/kathmandu.yml b/scripts/docker/kathmandu.yml index 492fdc4ebb53..f9bb0d8e5111 100644 --- a/scripts/docker/kathmandu.yml +++ b/scripts/docker/kathmandu.yml @@ -1,24 +1,24 @@ version: "3" services: - node: + octez-node: extends: file: core.yml - service: node - container_name: node-kathmandu + service: octez-node + container_name: octez-node-kathmandu environment: PROTOCOL: 014-PtKathma - baker: + octez-baker: extends: file: core.yml - service: baker - container_name: baker-kathmandu + service: octez-baker + container_name: octez-baker-kathmandu environment: PROTOCOL: 014-PtKathma - accuser: + octez-accuser: extends: file: core.yml - service: accuser - container_name: accuser-kathmandu + service: octez-accuser + container_name: octez-accuser-kathmandu environment: PROTOCOL: 014-PtKathma -- GitLab From 42f22b9403b1b52e6729e7a3eadc6345d7289a8d Mon Sep 17 00:00:00 2001 From: Pierre Boutillier Date: Fri, 23 Sep 2022 11:40:23 +0000 Subject: [PATCH 07/11] docs: Control liquidity baking with an env variable --- docs/introduction/howtoget.rst | 1 + scripts/docker/core.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/introduction/howtoget.rst b/docs/introduction/howtoget.rst index f6c825bb2df1..356cb5a2444d 100644 --- a/docs/introduction/howtoget.rst +++ b/docs/introduction/howtoget.rst @@ -156,6 +156,7 @@ protocols. You can pick one and start with the following command (we'll assume a :: cd scripts/docker + export LIQUIDITY_BAKING_VOTE=on # You can choose between 'on' or 'off'. docker-compose -f alpha.yml up The above command will launch a node, a client, a baker, and an accuser for diff --git a/scripts/docker/core.yml b/scripts/docker/core.yml index ab8b80cdccec..104a50b259c9 100644 --- a/scripts/docker/core.yml +++ b/scripts/docker/core.yml @@ -24,7 +24,7 @@ services: image: tezos/tezos:latest hostname: octez-baker container_name: octez-baker - command: tezos-baker --liquidity-baking-toggle-vote on + command: tezos-baker --liquidity-baking-toggle-vote $LIQUIDITY_BAKING_VOTE environment: NODE_RPC_ADDR: "0.0.0.0" NODE_HOST: octez-node -- GitLab From 1c979b0860accc1f94ab7977a3ccfd928a762bef Mon Sep 17 00:00:00 2001 From: Pierre Boutillier Date: Thu, 29 Sep 2022 07:47:15 +0000 Subject: [PATCH 08/11] docs: Use `pass` instead of `on` for `LIQUIDITY_BAKING_VOTE` variable. --- docs/introduction/howtoget.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/introduction/howtoget.rst b/docs/introduction/howtoget.rst index 356cb5a2444d..4d46fabfdfc7 100644 --- a/docs/introduction/howtoget.rst +++ b/docs/introduction/howtoget.rst @@ -156,7 +156,7 @@ protocols. You can pick one and start with the following command (we'll assume a :: cd scripts/docker - export LIQUIDITY_BAKING_VOTE=on # You can choose between 'on' or 'off'. + export LIQUIDITY_BAKING_VOTE=pass # You can choose between 'on', 'pass' or 'off'. docker-compose -f alpha.yml up The above command will launch a node, a client, a baker, and an accuser for -- GitLab From 077344da29d5c5e7306e47c0c226825c8bfba413 Mon Sep 17 00:00:00 2001 From: mujx Date: Thu, 29 Sep 2022 11:35:20 +0300 Subject: [PATCH 09/11] docker: Remove the deprecated extends keyword --- scripts/docker/alpha.yml | 42 ++++++++++++++++++++++------- scripts/docker/core.yml | 51 ------------------------------------ scripts/docker/ithaca.yml | 42 ++++++++++++++++++++++------- scripts/docker/jakarta.yml | 42 ++++++++++++++++++++++------- scripts/docker/kathmandu.yml | 42 ++++++++++++++++++++++------- 5 files changed, 132 insertions(+), 87 deletions(-) delete mode 100644 scripts/docker/core.yml diff --git a/scripts/docker/alpha.yml b/scripts/docker/alpha.yml index 6b84344d3ee5..61e7f58fd304 100644 --- a/scripts/docker/alpha.yml +++ b/scripts/docker/alpha.yml @@ -1,26 +1,50 @@ version: "3" services: octez-node: - extends: - file: core.yml - service: octez-node container_name: octez-node-alpha + image: tezos/tezos:latest + hostname: octez-node + command: tezos-node + ports: + - 9732:9732 + - 8732:8732 environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: alpha + volumes: + - node_data:/var/run/tezos/node + - client_data:/var/run/tezos/client + restart: on-failure + octez-baker: - extends: - file: core.yml - service: octez-baker container_name: octez-baker-alpha + image: tezos/tezos:latest + hostname: octez-baker + command: tezos-baker --liquidity-baking-toggle-vote $LIQUIDITY_BAKING_VOTE environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: alpha + volumes: + - client_data:/var/run/tezos/client + - node_data:/var/run/tezos/node + restart: on-failure + + octez-accuser: - extends: - file: core.yml - service: octez-accuser container_name: octez-accuser-alpha + image: tezos/tezos:latest + hostname: octez-accuser + command: tezos-accuser environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: alpha + volumes: + - client_data:/var/run/tezos/client + - node_data:/var/run/tezos/node + restart: on-failure volumes: node_data: {} diff --git a/scripts/docker/core.yml b/scripts/docker/core.yml deleted file mode 100644 index 104a50b259c9..000000000000 --- a/scripts/docker/core.yml +++ /dev/null @@ -1,51 +0,0 @@ -# -# Core docker-compose file that runs the default settings for all the components. -# - -version: "3" -services: - octez-node: - image: tezos/tezos:latest - hostname: octez-node - command: tezos-node - container_name: octez-node - ports: - - 9732:9732 - - 8732:8732 - environment: - NODE_RPC_ADDR: "0.0.0.0" - NODE_HOST: octez-node - volumes: - - node_data:/var/run/tezos/node - - client_data:/var/run/tezos/client - restart: on-failure - - octez-baker: - image: tezos/tezos:latest - hostname: octez-baker - container_name: octez-baker - command: tezos-baker --liquidity-baking-toggle-vote $LIQUIDITY_BAKING_VOTE - environment: - NODE_RPC_ADDR: "0.0.0.0" - NODE_HOST: octez-node - volumes: - - client_data:/var/run/tezos/client - - node_data:/var/run/tezos/node - restart: on-failure - - octez-accuser: - image: tezos/tezos:latest - hostname: octez-accuser - command: tezos-accuser - container_name: octez-accuser - environment: - NODE_RPC_ADDR: "0.0.0.0" - NODE_HOST: octez-node - volumes: - - client_data:/var/run/tezos/client - - node_data:/var/run/tezos/node - restart: on-failure - -volumes: - node_data: {} - client_data: {} diff --git a/scripts/docker/ithaca.yml b/scripts/docker/ithaca.yml index 6834706ffde6..a7f7f3a71a8f 100644 --- a/scripts/docker/ithaca.yml +++ b/scripts/docker/ithaca.yml @@ -1,26 +1,50 @@ version: "3" services: octez-node: - extends: - file: core.yml - service: octez-node container_name: octez-node-ithaca + image: tezos/tezos:latest + hostname: octez-node + command: tezos-node + ports: + - 9732:9732 + - 8732:8732 environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: 012-Psithaca + volumes: + - node_data:/var/run/tezos/node + - client_data:/var/run/tezos/client + restart: on-failure + octez-baker: - extends: - file: core.yml - service: octez-baker container_name: octez-baker-ithaca + image: tezos/tezos:latest + hostname: octez-baker + command: tezos-baker --liquidity-baking-toggle-vote $LIQUIDITY_BAKING_VOTE environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: 012-Psithaca + volumes: + - client_data:/var/run/tezos/client + - node_data:/var/run/tezos/node + restart: on-failure + + octez-accuser: - extends: - file: core.yml - service: octez-accuser container_name: octez-accuser-ithaca + image: tezos/tezos:latest + hostname: octez-accuser + command: tezos-accuser environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: 012-Psithaca + volumes: + - client_data:/var/run/tezos/client + - node_data:/var/run/tezos/node + restart: on-failure volumes: node_data: {} diff --git a/scripts/docker/jakarta.yml b/scripts/docker/jakarta.yml index 69eb29376175..35d74ed4f78c 100644 --- a/scripts/docker/jakarta.yml +++ b/scripts/docker/jakarta.yml @@ -1,26 +1,50 @@ version: "3" services: octez-node: - extends: - file: core.yml - service: octez-node container_name: octez-node-jakarta + image: tezos/tezos:latest + hostname: octez-node + command: tezos-node + ports: + - 9732:9732 + - 8732:8732 environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: 013-PtJakart + volumes: + - node_data:/var/run/tezos/node + - client_data:/var/run/tezos/client + restart: on-failure + octez-baker: - extends: - file: core.yml - service: octez-baker container_name: octez-baker-jakarta + image: tezos/tezos:latest + hostname: octez-baker + command: tezos-baker --liquidity-baking-toggle-vote $LIQUIDITY_BAKING_VOTE environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: 013-PtJakart + volumes: + - client_data:/var/run/tezos/client + - node_data:/var/run/tezos/node + restart: on-failure + + octez-accuser: - extends: - file: core.yml - service: octez-accuser container_name: octez-accuser-jakarta + image: tezos/tezos:latest + hostname: octez-accuser + command: tezos-accuser environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: 013-PtJakart + volumes: + - client_data:/var/run/tezos/client + - node_data:/var/run/tezos/node + restart: on-failure volumes: node_data: {} diff --git a/scripts/docker/kathmandu.yml b/scripts/docker/kathmandu.yml index f9bb0d8e5111..369c7159ce61 100644 --- a/scripts/docker/kathmandu.yml +++ b/scripts/docker/kathmandu.yml @@ -1,26 +1,50 @@ version: "3" services: octez-node: - extends: - file: core.yml - service: octez-node container_name: octez-node-kathmandu + image: tezos/tezos:latest + hostname: octez-node + command: tezos-node + ports: + - 9732:9732 + - 8732:8732 environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: 014-PtKathma + volumes: + - node_data:/var/run/tezos/node + - client_data:/var/run/tezos/client + restart: on-failure + octez-baker: - extends: - file: core.yml - service: octez-baker container_name: octez-baker-kathmandu + image: tezos/tezos:latest + hostname: octez-baker + command: tezos-baker --liquidity-baking-toggle-vote $LIQUIDITY_BAKING_VOTE environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: 014-PtKathma + volumes: + - client_data:/var/run/tezos/client + - node_data:/var/run/tezos/node + restart: on-failure + + octez-accuser: - extends: - file: core.yml - service: octez-accuser container_name: octez-accuser-kathmandu + image: tezos/tezos:latest + hostname: octez-accuser + command: tezos-accuser environment: + NODE_RPC_ADDR: "0.0.0.0" + NODE_HOST: octez-node PROTOCOL: 014-PtKathma + volumes: + - client_data:/var/run/tezos/client + - node_data:/var/run/tezos/node + restart: on-failure volumes: node_data: {} -- GitLab From 71219eaa1e467eaa2b7ea7e4e05545a670fb4247 Mon Sep 17 00:00:00 2001 From: mujx Date: Thu, 29 Sep 2022 17:10:25 +0300 Subject: [PATCH 10/11] docker: Remove the ithaca and jakarta protocols --- scripts/docker/ithaca.yml | 51 -------------------------------------- scripts/docker/jakarta.yml | 51 -------------------------------------- 2 files changed, 102 deletions(-) delete mode 100644 scripts/docker/ithaca.yml delete mode 100644 scripts/docker/jakarta.yml diff --git a/scripts/docker/ithaca.yml b/scripts/docker/ithaca.yml deleted file mode 100644 index a7f7f3a71a8f..000000000000 --- a/scripts/docker/ithaca.yml +++ /dev/null @@ -1,51 +0,0 @@ -version: "3" -services: - octez-node: - container_name: octez-node-ithaca - image: tezos/tezos:latest - hostname: octez-node - command: tezos-node - ports: - - 9732:9732 - - 8732:8732 - environment: - NODE_RPC_ADDR: "0.0.0.0" - NODE_HOST: octez-node - PROTOCOL: 012-Psithaca - volumes: - - node_data:/var/run/tezos/node - - client_data:/var/run/tezos/client - restart: on-failure - - octez-baker: - container_name: octez-baker-ithaca - image: tezos/tezos:latest - hostname: octez-baker - command: tezos-baker --liquidity-baking-toggle-vote $LIQUIDITY_BAKING_VOTE - environment: - NODE_RPC_ADDR: "0.0.0.0" - NODE_HOST: octez-node - PROTOCOL: 012-Psithaca - volumes: - - client_data:/var/run/tezos/client - - node_data:/var/run/tezos/node - restart: on-failure - - - octez-accuser: - container_name: octez-accuser-ithaca - image: tezos/tezos:latest - hostname: octez-accuser - command: tezos-accuser - environment: - NODE_RPC_ADDR: "0.0.0.0" - NODE_HOST: octez-node - PROTOCOL: 012-Psithaca - volumes: - - client_data:/var/run/tezos/client - - node_data:/var/run/tezos/node - restart: on-failure - -volumes: - node_data: {} - client_data: {} diff --git a/scripts/docker/jakarta.yml b/scripts/docker/jakarta.yml deleted file mode 100644 index 35d74ed4f78c..000000000000 --- a/scripts/docker/jakarta.yml +++ /dev/null @@ -1,51 +0,0 @@ -version: "3" -services: - octez-node: - container_name: octez-node-jakarta - image: tezos/tezos:latest - hostname: octez-node - command: tezos-node - ports: - - 9732:9732 - - 8732:8732 - environment: - NODE_RPC_ADDR: "0.0.0.0" - NODE_HOST: octez-node - PROTOCOL: 013-PtJakart - volumes: - - node_data:/var/run/tezos/node - - client_data:/var/run/tezos/client - restart: on-failure - - octez-baker: - container_name: octez-baker-jakarta - image: tezos/tezos:latest - hostname: octez-baker - command: tezos-baker --liquidity-baking-toggle-vote $LIQUIDITY_BAKING_VOTE - environment: - NODE_RPC_ADDR: "0.0.0.0" - NODE_HOST: octez-node - PROTOCOL: 013-PtJakart - volumes: - - client_data:/var/run/tezos/client - - node_data:/var/run/tezos/node - restart: on-failure - - - octez-accuser: - container_name: octez-accuser-jakarta - image: tezos/tezos:latest - hostname: octez-accuser - command: tezos-accuser - environment: - NODE_RPC_ADDR: "0.0.0.0" - NODE_HOST: octez-node - PROTOCOL: 013-PtJakart - volumes: - - client_data:/var/run/tezos/client - - node_data:/var/run/tezos/node - restart: on-failure - -volumes: - node_data: {} - client_data: {} -- GitLab From 2a7cb6015895c53246da67b94ea71803bd57d8fc Mon Sep 17 00:00:00 2001 From: Pierre Boutillier Date: Thu, 29 Sep 2022 14:32:34 +0000 Subject: [PATCH 11/11] docker: Add missing slash at the end of the commands --- scripts/docker/entrypoint.inc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/docker/entrypoint.inc.sh b/scripts/docker/entrypoint.inc.sh index 8c5cde928ee0..29e843c9d2a5 100644 --- a/scripts/docker/entrypoint.inc.sh +++ b/scripts/docker/entrypoint.inc.sh @@ -118,14 +118,14 @@ launch_node() { "$node" config init \ --data-dir "$node_data_dir" \ --rpc-addr "$NODE_RPC_ADDR:$NODE_RPC_PORT" \ - --allow-all-rpc "$NODE_RPC_ADDR:$NODE_RPC_PORT" + --allow-all-rpc "$NODE_RPC_ADDR:$NODE_RPC_PORT" \ $config_args else echo "Updating the node configuration..." "$node" config update \ --data-dir "$node_data_dir" \ --rpc-addr "$NODE_RPC_ADDR:$NODE_RPC_PORT" \ - --allow-all-rpc "$NODE_RPC_ADDR:$NODE_RPC_PORT" + --allow-all-rpc "$NODE_RPC_ADDR:$NODE_RPC_PORT" \ $config_args fi -- GitLab