Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: merge FTP service into the main docker-compose.yml for better maintenance #12

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
# Install required packages and setup ssh access
RUN apt-get update && apt-get install -y --no-install-recommends openssh-server sudo cmake curl build-essential git wget && rm -rf /var/lib/apt/lists/* \
&& sudo apt update -y && sudo apt install -y apache2-utils \
&& sudo apt update -y && sudo apt install -y apache2-utils fish iftop htop iotop \
&& mkdir /var/run/sshd \
&& /etc/init.d/ssh start \
&& useradd -rm -d /home/zkwasm -s /bin/bash -g root -G sudo -u 1001 zkwasm \
Expand Down
2 changes: 1 addition & 1 deletion _start_prover-node-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ $hugepages_free -lt 15000 ]; then
fi

# Download param files from local FTP server
wget -r -nH -nv --cut-dirs=1 --no-parent --user=ftpuser --password=ftppassword ftp://localhost/params/ -P /home/zkwasm/prover-node-release/workspace/static/ && \
wget -r -nH -nv --cut-dirs=1 --no-parent --user=ftpuser --password=ftppassword ftp://zkwasm-params/params/ -P /home/zkwasm/prover-node-release/workspace/static/ && \
time=$(date +%Y-%m-%d-%H-%M-%S) && \
CUDA_VISIBLE_DEVICES=0 RUST_LOG=info RUST_BACKTRACE=1 ./target/release/zkwasm-playground --config prover_config.json -w workspace --dryrunconfig dry_run_config.json -p \
2>&1 | rotatelogs -e -n 10 logs/prover/prover_${time}.log 100M
46 changes: 42 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
services:
zkwasm-params:
image: zkwasm/params
networks:
- zkwasm-network
container_name: zkwasm-params
environment:
PUBLICHOST: "zkwasm-params"
FTP_USER_NAME: ftpuser
FTP_USER_PASS: ftppassword
FTP_USER_HOME: /home/ftpuser
healthcheck:
test: "ls -l /var/run/pure-ftpd.pid"
interval: 30s
timeout: 10s
retries: 3
logging:
driver: "json-file"
options:
max-file: "3"
max-size: 30m

mongodb:
image: mongo:latest
attach: false
network_mode: "host"
networks:
- zkwasm-network
container_name: zkwasm-mongodb
# ports:
# - "27017:27017"
volumes:
Expand All @@ -20,13 +43,15 @@ services:
interval: 30s
timeout: 10s
retries: 3
container_name: zkwasm-mongodb
restart: always

prover-dry-run-service:
image: zkwasm:latest
attach: false
runtime: nvidia
network_mode: "host"
networks:
- zkwasm-network
container_name: zkwasm-prover-dryrun
user: "1001:1001"
build:
context: .
Expand Down Expand Up @@ -63,13 +88,18 @@ services:

RUST_LOG=info ./target/release/zkwasm-playground --dryrunconfig dry_run_config.json -w workspace --dryrun=prover \
2>&1 | sudo rotatelogs -e -n 10 logs/dry_run/dry_run_$${time}.log 100M"

prover-node:
image: zkwasm:latest
runtime: nvidia
network_mode: "host"
networks:
- zkwasm-network
container_name: zkwasm-prover
depends_on:
prover-dry-run-service:
condition: service_healthy
zkwasm-params:
condition: service_healthy
deploy:
resources:
reservations:
Expand Down Expand Up @@ -111,6 +141,14 @@ services:
"/bin/bash",
"/home/zkwasm/prover-node-release/_start_prover-node-service.sh",
]

networks:
zkwasm-network:
driver: bridge
ipam:
config:
- subnet: 10.66.0.0/24

volumes:
workspace-volume:
prover-logs-volume:
Expand Down
2 changes: 1 addition & 1 deletion dry_run_config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"server_url": "http://localhost:8080",
"mongodb_uri": "mongodb://localhost:27017",
"mongodb_uri": "mongodb://mongodb:27017",
"private_key": "PRIVATE_KEY",
"big_file_timeout": 1800,
"get_timeout": 300,
Expand Down
19 changes: 0 additions & 19 deletions ftp-docker-compose.yml

This file was deleted.