docker: fix folder names (#19200)

This commit is contained in:
Jirka Borovec 2023-12-21 17:41:49 +01:00 committed by GitHub
parent 59d2600acb
commit b43580f01c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 18 deletions

View File

@ -23,30 +23,30 @@ ARG LIGHTNING_VERSION=""
RUN python -c "import torch ; print(torch.__version__)" >> torch_version.info
COPY ./ /workspace/lightning/
COPY ./ /workspace/pytorch-lightning/
RUN \
cd /workspace && \
# replace by specific version if asked
if [ ! -z "$LIGHTNING_VERSION" ] ; then \
rm -rf lightning ; \
git clone https://github.com/Lightning-AI/lightning.git ; \
cd lightning ; \
rm -rf pytorch-lightning ; \
git clone https://github.com/Lightning-AI/pytorch-lightning.git ; \
cd pytorch-lightning ; \
git checkout ${LIGHTNING_VERSION} ; \
git submodule update --init --recursive ; \
cd .. ; \
fi && \
# save the examples \
ls -lh lightning/ && \
rm -rf lightning/.git && \
rm -rf lightning/_notebooks/.git && \
mv lightning/_notebooks/.notebooks/ notebooks && \
cp -r lightning/*examples . && \
ls -lh pytorch-lightning/ && \
rm -rf pytorch-lightning/.git && \
rm -rf pytorch-lightning/_notebooks/.git && \
mv pytorch-lightning/_notebooks/.notebooks/ notebooks && \
cp -r pytorch-lightning/*examples . && \
# Installations \
pip install "Pillow>=8.2, !=8.3.0" "cryptography>=3.4" "py>=1.10" --no-cache-dir && \
PACKAGE_NAME=pytorch pip install './lightning[extra,loggers,strategies]' --no-cache-dir && \
rm -rf lightning && \
rm -rf pytorch-lightning && \
pip list
RUN pip install jupyterlab[all] -U --no-cache-dir

View File

@ -22,28 +22,28 @@ LABEL maintainer="Lightning-AI <https://github.com/Lightning-AI>"
ARG LIGHTNING_VERSION=""
COPY ./ /home/lightning/
COPY ./ /home/pytorch-lightning/
# install dependencies
RUN \
cd /home && \
mv lightning/_notebooks notebooks && \
mv lightning/examples . && \
mv pytorch-lightning/_notebooks notebooks && \
mv pytorch-lightning/examples . && \
# replace by specific version if asked
if [ ! -z "$LIGHTNING_VERSION" ] ; then \
rm -rf lightning ; \
wget https://github.com/Lightning-AI/lightning/archive/${LIGHTNING_VERSION}.zip --progress=bar:force:noscroll ; \
rm -rf pytorch-lightning ; \
wget https://github.com/Lightning-AI/pytorch-lightning/archive/${LIGHTNING_VERSION}.zip --progress=bar:force:noscroll ; \
unzip ${LIGHTNING_VERSION}.zip ; \
mv lightning-*/ lightning ; \
mv pytorch-lightning-*/ pytorch-lightning ; \
rm *.zip ; \
fi && \
# otherwise there is collision with folder name and pkg name on Pypi
cd lightning && \
cd pytorch-lightning && \
pip install setuptools==59.5.0 && \
PACKAGE_NAME=lightning pip install '.[extra,loggers,strategies]' --no-cache-dir && \
PACKAGE_NAME=pytorch pip install '.[extra,loggers,strategies]' --no-cache-dir && \
cd .. && \
rm -rf lightning
rm -rf pytorch-lightning
RUN python --version && \
pip --version && \