2020-10-02 09:26:21 +00:00
|
|
|
# Copyright The Lightning AI 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.
|
|
|
|
|
2021-11-04 17:26:24 +00:00
|
|
|
ARG PYTHON_VERSION=3.9
|
2023-10-04 18:30:44 +00:00
|
|
|
ARG PYTORCH_VERSION=1.12
|
2022-08-10 10:37:50 +00:00
|
|
|
ARG CUDA_VERSION=11.3.1
|
2020-08-15 19:39:44 +00:00
|
|
|
|
2022-08-10 10:37:50 +00:00
|
|
|
FROM pytorchlightning/pytorch_lightning:base-cuda-py${PYTHON_VERSION}-torch${PYTORCH_VERSION}-cuda${CUDA_VERSION}
|
2020-08-15 19:39:44 +00:00
|
|
|
|
2022-06-15 23:33:43 +00:00
|
|
|
LABEL maintainer="Lightning-AI <https://github.com/Lightning-AI>"
|
2020-10-26 10:47:09 +00:00
|
|
|
|
2020-09-24 21:14:15 +00:00
|
|
|
ARG LIGHTNING_VERSION=""
|
2020-04-25 18:17:09 +00:00
|
|
|
|
2022-06-29 17:36:36 +00:00
|
|
|
COPY ./ /home/lightning/
|
|
|
|
|
2020-04-25 18:17:09 +00:00
|
|
|
# install dependencies
|
2020-09-10 22:38:29 +00:00
|
|
|
RUN \
|
2021-03-29 08:39:06 +00:00
|
|
|
cd /home && \
|
2022-06-29 17:36:36 +00:00
|
|
|
mv lightning/_notebooks notebooks && \
|
|
|
|
mv lightning/examples . && \
|
2021-03-29 08:39:06 +00:00
|
|
|
# replace by specific version if asked
|
2021-03-06 13:34:54 +00:00
|
|
|
if [ ! -z "$LIGHTNING_VERSION" ] ; then \
|
2022-06-29 17:36:36 +00:00
|
|
|
rm -rf lightning ; \
|
2022-06-15 23:33:43 +00:00
|
|
|
wget https://github.com/Lightning-AI/lightning/archive/${LIGHTNING_VERSION}.zip --progress=bar:force:noscroll ; \
|
2021-03-06 13:34:54 +00:00
|
|
|
unzip ${LIGHTNING_VERSION}.zip ; \
|
2022-06-29 17:36:36 +00:00
|
|
|
mv lightning-*/ lightning ; \
|
2021-03-06 13:34:54 +00:00
|
|
|
rm *.zip ; \
|
|
|
|
fi && \
|
2023-09-26 15:54:44 +00:00
|
|
|
# otherwise there is collision with folder name and pkg name on Pypi
|
2022-06-29 17:36:36 +00:00
|
|
|
cd lightning && \
|
2022-12-22 06:21:52 +00:00
|
|
|
pip install setuptools==59.5.0 && \
|
2023-11-04 14:29:37 +00:00
|
|
|
PACKAGE_NAME=lightning pip install '.[extra,loggers,strategies]' --no-cache-dir && \
|
|
|
|
PACKAGE_NAME=pytorch pip install '.[extra,loggers,strategies]' --no-cache-dir && \
|
2022-06-29 17:36:36 +00:00
|
|
|
cd .. && \
|
|
|
|
rm -rf lightning
|
2020-04-25 18:17:09 +00:00
|
|
|
|
2020-08-15 19:39:44 +00:00
|
|
|
RUN python --version && \
|
|
|
|
pip --version && \
|
2020-09-22 23:41:35 +00:00
|
|
|
pip list && \
|
2022-11-12 15:36:36 +00:00
|
|
|
python -c "import pytorch_lightning as pl; print(pl.__version__)"
|
2020-09-24 21:14:15 +00:00
|
|
|
|
2020-10-26 10:47:09 +00:00
|
|
|
# CMD ["/bin/bash"]
|