8000 Corebot 101 initial checkin by daveta · Pull Request #245 · microsoft/botbuilder-python · GitHub
[go: up one dir, main page]

Skip to content

Corebot 101 initial checkin #245

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions samples/python_flask/101.corebot-bert-bidaf/Dockerfile_bot
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM tiangolo/uwsgi-nginx-flask:python3.6

# Setup for nginx
RUN mkdir -p /home/LogFiles \
&& apt update \
&& apt install -y --no-install-recommends vim

EXPOSE 3978

COPY /model /model

# Pytorch very large. Install from wheel.
RUN wget https://files.pythonhosted.org/packages/69/60/f685fb2cfb3088736bafbc9bdbb455327bdc8906b606da9c9a81bae1c81e/torch-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
RUN pip 67F4 3 install torch-1.1.0-cp36-cp36m-manylinux1_x86_64.whl

RUN pip3 install -e /model/


COPY ./bot /bot

RUN pip3 install -r /bot/requirements.txt

ENV FLASK_APP=/bot/main.py
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PATH ${PATH}:/home/site/wwwroot

WORKDIR bot
# Initialize models


# For Debugging, uncomment the following:
#ENTRYPOINT ["python3.6", "-c", "import time ; time.sleep(500000)"]
ENTRYPOINT [ "flask" ]
CMD [ "run", "--port", "3978", "--host", "0.0.0.0" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# https://github.com/tornadoweb/tornado/blob/master/demos/blog/Dockerfile
FROM python:3.6

# Port the model runtime service will listen on.
EXPOSE 8880

# Make structure where the models will live.
RUN mkdir -p /cognitiveModels/bert
RUN mkdir -p /cognitiveModels/bidaf

# Copy and install models.
COPY model /model/
#RUN pip3 install --upgrade pip
#RUN pip3 install --upgrade nltk
RUN wget https://files.pythonhosted.org/packages/69/60/f685fb2cfb3088736bafbc9bdbb455327bdc8906b606da9c9a81bae1c81e/torch-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
RUN pip3 install torch-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
RUN pip3 install -e /model

# Copy and install model runtime service api.
COPY model_runtime_svc /model_runtime_svc/
RUN pip3 install -e /model_runtime_svc

# One time initialization of the models.
RUN python3 /model_runtime_svc/model_runtime_svc_corebot101/docker_init.py
RUN rm /model_runtime_svc/model_runtime_svc_corebot101/docker_init.py

# -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')"
WORKDIR /model_runtime_svc

ENTRYPOINT ["python3", "./model_runtime_svc_corebot101/main.py"]
8 changes: 8 additions & 0 deletions samples/python_flask/101.corebot-bert-bidaf/NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## NOTICE

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.

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
[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.

Please also note that the sample depends on the `requests` package, which has a dependency `chardet` that uses LGPL license.
Loading
0