2020-10-02 09:26:21 +00:00
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2020-07-07 11:05:17 +00:00
ARG PYTHON_VERSION = 3 .7
2020-09-30 12:36:02 +00:00
ARG PYTORCH_VERSION = 1 .6
2020-07-07 11:05:17 +00:00
2020-09-30 12:36:02 +00:00
FROM pytorchlightning/pytorch_lightning:base-xla-py${PYTHON_VERSION}-torch${PYTORCH_VERSION}
2020-07-02 01:44:19 +00:00
2020-10-26 10:47:09 +00:00
MAINTAINER PyTorchLightning <https://github.com/PyTorchLightning>
2020-07-07 11:05:17 +00:00
#SHELL ["/bin/bash", "-c"]
2020-07-02 01:44:19 +00:00
2020-09-30 12:36:02 +00:00
COPY ./ ./pytorch-lightning/
2020-07-02 01:44:19 +00:00
2021-01-08 15:36:49 +00:00
# Pull the legacy checkpoints
RUN cd pytorch-lightning && \
wget https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip -P legacy/ && \
unzip -o legacy/checkpoints.zip -d legacy/ && \
ls -l legacy/checkpoints/
2020-09-30 12:36:02 +00:00
# If using this image for tests, intall more dependencies and don"t delete the source code where the tests live.
2020-07-04 15:31:12 +00:00
RUN \
2020-09-30 12:36:02 +00:00
# Install pytorch-lightning at the current PR, plus dependencies.
2020-10-18 18:40:18 +00:00
#pip install -r pytorch-lightning/requirements.txt --no-cache-dir && \
2020-12-17 07:27:05 +00:00
# drop Horovod as it is not needed
2020-11-13 10:33:52 +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)" && \
2020-12-17 07:27:05 +00:00
# drop fairscale as it is not needed
python -c "fname = 'pytorch-lightning/requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if 'fairscale' not in line] ; open(fname, 'w').writelines(lines)" && \
2021-01-25 22:10:56 +00:00
pip install -r pytorch-lightning/requirements/devel.txt --no-cache-dir
2020-07-02 01:44:19 +00:00
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
2020-09-30 12:36:02 +00:00
COPY ./dockers/tpu-tests/docker-entrypoint.sh /usr/local/bin/
2020-07-02 01:44:19 +00:00
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh" ]
CMD [ "bash" ]