Skip to content

Commit b06f9b7

Browse files
authored
Improve building times of IPU docker image (#14934)
1 parent 7ff297b commit b06f9b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dockers/base-ipu/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ LABEL maintainer="Lightning-AI <https://github.com/Lightning-AI>"
1818

1919
ARG PYTHON_VERSION=3.9
2020
ARG CONDA_VERSION=4.9.2
21+
ARG PYTORCH_VERSION=1.9
2122

2223
SHELL ["/bin/bash", "-c"]
2324

@@ -56,13 +57,12 @@ ENV \
5657

5758
COPY environment.yml environment.yml
5859

59-
RUN conda create -y --name $CONDA_ENV python=${PYTHON_VERSION} pytorch=${PYTORCH_VERSION} cudatoolkit=${CUDA_VERSION} -c pytorch && \
60-
conda init bash && \
60+
RUN conda init bash && \
6161
python -c "import re ; fname = 'environment.yml' ; req = re.sub(r'python>=[\d\.]+', 'python=${PYTHON_VERSION}', open(fname).read()) ; open(fname, 'w').write(req)" && \
62-
python -c "import re ; fname = 'environment.yml' ; req = re.sub(r'- pytorch[>=]+[\d\.]+', '# - pytorch=${PYTORCH_VERSION}', open(fname).read()) ; open(fname, 'w').write(req)" && \
62+
python -c "import re ; fname = 'environment.yml' ; req = re.sub(r'- pytorch[>=]+[\d\.]+', '- pytorch=${PYTORCH_VERSION}', open(fname).read()) ; open(fname, 'w').write(req)" && \
6363
python -c "fname = 'environment.yml' ; req = open(fname).readlines() ; open(fname, 'w').writelines([ln for ln in req if not any(n in ln for n in ['pytorch>', 'horovod'])])" && \
6464
cat environment.yml && \
65-
conda env update --file environment.yml && \
65+
conda env create -f environment.yml && \
6666
conda clean -ya && \
6767
rm environment.yml
6868

0 commit comments

Comments
 (0)