Skip to content

Commit

Permalink
fix: simplify to use base image's Python 3.8 for both bittensor and m…
Browse files Browse the repository at this point in the history
…asa-ai
  • Loading branch information
5u6r054 committed Jan 31, 2025
1 parent c76d2d1 commit 9c5fa96
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,25 @@ ENV PIP_NO_CACHE_DIR=1 \
PYTHONUNBUFFERED=1 \
DEBIAN_FRONTEND=noninteractive

# Install Python 3.12 and create virtualenv for masa-ai
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3.12 \
python3.12-venv \
python3.12-dev && \
rm -rf /var/lib/apt/lists/* && \
python3.12 -m venv /venv && \
/venv/bin/pip install --upgrade pip

# Install masa-ai in Python 3.12 venv
RUN /venv/bin/pip install "masa-ai==0.2.7"

# Install testing packages in system Python 3.8
# Install testing packages
RUN pip install --only-binary :all: \
"pytest>=7.2.0" \
"pytest-asyncio>=0.21.0"

# Set up workspace
WORKDIR /app

# Set environment variables - include both Python paths
# Set environment variables
ENV CONFIG_PATH=/app/subnet-config.json \
ROLE=validator \
NETWORK=test \
NETUID=165 \
PYTHONPATH=/app:/usr/local/lib/python3.8/site-packages:/venv/lib/python3.12/site-packages \
PATH="/usr/local/bin:/venv/bin:$PATH"
NETUID=165

# Copy startup directory
COPY startup /app/startup

# Use system Python 3.8 for entrypoint since it needs bittensor
# Install masa-ai last
RUN pip install "masa-ai==0.2.7"

# Use system Python 3.8 for entrypoint
ENTRYPOINT ["python", "-u", "/app/startup/entrypoint.py"]

0 comments on commit 9c5fa96

Please sign in to comment.