2019-11-02 00:06:57 +00:00
|
|
|
# override this to "nvidia/cuda:10.1-runtime-ubi8" if cuda is desired
|
|
|
|
ARG BASE_IMAGE=registry.access.redhat.com/ubi8/ubi:latest
|
2019-08-30 16:54:03 +00:00
|
|
|
FROM ${BASE_IMAGE}
|
|
|
|
|
2021-02-05 20:14:59 +00:00
|
|
|
ARG USER=genienlp
|
|
|
|
|
2019-08-30 16:54:03 +00:00
|
|
|
MAINTAINER Thingpedia Admins <thingpedia-admins@lists.stanford.edu>
|
|
|
|
|
2019-12-15 01:18:27 +00:00
|
|
|
USER root
|
|
|
|
|
2021-02-05 01:35:29 +00:00
|
|
|
|
2019-12-15 01:18:27 +00:00
|
|
|
# copy source
|
2020-01-29 02:04:25 +00:00
|
|
|
COPY . /opt/genienlp
|
2019-12-15 01:18:27 +00:00
|
|
|
|
|
|
|
# install basic tools and python3, install dependencies, and then cleanup
|
2020-03-27 22:55:33 +00:00
|
|
|
# HACK: we need to download the wheel manually or docker will die
|
2020-12-30 17:45:23 +00:00
|
|
|
RUN dnf -y install git gcc gcc-c++ make cmake && \
|
|
|
|
dnf -y module enable python38 \
|
|
|
|
&& dnf -y install python38 \
|
|
|
|
python38-devel \
|
|
|
|
python38-pip \
|
|
|
|
python38-wheel \
|
|
|
|
&& curl -sL https://files.pythonhosted.org/packages/1d/a9/f349273a0327fdf20a73188c9c3aa7dbce68f86fad422eadd366fd2ed7a0/torch-1.7.1-cp38-cp38-manylinux1_x86_64.whl \
|
|
|
|
-o torch-1.7.1-cp38-cp38-manylinux1_x86_64.whl \
|
|
|
|
&& pip3 install torch-1.7.1-cp38-cp38-manylinux1_x86_64.whl \
|
|
|
|
&& rm -fr torch-1.7.1-cp38-cp38-manylinux1_x86_64.whl \
|
2021-01-15 23:42:12 +00:00
|
|
|
&& pip3 install kfserving \
|
2021-02-05 20:14:59 +00:00
|
|
|
&& pip3 install awscli \
|
2020-01-29 02:04:25 +00:00
|
|
|
&& pip3 install -e /opt/genienlp \
|
2019-12-15 01:18:27 +00:00
|
|
|
&& rm -fr /root/.cache \
|
2020-12-16 08:04:26 +00:00
|
|
|
&& dnf -y remove gcc gcc-c++ make cmake \
|
2019-11-02 00:06:57 +00:00
|
|
|
&& rm -fr /var/cache/dnf
|
2019-08-30 16:54:03 +00:00
|
|
|
|
2021-02-05 01:35:29 +00:00
|
|
|
RUN git clone https://github.com/Mehrad0711/bootleg.git /opt/bootleg/ ; \
|
|
|
|
cd /opt/bootleg/ ; \
|
|
|
|
git checkout ${BOOTLEG_VERSION} && pip3 install -r requirements.txt && pip3 install -e . ; \
|
|
|
|
python3 -m spacy download en_core_web_sm
|
|
|
|
|
2020-01-29 02:04:25 +00:00
|
|
|
# add user genienlp
|
|
|
|
RUN useradd -ms /bin/bash -r genienlp
|
2021-02-05 20:14:59 +00:00
|
|
|
|
|
|
|
# User root is required for kfserving until https://github.com/aws/amazon-eks-pod-identity-webhook/issues/8 is fixed.
|
|
|
|
# There is a workaround by changing pod fsgroup but kfserving inference service cannot set pod level security context.
|
|
|
|
USER ${USER}
|
|
|
|
|
2020-01-29 02:04:25 +00:00
|
|
|
WORKDIR /home/genienlp
|
2021-02-05 20:14:59 +00:00
|
|
|
ENTRYPOINT ["/opt/genienlp/dockerfiles/start.sh"]
|