From 660e635d26d4df65219cfbeb30efb73f0a6ff2a6 Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Sat, 16 Mar 2024 17:35:41 +0000 Subject: [PATCH] chore(docker): remove outdated docker folder --- README.md | 8 ------ docker/Dockerfile | 53 --------------------------------------- docker/LightDockerfile | 29 --------------------- docker/README.md | 13 ---------- docker/docker-compose.yml | 30 ---------------------- docker/docker_cmd.md | 9 ------- docker/setup.sh | 44 -------------------------------- 7 files changed, 186 deletions(-) delete mode 100644 docker/Dockerfile delete mode 100644 docker/LightDockerfile delete mode 100644 docker/README.md delete mode 100644 docker/docker-compose.yml delete mode 100755 docker/docker_cmd.md delete mode 100755 docker/setup.sh diff --git a/README.md b/README.md index 9b8a41aabe..c3d374d97c 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,6 @@ For installation and local development instructions, please see our [installatio This repository is organized as Lerna submodules. Each submodule contains its own unit tests. -- `audit`: Documentation surrounding the audit performed on v1 - `crypto`: low-level cryptographic operations. - `circuits`: zk-SNARK circuits. - `contracts`: Solidity contracts and deployment code. @@ -60,13 +59,6 @@ own unit tests. Please refer to the [testing documentation](https://maci.pse.dev/docs/testing) for more information. -### Docker - -Run `docker build -t maci .` to build all stages. - -To run a specific build step `docker build --target circuits -t maci .` -Note: a cached version of `builder` job must be on your system prior as it relies on existing artifacts - ### CI pipeline CI pipeline ensures that we have automated tests that constantly validate. For more information about pipeline workflows, [read our CI documentation](https://maci.pse.dev/docs/ci-pipeline). diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index fbe044b78f..0000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -FROM ubuntu:20.04 as maci-node - -ARG COMMIT_SHA=unknown -ARG REPO_NAME="https://github.com/privacy-scaling-explorations/maci.git" -ARG BRANCH_NAME=v1 - -# install dependency -RUN apt-get update \ - && apt-get install -y curl wget git jq\ - && apt-get install -y build-essential libgmp-dev libsodium-dev nasm \ - && apt-get install -y libgmp-dev nlohmann-json3-dev nasm g++ - - -# install nvm and Node.js -ENV NODE_VERSION=14.18.1 -RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash -ENV NVM_DIR=/root/.nvm -RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} -RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} -RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} -RUN . "$NVM_DIR/nvm.sh" && nvm install-latest-npm -RUN npm i -g pnpm -ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" - -# add metadata -RUN echo "REPO_NAME='$REPO_NAME'" > /etc/image-info \ - && echo "BRANCH_NAME='$BRANCH_NAME'" >> /etc/image-info \ - && echo "NODE_VERSION='$(node --version)'" >> /etc/image-info - - -# install rapicsnark for v1.0.0 -RUN cd ~ \ - && git clone https://github.com/iden3/rapidsnark.git \ - && cd rapidsnark \ - && git checkout 1c13721de4a316b0b254c310ccec9341f5e2208e \ - && pnpm install \ - && git submodule init \ - && git submodule update \ - && pnpm exec task createFieldSources \ - && pnpm exec task buildProver - -# install maci -RUN cd ~ \ - && git clone $REPO_NAME \ - && cd maci \ - && git checkout ${BRANCH_NAME} \ - && pnpm i -RUN cd ~/maci && pnpm run build - -# HTTP port -EXPOSE 8080 -EXPOSE 8545 - diff --git a/docker/LightDockerfile b/docker/LightDockerfile deleted file mode 100644 index 8204af05cd..0000000000 --- a/docker/LightDockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM chaosma/maci:v0.5 as maci-node - -ARG COMMIT_SHA=unknown -ARG REPO_NAME="https://github.com/chaosma/maci.git" -ARG BRANCH_V1="cordservice" -ARG BRANCH_V0="v0.10-cord" -ARG V1_REPO="/root/maci" -ARG V0_REPO="/root/maci_v0_10" - -RUN npm i -g pnpm - -# update maci v1.0 -RUN cd $V1_REPO \ - && git checkout $BRANCH_V1 \ - && git fetch && git reset --hard origin/$BRANCH_V1 \ - && pnpm i -RUN cd $V1_REPO && pnpm run build - -# update maci v0.10 -RUN cd $V0_REPO \ - && git checkout $BRANCH_V0 \ - && git fetch && git reset --hard origin/$BRANCH_V0 \ - && pnpm i -RUN cd $V0_REPO && pnpm run build -RUN cd $V0_REPO/circuits && ./scripts/buildBatchUpdateStateTreeSnark.sh && ./scripts/buildQuadVoteTallySnark.sh - -# HTTP port -EXPOSE 8080 -EXPOSE 8545 diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 4dddc210c9..0000000000 --- a/docker/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Coordinator Docker Image - -Preconfigured Docker image for running Coordinator Service. - -## Docker Compose - -```sh -./setup.sh -docker-compose up -``` - -This will start maci coordinator service and mongodb in Docker and create persistent -data directories for mongodb in `./data/mongodb`. diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml deleted file mode 100644 index f5e01e0b4f..0000000000 --- a/docker/docker-compose.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: "3" -services: - maci-node: - tty: true - image: maci-node:latest - ports: - - "8080:8080" - depends_on: - - mongo - environment: - mongo_host: mongo - mongo_user: maci-coordinator - mongo_pass: let-me-in - mongo_db: maci-db - mongo_uri: "mongodb://maci-coordinator:let-me-in@host.docker.internal" - ETH_PROVIDER: "http://127.0.0.1:8545" - volumes: - - ~/maci:/root/dev-maci - - ~/maci_v0_10:/root/dev-maci_v0_10 - - ~/maci/cli/zkeys:/root/maci/cli/zkeys - mongo: - image: mongo - restart: always - ports: - - "27017:27017" - environment: - MONGO_INITDB_ROOT_USERNAME: maci-coordinator - MONGO_INITDB_ROOT_PASSWORD: let-me-in - volumes: - - ./data/mongodb:/data/db diff --git a/docker/docker_cmd.md b/docker/docker_cmd.md deleted file mode 100755 index eb4393994f..0000000000 --- a/docker/docker_cmd.md +++ /dev/null @@ -1,9 +0,0 @@ -## Useful Docker Commands - -### remove tag images - -docker rmi $(docker images -f 'dangling=true' -q) - -### build docker image by local Dockerfile - -docker build -t maci-node . diff --git a/docker/setup.sh b/docker/setup.sh deleted file mode 100755 index f407243acf..0000000000 --- a/docker/setup.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if ! which docker 2>&1 > /dev/null; then - echo "Please install 'docker' first" - exit 1 -fi - -if ! which docker-compose 2>&1 > /dev/null; then - echo "Please install 'docker-compose' first" - exit 1 -fi - -if ! which jq 2>&1 > /dev/null; then - echo "Please install 'jq' first" - exit 1 -fi - -# Create the maci-node container -docker-compose up --no-start maci-node - -# Start maci-node so we can inspect it -docker-compose start maci-node - -# Identify the container ID -CONTAINER_ID=$(docker container ls | grep maci-node | cut -d' ' -f1) - -# Inspect the container to identify the host IP address -HOST_IP=$(docker inspect "$CONTAINER_ID" | jq -r .[0].NetworkSettings.Networks[].Gateway) - -echo "Host IP: $HOST_IP" - -# Inject the host IP into docker-compose.yml and server/admin.sh -sed -i -e "s/host.docker.internal/$HOST_IP/g" docker-compose.yml -sed -i -e "s/host.docker.internal/$HOST_IP/g" ../server/admin.sh -sed -i -e "s/host.docker.internal/$HOST_IP/g" ../server/admin_v0_10.sh - -function stop_graph_node { - # Ensure maci-node is stopped - docker-compose stop maci-node -} - -trap stop_graph_node EXIT