From b03fac987c1155a7e9094a17441eb4b903a74cd9 Mon Sep 17 00:00:00 2001 From: Thomas Chataigner Date: Wed, 13 Nov 2024 11:46:38 +0100 Subject: [PATCH 1/2] fix: update docker resources w/ kadena --- .github/workflows/docker-publish.yml | 3 ++- docker/Dockerfile | 3 +++ docker/README.md | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e42f8871..b7ad046b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -14,12 +14,13 @@ on: workflow_dispatch: inputs: light-client: - description: 'aptos or ethereum' + description: 'aptos, ethereum or kadena' type: choice required: true options: - aptos - ethereum + - kadena version: description: "Image version" required: true diff --git a/docker/Dockerfile b/docker/Dockerfile index bd2b0752..cad6cc7e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -49,6 +49,9 @@ COPY ./$LIGHT_CLIENT . RUN if [ "$LIGHT_CLIENT" = "aptos" ]; then \ PACKAGE_NAME="proof-server"; \ RUSTFLAGS="-C target-cpu=x86-64-v4 --cfg tokio_unstable -C opt-level=3"; \ + else if [ "$LIGHT_CLIENT" = "kadena" ]; then \ + PACKAGE_NAME="kadena-lc"; \ + RUSTFLAGS="-C target-cpu=x86-64-v4 -C opt-level=3"; \ else \ PACKAGE_NAME="ethereum-lc"; \ RUSTFLAGS="-C target-cpu=x86-64-v4 -C opt-level=3"; \ diff --git a/docker/README.md b/docker/README.md index 5e0b6279..3bfa211c 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,6 +1,7 @@ # Light Client container configuration -To ease the execution and deployment of our Light Client implementation, we provide a set of Docker configuration file that helps to build and run the necessary components. +To ease the deployment of our proof servers, we provide a set of Docker configuration file that helps to build and run +them. ## Notice @@ -60,7 +61,7 @@ services: You can start the proof server with the following command: ```bash -docker compose -f docker/compose/docker-compose-proof-servers.yml -f docker/compose/docker-compose-.yml up +docker compose -f docker/compose/docker-compose-proof-servers.yml -f docker/compose/docker-compose-.yml up ``` This command will start the containers as defined in the docker-compose.yml file. From 6aca0a6eccac2664041ad9bafb6e2b39407ea6a7 Mon Sep 17 00:00:00 2001 From: Thomas Chataigner Date: Mon, 18 Nov 2024 13:35:30 +0100 Subject: [PATCH 2/2] docs: update docker docs after bare tryout --- docker/Dockerfile | 2 +- docker/README.md | 29 ++++++++++++++----- docker/compose/.example.env | 5 +--- .../compose/docker-compose-proof-servers.yml | 2 +- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index cad6cc7e..c1933ce3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -49,7 +49,7 @@ COPY ./$LIGHT_CLIENT . RUN if [ "$LIGHT_CLIENT" = "aptos" ]; then \ PACKAGE_NAME="proof-server"; \ RUSTFLAGS="-C target-cpu=x86-64-v4 --cfg tokio_unstable -C opt-level=3"; \ - else if [ "$LIGHT_CLIENT" = "kadena" ]; then \ + elif [ "$LIGHT_CLIENT" = "kadena" ]; then \ PACKAGE_NAME="kadena-lc"; \ RUSTFLAGS="-C target-cpu=x86-64-v4 -C opt-level=3"; \ else \ diff --git a/docker/README.md b/docker/README.md index 3bfa211c..ac532dce 100644 --- a/docker/README.md +++ b/docker/README.md @@ -22,6 +22,9 @@ in the repository. The images can be found under [the packages listed for the re > Note: For more information about the proof server feel free to refer to the > documentation of the specific Light Client. +The `Dockerfile` specifically targets an Linux machine with `avx512_ifma` and `avx512_vbmi2` +support. Make sure that you run the container on such machine. + ## Run the Proof Servers images We have two ways to run the proof server images, either via [`docker compose`](https://docs.docker.com/compose/) @@ -30,12 +33,15 @@ or via a dedicated [Helm chart for Kubernetes](https://helm.sh/). ### Docker Compose The `docker/compose` directory contains the necessary files to run the proof -servers and the client using Docker Compose. It is only needed to set the environment variables +servers using Docker Compose. It is only needed to set the environment variables and change the image to the desired one to run the project. + + #### Setting up the Environment Variables -The project uses environment variables to configure the proof servers and the client. These variables are defined in a .env file located in the +The project uses environment variables to configure the proof server. These variables are defined in a `.env` file +located in the `docker/compose` directory. An example .env file is provided as `.example.env`. Some environment variables are common to all Light Clients and others are specific to one implementation. @@ -44,6 +50,13 @@ The project uses environment variables to configure the proof servers and the cl - `PRIMARY_ADDR`: The address of the primary server (e.g., `0.0.0.0`). - `PRIMARY_PORT`: The port number for the primary server (e.g., `6379`). +> **Note** +> +> There are also some specific environment variables that are used by the proof servers. +> These variables are meant to optimize the time taken to generate proofs for each +> Light Client. Make sure that you refer to the `benchmark/configuration.md` file +> of the Light Client you want to deploy a proof server for. + #### Set the desired image The `docker-compose.yml` file contains the definition of the services that will be run. @@ -53,7 +66,7 @@ found in the [packages](https://github.com/orgs/argumentcomputer/packages?repo_n ```yaml services: server-primary: - image: ghcr.io/argumentcomputer/-proof-server: + image: ghcr.io/argumentcomputer/-proof-server: ``` #### Running the Docker Compose @@ -61,16 +74,16 @@ services: You can start the proof server with the following command: ```bash -docker compose -f docker/compose/docker-compose-proof-servers.yml -f docker/compose/docker-compose-.yml up +docker compose -f docker/compose/docker-compose-proof-servers.yml up ``` -This command will start the containers as defined in the docker-compose.yml file. -The proof servers and the client will start running, and you can interact with -them as defined in the project documentation. +This command will start the container as defined in the docker-compose.yml file. +The proof server will start running, and you can interact with +it as defined in the project documentation. ### Helm Chart -To deploy the proof servers and the client using Kubernetes, we provide a Helm chart in the `proof-server-chart` +To deploy the proof servers using Kubernetes, we provide a Helm chart in the `proof-server-chart` directory. The pre-requisite to run the Helm chart is to have a Kubernetes cluster running. To help get one running we have a dedicated `eksctl` configuration file in the `k8s` directory. It leverages [`AWS EKS`](https://aws.amazon.com/eks/) to create a cluster that we can leverage to deploy the Helm chart. diff --git a/docker/compose/.example.env b/docker/compose/.example.env index bfb1b04f..74ed93fb 100644 --- a/docker/compose/.example.env +++ b/docker/compose/.example.env @@ -1,5 +1,2 @@ PRIMARY_ADDR=0.0.0.0 -PRIMARY_PORT=6379 -SECONDARY_ADDR=0.0.0.0 -SECONDARY_PORT=6380 -APTOS_NODE_URL=127.0.0.1:8080 \ No newline at end of file +PRIMARY_PORT=6379 \ No newline at end of file diff --git a/docker/compose/docker-compose-proof-servers.yml b/docker/compose/docker-compose-proof-servers.yml index a52931e2..9f73f30e 100644 --- a/docker/compose/docker-compose-proof-servers.yml +++ b/docker/compose/docker-compose-proof-servers.yml @@ -1,5 +1,5 @@ services: - server-primary: + proof-server: image: ghcr.io/argumentcomputer/ethereum-proof-server:latest pull_policy: always command: sh -c "/app/proof_server --mode \"single\" --addr ${PRIMARY_ADDR}:${PRIMARY_PORT}"