-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy patholmoearth_pretrain.Dockerfile
More file actions
27 lines (21 loc) · 1.5 KB
/
olmoearth_pretrain.Dockerfile
File metadata and controls
27 lines (21 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM pytorch/pytorch:2.7.0-cuda12.8-cudnn9-runtime
RUN apt update
RUN apt install -y libpq-dev ffmpeg libsm6 libxext6 git wget
# Use uv to install everything.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Install dependencies for rslearn, olmoearth_pretrain, and rslearn_projects.
COPY docker_build/rslearn/pyproject.toml /opt/rslearn/pyproject.toml
COPY docker_build/olmoearth_pretrain/pyproject.toml /opt/olmoearth_pretrain/pyproject.toml
COPY requirements.txt /opt/rslearn_projects/requirements.txt
COPY requirements-extra.txt /opt/rslearn_projects/requirements-extra.txt
COPY requirements-olmocore.txt /opt/rslearn_projects/requirements-olmocore.txt
# Using cache mount here avoids needing to re-download dependencies for later builds if the version didn't change.
RUN --mount=type=cache,target=/root/.cache/uv uv pip install --system /opt/rslearn[extra] /opt/olmoearth_pretrain -r /opt/rslearn_projects/requirements.txt -r /opt/rslearn_projects/requirements-extra.txt -r /opt/rslearn_projects/requirements-olmocore.txt
# Now copy the source code and install for real.
# If we don't change any dependencies, then only these steps need to be repeated
# (fast and means the new layers have small size).
COPY ./docker_build/rslearn /opt/rslearn
COPY ./docker_build/olmoearth_pretrain /opt/olmoearth_pretrain
COPY . /opt/rslearn_projects/
RUN --mount=type=cache,target=/root/.cache/uv uv pip install --system /opt/rslearn[extra] /opt/olmoearth_pretrain /opt/rslearn_projects[extra]
WORKDIR /opt/rslearn_projects