forked from IRT-SystemX/LIPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_conda
53 lines (39 loc) · 1.21 KB
/
Dockerfile_conda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# start with pytorch image
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel
# RUN rm /bin/sh && ln -s /bin/bash /bin/sh
ENV DEBIAN_FRONTEND noninteractive
# generic install
RUN apt-get update && \
apt-get install -y \
python3.8 python3.8-dev python3-pip\
gfortran \
less \
apt-transport-https \
git\
ssh \
tar
# Create and activate conda environment
RUN conda create python=3.8 --name lips
SHELL ["conda", "run", "-n", "lips", "/bin/bash", "-c"]
# Install LIPS package and dependencies
# Only copy needed elements
COPY setup.* /LIPS/.
COPY requirements* /LIPS/.
COPY MANIFEST.in /LIPS/.
COPY LICENSE /LIPS/.
COPY README.md /LIPS/.
COPY configurations /LIPS/.
COPY lips /LIPS/lips
WORKDIR /LIPS
RUN pip install -U --no-cache-dir .[codabench]
RUN mkdir /opt/conda/envs/lips/lib/python3.8/site-packages/lips/config/benchmarks
COPY configurations/powergrid/benchmarks/*.ini /opt/conda/envs/lips/lib/python3.8/site-packages/lips/config/benchmarks/.
## check python version
RUN python --version
## activate conda env
RUN echo "source activate lips" > ~/.bashrc
ENV PATH /opt/conda/envs/lips/bin:$PATH
ENV LIPS_HOME=/LIPS
WORKDIR /
# Env variables for CUDA / GPUs
ENV NVIDIA_VISIBLE_DEVICES=all