Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ NODE_IP=localhost
ROUTING_TYPE=direct
ROUTING_URL=ws://node.naptha.ai:8765

# Naptha MPC Server
MPC_SERVER_PORT=8000

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mcp not mpc. we will need to change all of these.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course. thanks for spotting the blunder


# rabbitmq instance
RMQ_USER=username
RMQ_PASSWORD=password
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,5 @@ docker_compose_command.sh
user_private.pem
*.pem
node/inference/ollama/.gitkeep
node/inference/litellm/start_litellm.sh
node/inference/litellm/start_litellm.sh
node/mpc/start_mpc.sh
44 changes: 44 additions & 0 deletions Dockerfile-mpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM condaforge/miniforge3:24.9.2-0

WORKDIR /app

# use bash instead of sh
SHELL ["/bin/bash", "-c"]

# install deps
RUN apt-get update
RUN apt-get install gcc curl git -y

# add conda install to path; use base environment
ENV PATH="/opt/conda/bin:${PATH}"
RUN conda create -y -n mpc python=3.12
RUN echo "source activate mpc" > /root/.bashrc
ENV PATH="/opt/conda/envs/mpc/bin:$PATH"

# Install uv properly and add to PATH
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}"

# Copy MPC server code - copy to /app directly
COPY node/mpc .

# Create virtual environment with uv
RUN uv venv .venv

# Install pip explicitly in the virtual environment
RUN curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
.venv/bin/python get-pip.py && \
rm get-pip.py

# Install dependencies from pyproject.toml
RUN . .venv/bin/activate && \
uv pip install -e .

ENV PYTHONPATH=/app

# Expose MPC server port
EXPOSE 8000

# Command to run the server
CMD . .venv/bin/activate && \
python server.py --port 8000
23 changes: 23 additions & 0 deletions docker-compose.development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,29 @@ services:
networks:
- naptha-network

mpc-server:
container_name: mpc-server
build:
context: .
dockerfile: Dockerfile-mpc
env_file:
- ./.env
restart: unless-stopped
ports:
- '${MPC_SERVER_PORT:-8000}:8000'
networks:
- naptha-network
# In development mode, mount the source code for live reloading
volumes:
- ./node/mpc:/app/node/mpc
develop:
watch:
- action: sync+restart
path: ./node/mpc
target: /app/node/mpc
- action: rebuild
path: ./node/mpc/pyproject.toml

volumes:
rabbitmq_data:
postgres_data:
Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ services:
networks:
- naptha-network

mpc-server:
container_name: mpc-server
build:
context: .
dockerfile: Dockerfile-mpc
env_file:
- ./.env
restart: unless-stopped
ports:
- '${MPC_SERVER_PORT:-8000}:8000'
networks:
- naptha-network

volumes:
rabbitmq_data: # persist rabbitMQ data e.g. anything durable; users & credentials; configs
postgres_data:
Expand Down
Loading