-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
69 lines (57 loc) · 2.51 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
ARG COMMON_IMAGE=
FROM ${COMMON_IMAGE}
MAINTAINER Thingpedia Admins <[email protected]>
RUN pip3 install -U pip
WORKDIR /opt/genienlp/
ARG GENIENLP_VERSION=master
RUN pip3 uninstall bootleg dialogues -y
RUN git fetch && git checkout ${GENIENLP_VERSION} && pip3 install -e .
RUN python3 -m spacy download en_core_web_sm
# for occasional plotting in genienlp
RUN pip3 install matplotlib~=3.0 seaborn~=0.9
ARG ADD_APEX=
RUN echo ${ADD_APEX}
RUN if [ ${ADD_APEX} == true ]; then \
yum install -y \
cuda-nvml-dev-$CUDA_PKG_VERSION \
cuda-command-line-tools-$CUDA_PKG_VERSION \
cuda-libraries-dev-$CUDA_PKG_VERSION \
cuda-minimal-build-$CUDA_PKG_VERSION \
libcublas-devel-10.2.2.89-1 \
&& \
rm -rf /var/cache/yum/* ; \
git clone https://github.com/NVIDIA/apex /opt/apex/ ; \
cd /opt/apex/ ; \
pip3 install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ ; \
fi
# add user genie-toolkit
RUN useradd -ms /bin/bash genie-toolkit
RUN mkdir /opt/genie-toolkit/ && chown genie-toolkit:genie-toolkit /opt/genie-toolkit
# npm *really* does not like running as root, and will misbehave badly when
# run as root, so we run it as a separate user
USER genie-toolkit
ARG GENIE_VERSION=master
USER genie-toolkit
RUN git clone https://github.com/stanford-oval/genie-toolkit /opt/genie-toolkit/
WORKDIR /opt/genie-toolkit/
RUN git checkout ${GENIE_VERSION}
RUN npm ci
USER root
# normally, this would be done by npm link, but when running as root, npm
# link will mess up everything because it will rerun "npm install", which
# will undo the build step we just did, so we open-code npm link ourselves
RUN rm -f /usr/local/bin/genie && \
rm -f /usr/local/lib/node_modules/genie-toolkit && \
ln -s /opt/genie-toolkit /usr/local/lib/node_modules/genie-toolkit && \
ln -s /opt/genie-toolkit/dist/tool/genie.js /usr/local/bin/genie && \
chmod +x /usr/local/bin/genie
RUN dnf -y install rsync wget
RUN git clone https://github.com/auristor/keyutils.git ; cd keyutils ; make ; make install
RUN wget https://aka.ms/downloadazcopy-v10-linux ; tar -xvf downloadazcopy-v10-linux ; cp ./azcopy_linux_amd64_*/azcopy /usr/bin/
USER genie-toolkit
COPY lib.sh sync-repos.sh ./
# Use root for now until https://github.com/aws/amazon-eks-pod-identity-webhook/issues/8 is fixed.
# There is a workaround by changing pod fsgroup but kubeflow does not provide to api to modify pod securityContext.
USER root
RUN chown genie-toolkit:genie-toolkit /opt/genie-toolkit/sync-repos.sh
WORKDIR /home/genie-toolkit