wip deepseek r1

This commit is contained in:
2025-03-02 22:01:24 +01:00
parent b7e95d7398
commit b64f8d7d33
40 changed files with 6654 additions and 1859 deletions

View File

@@ -1,57 +1,82 @@
FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04 AS requirements
RUN apt-get update
RUN apt-get upgrade -y
RUN apt install -y python3-pip
ENV TOKENIZERS_PARALLELISM=false
COPY requirements.txt /requirements.txt
RUN pip3 install -r /requirements.txt
RUN rm -rf /requirements.txt
FROM requirements AS sia-test
COPY ./ /root/sia/
WORKDIR /root/sia/
RUN mkdir -p /root/models/current
CMD ["python3", "-m", "unittest", "discover", "-v", "-p", "*test.py"]
FROM node:20-alpine AS web-test
WORKDIR /app
COPY web/package*.json ./
RUN npm install
COPY web .
RUN npm test
FROM node:20-alpine AS web-build
WORKDIR /app
COPY web/package*.json ./
RUN npm install
COPY web .
RUN npm run build
FROM requirements
RUN apt-get update
RUN apt-get install -y wget gnupg
FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04 AS base
RUN apt-get update && \
apt-get upgrade -y && \
apt install -y \
python3-pip \
git \
python3-venv \
wget \
gnupg \
vim \
curl
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
RUN apt-get update
RUN apt-get install -y google-chrome-stable
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
RUN apt-get update && \
apt-get install -y \
google-chrome-stable
RUN rm -rf /var/lib/apt/lists/*
# Create directory structure
RUN mkdir -p \
/root/sia \
/root/sia/scripts \
/root/data/iterations \
/root/data/user \
/root/data/tasks \
/root/data/environment \
/root/models \
/root/desktop
/root/desktop \
/root/venvs
COPY ./tools/itb/requirements.txt /root/sia/tools/itb/requirements.txt
RUN cd /root/sia/tools/itb/ && python3 -m pip install -r requirements.txt
# ITB tool setup
FROM base AS itb-env
COPY ./scripts/setup_binaries.py /root/sia/scripts/
COPY ./tools/itb/setup.py /root/sia/tools/itb/setup.py
RUN python3 /root/sia/scripts/setup_binaries.py /root/sia/tools/itb/setup.py
RUN python3 -m venv /root/venvs/itb
RUN /root/venvs/itb/bin/pip install -e /root/sia/tools/itb/
COPY ./tools/ /root/sia/tools/
RUN cd /root/sia/tools/itb/ && python3 -m pip install -e ".[dev]"
# Train tool setup
FROM base AS train-env
COPY ./scripts/setup_binaries.py /root/sia/scripts/
COPY ./tools/train/setup.py /root/sia/tools/train/setup.py
RUN python3 /root/sia/scripts/setup_binaries.py /root/sia/tools/train/setup.py
RUN python3 -m venv /root/venvs/train
RUN /root/venvs/train/bin/pip install -e /root/sia/tools/train/
# SIA core setup
FROM base AS sia-env
COPY ./scripts/setup_binaries.py /root/sia/scripts/
COPY ./setup.py /root/sia/setup.py
RUN python3 /root/sia/scripts/setup_binaries.py /root/sia/setup.py
RUN python3 -m venv /root/venvs/sia
RUN /root/venvs/sia/bin/pip install -e /root/sia/
# Web frontend build
FROM node:20-alpine AS web-build
WORKDIR /app
COPY web/package*.json ./
RUN npm install
RUN rm -rf /root/.npm/_cacache
COPY web .
RUN npm run build
# Final image
FROM base
# Copy virtual environments (these layers only change if setup.py files change)
COPY --from=itb-env /root/venvs/itb /root/venvs/itb
COPY --from=train-env /root/venvs/train /root/venvs/train
COPY --from=sia-env /root/venvs/sia /root/venvs/sia
# Copy source code and scripts (these change frequently but don't affect venv layers)
COPY --from=itb-env /root/sia/tools/itb /root/sia/tools/itb
COPY --from=train-env /root/sia/tools/train /root/sia/tools/train
COPY --from=sia-env /root/sia /root/sia
COPY --from=web-build /app/dist /root/static/
RUN echo 'for venv in /root/venvs/*/bin; do PATH="$venv:$PATH"; done' >> /etc/profile && \
echo 'export PATH' >> /etc/profile
WORKDIR /root/desktop
CMD ["/root/sia/scripts/restart.sh"]
CMD ["/bin/bash", "-l", "-c", "/root/sia/scripts/restart.sh"]