-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile-model_predict_grpc
31 lines (23 loc) · 1.24 KB
/
Dockerfile-model_predict_grpc
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
FROM python:3.9.0
# Install common tools
RUN apt-get update -y && \
apt-get install -y nano vim-tiny less curl unzip
# Add container content
ADD Container-Root/src/python/lib /src/python/lib
ADD Container-Root/src/python/technique/model_predict_grpc /src/python/technique/model_predict_grpc
ADD Container-Root/src/python/technique/model_sensitivity_grpc /src/python/technique/model_sensitivity_grpc
COPY Container-Root/src/python/technique/model_serve_grpc/torch_client.py /src/python/technique/model_serve_grpc/torch_client.py
# Install Python Libraries
RUN pip install --upgrade pip
RUN pip install -r /src/python/technique/model_predict_grpc/requirements.txt -U
# Configure container
ENV PYTHONPATH="/src/python:/app:${PYTHONPATH}"
RUN sed -i /etc/vim/vimrc.tiny -e 's/set compatible/set nocompatible/g'
RUN echo "alias ll='ls -alh --color=auto'" >> /root/.bashrc
RUN mkdir -p /wd /app/grpc_compiled
ENV PYDEVD_WARN_EVALUATION_TIMEOUT=36000
# Compile the Protobuf object
COPY Container-Root/src/python/technique/model_serve_grpc/model_interface.proto /app/model_interface.proto
RUN python3 -m grpc_tools.protoc -I. --proto_path=/app --python_out=/app/grpc_compiled --grpc_python_out=/app/grpc_compiled model_interface.proto
# Set work directory
WORKDIR /