-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
47 lines (34 loc) · 1.41 KB
/
Dockerfile
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
#syntax=docker/dockerfile:1.1.5-experimental
ARG TF_VERSION
ARG PY_VERSION
FROM tensorflow/build:latest-python$PY_VERSION as base_install
ENV TF_NEED_CUDA="1"
ENV DOCKER_BUILD="1"
# https://github.com/tensorflow/build/issues/78
RUN python -m pip uninstall -y keras-nightly
COPY ./ /tfmiss
WORKDIR /tfmiss
RUN python -m pip install -r requirements.txt
# -------------------------------------------------------------------
FROM base_install as make_wheel
RUN python configure.py
#RUN bazel test --test_output=errors //tfmiss/...
RUN bazel build --jobs=4 \
--noshow_progress \
--noshow_loading_progress \
--verbose_failures \
--test_output=errors \
--crosstool_top=//third_party/gcc_manylinux2014-nvcc-cuda:toolchain build_pip_pkg && \
# Package Whl
bazel-bin/build_pip_pkg artifacts
RUN bash auditwheel_patch.sh
RUN python -m auditwheel repair --plat manylinux2014_x86_64 artifacts/*.whl
RUN ls -al wheelhouse/
# -------------------------------------------------------------------
FROM python:$PY_VERSION as test_wheel_in_fresh_environment
COPY --from=make_wheel /tfmiss/wheelhouse/ /tfmiss/wheelhouse/
RUN pip install /tfmiss/wheelhouse/*.whl
RUN python -c "import tfmiss as tfm;print(tfm.text.zero_digits('123').numpy())"
# -------------------------------------------------------------------
FROM scratch as output
COPY --from=test_wheel_in_fresh_environment /tfmiss/wheelhouse/ .