-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.wheel
85 lines (73 loc) · 3.03 KB
/
Dockerfile.wheel
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
FROM quay.io/pypa/manylinux2014_x86_64 as build
ARG PYTHON_VERSION=3.7.0
ARG CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v3.16.2/cmake-3.16.2.tar.gz
ARG WHEEL_PY_VERSION=cp37-cp37m
ARG REPOSITORY_URL=https://upload.pypi.org/legacy/
RUN yum install -y vim \
wget \
make \
gcc \
gcc-c++ \
openssl \
curl \
openssl-devel \
libcurl-devel \
tree \
git \
libffi-devel
RUN wget -O cmake-3.16.2.tar.gz ${CMAKE_URL} \
&& tar xvzf cmake-3.16.2.tar.gz \
&& cd cmake-3.16.2 \
&& ./bootstrap \
&& make -j$(nproc)\
&& make install
RUN wget -O python-${PYTHON_VERSION}.tgz \
https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz \
&& tar xvzf python-${PYTHON_VERSION}.tgz \
&& cd Python-${PYTHON_VERSION} \
&& ./configure --enable-shared\
&& make -j$(nproc) \
&& make install
RUN git clone -b fix-static-zlib-target --single-branch https://github.com/Kitware/fletch.git \
&& cd /fletch \
&& mkdir -p build/release \
&& cd build/release \
&& cmake ../../ \
-Dfletch_BUILD_CXX11:BOOL=ON \
-DBUILD_SHARED_LIBS=OFF \
-Dfletch_BUILD_WITH_PYTHON=ON \
-Dfletch_PYTHON_MAJOR_VERSION=3 \
-Dfletch_ENABLE_Boost:BOOL=ON \
-Dfletch_ENABLE_Eigen:BOOL=ON \
-Dfletch_ENABLE_FFmpeg:BOOL=ON \
-Dfletch_ENABLE_OpenCV:BOOL=ON \
-DOpenCV_SELECT_VERSION:STRING=3.4.0 \
-Dfletch_ENABLE_PNG:BOOL=ON \
-Dfletch_ENABLE_Protobuf:BOOL=ON \
-DProtobuf_SELECT_VERSION:STRING=3.4.1 \
-Dfletch_ENABLE_pybind11:BOOL=ON \
-Dfletch_ENABLE_YAMLcpp:BOOL=ON \
-Dfletch_ENABLE_ZLib:BOOL=ON \
-Dfletch_ENABLE_libjpeg-turbo:BOOL=ON \
-Dfletch_ENABLE_libtiff:BOOL=ON \
-Dfletch_ENABLE_log4cplus:BOOL=ON \
-Dfletch_ENABLE_ZeroMQ:BOOL=ON \
-Dfletch_ENABLE_cppzmq:BOOL=ON \
&& make
RUN git clone -b dev/fix-skbuild --single-branch https://github.com/johnwparent/kwiver.git
RUN pip3 install --upgrade pip \
&& hash -r \
&& pip3 install --no-cache-dir scikit-build \
&& pip3 install --no-cache-dir cmake twine\
&& cd /kwiver/python \
&& python3 setup.py bdist_wheel -- -Dfletch_DIR=/fletch/build/release -DCMAKE_INSTALL_PREFIX=/kwiver/python/_skbuild/linux-x86_64-3.7/cmake-install -- -j$(nproc) \
&& tree -a
# RUN pip install auditwheel
RUN cd /kwiver/python \
&& export VERSION=$(cat VERSION) \
&& cd dist \
&& export WHEEL_PREFIX=kwiver-${VERSION}-${WHEEL_PY_VERSION} \
&& auditwheel repair --plat manylinux2014_x86_64 ${WHEEL_PREFIX}-linux_x86_64.whl -w .
# ENV TWINE_REPOSITORY_URL=${REPOSITORY_URL}
# Entrypoint for pypi upload - we need to avoid this for nightly builds
# ENTRYPOINT twine upload --repository testpypi /kwiver/python/dist/kwiver*-manylinux2014_x86_64.whl