8000 Merge pull request #245 from microsoft/daveta-core101 · jwiley84/botbuilder-python@34988a8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 34988a8

Browse files
authored
Merge pull request microsoft#245 from microsoft/daveta-core101
Corebot 101 initial checkin
2 parents 273fc0c + e16988f commit 34988a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3829
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM tiangolo/uwsgi-nginx-flask:python3.6
2+
3+
# Setup for nginx
4+
RUN mkdir -p /home/LogFiles \
5+
&& apt update \
6+
&& apt install -y --no-install-recommends vim
7+
8+
EXPOSE 3978
9+
10+
COPY /model /model
11+
12+
# Pytorch very large. Install from wheel.
13+
RUN wget https://files.pythonhosted.org/packages/69/60/f685fb2cfb3088736bafbc9bdbb455327bdc8906b606da9c9a81bae1c81e/torch-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
14+
RUN pip3 install torch-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
15+
16+
RUN pip3 install -e /model/
17+
18+
19+
COPY ./bot /bot
20+
21+
RUN pip3 install -r /bot/requirements.txt
22+
23+
ENV FLASK_APP=/bot/main.py
24+
ENV LANG=C.UTF-8
25+
ENV LC_ALL=C.UTF-8
26+
ENV PATH ${PATH}:/home/site/wwwroot
27+
28+
WORKDIR bot
29+
# Initialize models
30+
31+
32+
# For Debugging, uncomment the following:
33+
#ENTRYPOINT ["python3.6", "-c", "import time ; time.sleep(500000)"]
34+
ENTRYPOINT [ "flask" ]
35+
CMD [ "run", "--port", "3978", "--host", "0.0.0.0" ]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# https://github.com/tornadoweb/tornado/blob/master/demos/blog/Dockerfile
2+
FROM python:3.6
3+
4+
# Port the model runtime service will listen on.
5+
EXPOSE 8880
6+
7+
# Make structure where the models will live.
8+
RUN mkdir -p /cognitiveModels/bert
9+
RUN mkdir -p /cognitiveModels/bidaf
10+
11+
# Copy and install models.
12+
COPY model /model/
13+
#RUN pip3 install --upgrade pip
14+
#RUN pip3 install --upgrade nltk
15+
RUN wget https://files.pythonhosted.org/packages/69/60/f685fb2cfb3088736bafbc9bdbb455327bdc8906b606da9c9a81bae1c81e/torch-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
16+
RUN pip3 install torch-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
17+
RUN pip3 install -e /model
18+
19+
# Copy and install model runtime service api.
20+
COPY model_runtime_svc /model_runtime_svc/
21+
RUN pip3 install -e /model_runtime_svc
22+
23+
# One time initialization of the models.
24+
RUN python3 /model_runtime_svc/model_runtime_svc_corebot101/docker_init.py
25+
RUN rm /model_runtime_svc/model_runtime_svc_corebot101/docker_init.py
26+
27+
# -c "from model_corebot101.language_helper import LanguageHelper; lh = LanguageHelper(). lh.initialize_models(bert_model_dir='/model_runtime_api/model/bert', bidaf_model_dir='/model_runtime_api/model/bidaf')"
28+
WORKDIR /model_runtime_svc
29+
30+
ENTRYPOINT ["python3", "./model_runtime_svc_corebot101/main.py"]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## NOTICE
2+
3+
Please note that while the 101.corebot-bert-bidaf sample is licensed under the MIT license, the sample has dependencies that use other types of licenses.
4+
5+
Since Microsoft does not modify nor distribute these dependencies, it is the sole responsibility of the user to determine the correct/compliant usage of these dependencies. Please refer to the
6+
[bot requirements](./bot/requirements.txt), [model requirements](./model/setup.py) and [model runtime requirements](./model_runtime_svc/setup.py) for a list of the **direct** dependencies.
7+
8+
Please also note that the sample depends on the `requests` package, which has a dependency `chardet` that uses LGPL license.

0 commit comments

Comments
 (0)
0