forked from allenai/allennlp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (27 loc) · 1.16 KB
/
Dockerfile
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
28
29
30
31
32
33
34
35
36
# This Dockerfile creates an environment suitable for downstream usage of AllenNLP.
# It's built from a wheel installation of allennlp using the base images from
# https://github.com/allenai/docker-images/pkgs/container/pytorch
ARG TORCH=1.12.0-cuda11.3-python3.8
FROM ghcr.io/allenai/pytorch:${TORCH}
WORKDIR /stage/allennlp
# Installing AllenNLP's dependencies is the most time-consuming part of building
# this Docker image, so we make use of layer caching here by adding the minimal files
# necessary to install the dependencies.
COPY allennlp/version.py allennlp/version.py
COPY setup.py .
COPY requirements.txt .
COPY dev-requirements.txt .
COPY constraints.txt .
RUN touch allennlp/__init__.py \
&& touch README.md \
&& pip install --no-cache-dir -c constraints.txt -e .[all]
# Now add the full package source and re-install just the package.
COPY allennlp allennlp
RUN pip install --no-cache-dir --no-deps -e .[all]
COPY Makefile .
RUN make download-extras
WORKDIR /app/
# Copy wrapper script to allow beaker to run resumable training workloads.
COPY scripts/ai2_internal/resumable_train.sh .
LABEL maintainer="[email protected]"
ENTRYPOINT ["allennlp"]