-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
97 lines (76 loc) · 3.34 KB
/
Copy pathDockerfile
File metadata and controls
97 lines (76 loc) · 3.34 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
wget sudo git make gcc g++ python3.11 python3.11-dev python3-pip\
&&update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1\
&&wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb\
&&python3 -m pip install numpy h5py flask pandas graphistry tqdm scipy\
&&sudo dpkg -i cuda-keyring_1.1-1_all.deb\
&&apt-get update && apt-get install -y cuda
WORKDIR /home/liy/packages
RUN git config --global user.name "yanggaoli"\
&&git config --global user.email "yang98913745@163.com"\
&&git clone https://github.com/pybind/pybind11.git
RUN mv /usr/local/cuda-12.* /home/liy/packages/cuda-12.2\
&&rm -rf /usr/local/cuda*
ENV PATH="/home/liy/packages/cuda-12.2/bin:${PATH}"
ENV LD_LIBRARY_PATH="/home/liy/packages/cuda-12.2/lib64:${LD_LIBRARY_PATH}"
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
WORKDIR /home/liy/
RUN git clone https://github.com/yangaoli/a_elsa.git
RUN cp -r ./a_elsa/elsa ./&&rm -rf a_elsa
WORKDIR /home/liy/elsa/pybind_compcore/
RUN g++ -std=c++14 -fPIC -shared \
./*.cpp \
-I /usr/include/python3.11 \
-L /usr/lib/python3.11 \
-lpython3.11 \
-I/home/liy/packages/pybind11/include \
-O3 -o ../lsa/compcore.so
WORKDIR /home/liy/elsa/
RUN python3 setup.py build
RUN python3 -m pip install .
WORKDIR /home/liy/elsa/lsa/py_server/
RUN apt-get clean
CMD ["python3", "py_NET.py"]
# FROM ubuntu:latest
# ENV DEBIAN_FRONTEND=noninteractive
# RUN apt-get update && apt-get install -y \
# wget sudo git make gcc g++ python3.11 python3.11-dev python3-pip\
# &&sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1\
# &&sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2\
# &&python3 -m pip install numpy h5py flask pandas graphistry tqdm scipy\
# &&wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb\
# &&sudo dpkg -i cuda-keyring_1.1-1_all.deb\
# &&apt-get update && apt-get install -y cuda
# WORKDIR /home/liy/packages
# RUN git config --global user.name "yanggaoli"\
# &&git config --global user.email "yang98913745@163.com"\
# &&git clone https://github.com/pybind/pybind11.git\
# &&mv /usr/local/cuda-12.* /home/liy/packages/cuda-12.2\
# &&rm -rf /usr/local/cuda*
# ENV PATH="/home/liy/packages/cuda-12.2/bin:${PATH}"
# ENV LD_LIBRARY_PATH="/home/liy/packages/cuda-12.2/lib64:${LD_LIBRARY_PATH}"
# WORKDIR /home/liy/
# COPY elsa /home/liy/elsa
# WORKDIR /home/liy/elsa/pybind_compcore/
# RUN g++ -std=c++14 -fPIC -shared \
# ./*.cpp \
# -I /usr/include/python3.11 \
# -L /usr/lib/python3.11 \
# -lpython3.11 \
# -I/home/liy/packages/pybind11/include \
# -O3 -o ../lsa/compcore.so
# WORKDIR /home/liy/elsa/
# RUN python3 setup.py build\
# &&python3 setup.py install\
# &&apt-get clean
# WORKDIR /home/liy/elsa/lsa/py_server/
# CMD ["python3", "py_NET.py"]
# docker container prune -f&&docker rmi -f $(docker images -q)
# docker build -t elsa_server:2.0 .
# docker login
# docker tag elsa_server:2.0 bingwujiayin/elsa_server:2.0
# docker push bingwujiayin/elsa_server:2.0
# docker run -p 5002:5002 --gpus all -it elsa_server:2.0
# docker run --gpus all -it --name my-ubuntu-container elsa_server:1.0