2020-07-07 11:05:17 +00:00
ARG PYTHON_VERSION = 3 .7
FROM pytorchlightning/pytorch_lightning:XLA-extras-py${PYTHON_VERSION}
2020-07-02 01:44:19 +00:00
# Build args.
ARG GITHUB_REF = refs/heads/master
ARG TEST_IMAGE = 0
2020-07-04 15:31:12 +00:00
# This Dockerfile installs pytorch/xla 3.7 wheels. There are also 3.6 wheels available; see below.
2020-07-02 01:44:19 +00:00
2020-07-07 11:05:17 +00:00
#SHELL ["/bin/bash", "-c"]
2020-07-02 01:44:19 +00:00
# Install pytorch-lightning at the current PR, plus dependencies.
RUN git clone https://github.com/PyTorchLightning/pytorch-lightning.git && \
cd pytorch-lightning && \
2020-07-23 16:13:10 +00:00
echo $GITHUB_REF && \
2020-07-02 01:44:19 +00:00
git fetch origin $GITHUB_REF :CI && \
git checkout CI && \
2020-07-07 11:05:17 +00:00
pip install --requirement ./requirements/base.txt --no-cache-dir
2020-07-02 01:44:19 +00:00
2020-07-04 15:31:12 +00:00
# If using this image for tests, intall more dependencies and don"t delete
2020-07-02 01:44:19 +00:00
# the source code where the tests live.
2020-07-04 15:31:12 +00:00
RUN \
# drop Horovod
2020-07-07 11:05:17 +00:00
#python -c "fname = 'pytorch-lightning/requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if not line.startswith('horovod')] ; open(fname, 'w').writelines(lines)" && \
#pip install --requirement pytorch-lightning/requirements/extra.txt --no-cache-dir && \
2020-07-04 15:31:12 +00:00
if [ $TEST_IMAGE -eq 1 ] ; then \
2020-07-07 11:05:17 +00:00
pip install --requirement pytorch-lightning/requirements/test.txt --no-cache-dir ; \
2020-07-02 01:44:19 +00:00
else \
rm -rf pytorch-lightning ; \
fi
2020-07-04 15:31:12 +00:00
#RUN python -c "import pytorch_lightning as pl; print(pl.__version__)"
2020-07-02 01:44:19 +00:00
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh" ]
CMD [ "bash" ]