Skip to content
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

Skill Templates & Deployments #173

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
docker files for skill template container
  • Loading branch information
timbmg committed May 5, 2022
commit c465754714aa7092b265a99fd4b9a7ca17ea8795
1 change: 1 addition & 0 deletions skill-manager/requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ python-keycloak>=0.26.1
pytest-env>=0.6.2
pyjwt>=2.3.0
pytest-asyncio>=0.18.2
dill>=0.3.4
23 changes: 23 additions & 0 deletions skill-manager/skill_manager/skill-template-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.7.6-slim-buster

ARG skill_template_pickle

ENV PYTHONUNBUFFERED 1

RUN apt-get -y update
RUN apt-get -y install git

WORKDIR /app

RUN pip install --upgrade pip
COPY requirements.txt ./
RUN pip install -r requirements.txt

COPY main.py main.py
COPY logging.conf logging.conf

COPY ${skill_template_pickle} skill_template.pickle

EXPOSE 80

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80", "--log-config", "logging.conf"]
21 changes: 21 additions & 0 deletions skill-manager/skill_manager/skill-template-docker/logging.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[loggers]
keys = root

[logger_root]
level = DEBUG
handlers = root

[handlers]
keys = root

[handler_root]
class = StreamHandler
level = DEBUG
formatter = json

[formatters]
keys = json

[formatter_json]
class = elk_json_formatter.ElkJsonFormatter

7 changes: 7 additions & 0 deletions skill-manager/skill_manager/skill-template-docker/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import dill as pickle
from square_skill_api import get_app

with open("skill_template.pickle", "rb") as fn:
predict = pickle.load(fn)

app = get_app(predict_fn=predict)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
git+https://github.com/UKP-SQuARE/elk-json-formatter.git@v0.0.2
git+https://github.com/UKP-SQuARE/square-skill-helpers.git@v0.0.6
git+https://github.com/UKP-SQuARE/square-skill-api.git@v0.0.18
dill