-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (58 loc) · 2.1 KB
/
Dockerfile
File metadata and controls
73 lines (58 loc) · 2.1 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
FROM debian:buster-slim as buildstage
# Install dependencies
RUN apt-get update && \
apt-get install -y git pkg-config && \
apt-get -y --no-install-recommends install wget make git gcc g++ libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev -o APT::Install-Suggests=0 -o APT::Install-Recommends=0
# Install cmake 3.15 for cmake requirement of 3.15 or higher in HiGHS
RUN wget https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-linux-x86_64.sh && \
chmod +x cmake-3.23.2-linux-x86_64.sh &&\
./cmake-3.23.2-linux-x86_64.sh --skip-license
# Build HiGhs-backend
RUN git clone https://github.com/ERGO-Code/HiGHS.git && \
cd HiGHS && \
mkdir build
RUN cd /HiGHS/build && \
cmake -DCMAKE_INSTALL_PREFIX=/HiGHS/highs_install .. && \
cmake --build . --parallel 4 --config Release && \
cmake --install .
ENV LD_LIBRARY_PATH=/HiGHS/highs_install/lib
ENV DYLD_LIBRARY_PATH=/HiGHS/highs_install/lib
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.7 \
python3-pip \
python3-venv \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN python3 -m venv /opt/venv
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
RUN pip3 install --no-cache-dir /HiGHS/src/interfaces/highspy/
WORKDIR /HiGHS/build/bin
COPY test.py .
RUN ./highs --help
RUN python3 test.py
FROM debian:buster-slim as runstage
# Copy HiGHS binaries from `buildstage`
COPY --from=buildstage /HiGHS /HiGHS
COPY --from=buildstage /opt/venv /opt/venv
ENV LD_LIBRARY_PATH=/HiGHS/highs_install/lib
ENV DYLD_LIBRARY_PATH=/HiGHS/highs_install/lib
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.7 \
python3-pip \
python3-venv \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /HiGHS/build/bin
COPY ml.mps .
RUN ./highs ml.mps
COPY test.py .
RUN python3 test.py
CMD [ "python3", "test.py" ]