Skip to content

Commit e0bcf33

Browse files
committed
Initial commit
0 parents  commit e0bcf33

File tree

167 files changed

+12849
-0
lines changed

Some content is hidden

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

167 files changed

+12849
-0
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
omit = tests/*

.drone.yml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
kind: pipeline
2+
type: docker
3+
name: amd64
4+
5+
platform:
6+
arch: amd64
7+
8+
steps:
9+
- name: submodules
10+
image: alpine/git
11+
commands:
12+
- git submodule init
13+
- 'git config --global url."https://github.com/".insteadOf [email protected]:'
14+
- "git submodule update --recursive --remote"
15+
- name: build and publish
16+
image: plugins/docker
17+
settings:
18+
registry: registry.dev.onetask.ai
19+
username:
20+
from_secret: docker_username
21+
password:
22+
from_secret: docker_password
23+
repo: "registry.dev.onetask.ai/${DRONE_REPO}"
24+
tags: ["${DRONE_COMMIT_SHA}", "${DRONE_COMMIT_BRANCH}"]
25+
cache_from:
26+
- "registry.dev.onetask.ai/${DRONE_REPO}:dev"
27+
- "registry.dev.onetask.ai/${DRONE_REPO}:${DRONE_COMMIT_BRANCH}"
28+
- name: trigger update
29+
image: appleboy/drone-ssh
30+
failure: ignore
31+
settings:
32+
host: app.dev.onetask.ai
33+
username:
34+
from_secret: ssh_user
35+
key:
36+
from_secret: ssh_key
37+
ssh_passphrase:
38+
from_secret: ssh_passphrase
39+
script:
40+
- /bin/sh ./trigger_dev_deployment.sh
41+
42+
trigger:
43+
event:
44+
- push
45+
46+
image_pull_secrets:
47+
- dockerconfigjson
48+
49+
---
50+
kind: pipeline
51+
type: docker
52+
name: arm64
53+
54+
platform:
55+
arch: arm64
56+
57+
steps:
58+
- name: submodules
59+
image: alpine/git
60+
commands:
61+
- git submodule init
62+
- 'git config --global url."https://github.com/".insteadOf [email protected]:'
63+
- "git submodule update --recursive --remote"
64+
- name: build and publish
65+
image: plugins/docker
66+
settings:
67+
registry: registry.dev.onetask.ai
68+
username:
69+
from_secret: docker_username
70+
password:
71+
from_secret: docker_password
72+
repo: "registry.dev.onetask.ai/${DRONE_REPO}"
73+
tags: ["${DRONE_COMMIT_SHA}_arm64", "${DRONE_COMMIT_BRANCH}_arm64"]
74+
cache_from:
75+
- "registry.dev.onetask.ai/${DRONE_REPO}:dev_arm64"
76+
- "registry.dev.onetask.ai/${DRONE_REPO}:${DRONE_COMMIT_BRANCH}_arm64"
77+
78+
trigger:
79+
branch:
80+
- dev
81+
- beta-v2
82+
event:
83+
- push
84+
85+
image_pull_secrets:
86+
- dockerconfigjson
87+
88+
---
89+
kind: pipeline
90+
type: docker
91+
name: amd64-dockerhub
92+
93+
platform:
94+
arch: amd64
95+
96+
steps:
97+
- name: submodules
98+
image: alpine/git
99+
commands:
100+
- git submodule init
101+
- 'git config --global url."https://github.com/".insteadOf [email protected]:'
102+
- "git submodule update --recursive --remote"
103+
- name: build and publish
104+
image: plugins/docker
105+
settings:
106+
username:
107+
from_secret: dockerhub_username
108+
password:
109+
from_secret: dockerhub_password
110+
repo: "kernai/${DRONE_REPO_NAME}"
111+
tag: "${DRONE_TAG}-drone-amd64"
112+
113+
trigger:
114+
event:
115+
- tag
116+
117+
---
118+
kind: pipeline
119+
type: docker
120+
name: arm64-dockerhub
121+
122+
platform:
123+
arch: arm64
124+
125+
steps:
126+
- name: submodules
127+
image: alpine/git
128+
commands:
129+
- git submodule init
130+
- 'git config --global url."https://github.com/".insteadOf [email protected]:'
131+
- "git submodule update --recursive --remote"
132+
- name: build and publish
133+
image: plugins/docker
134+
settings:
135+
username:
136+
from_secret: dockerhub_username
137+
password:
138+
from_secret: dockerhub_password
139+
repo: "kernai/${DRONE_REPO_NAME}"
140+
tag: "${DRONE_TAG}-drone-arm64"
141+
142+
trigger:
143+
event:
144+
- tag
145+
146+
---
147+
kind: pipeline
148+
name: manifest-version
149+
steps:
150+
- name: manifest
151+
image: plugins/manifest
152+
settings:
153+
spec: drone-manifest-version.tmpl
154+
tag: "${DRONE_TAG}"
155+
ignore_missing: true
156+
username:
157+
from_secret: dockerhub_username
158+
password:
159+
from_secret: dockerhub_password
160+
161+
depends_on:
162+
- amd64-dockerhub
163+
- arm64-dockerhub
164+
165+
trigger:
166+
event:
167+
- tag
168+
169+
---
170+
kind: pipeline
171+
name: manifest-latest
172+
steps:
173+
- name: manifest
174+
image: plugins/manifest
175+
settings:
176+
spec: drone-manifest-latest.tmpl
177+
tag: "${DRONE_TAG}"
178+
ignore_missing: true
179+
username:
180+
from_secret: dockerhub_username
181+
password:
182+
from_secret: dockerhub_password
183+
184+
depends_on:
185+
- manifest-version
186+
187+
trigger:
188+
event:
189+
- tag

.gitignore

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
.DS_Store
2+
.idea
3+
tmpfile.
4+
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
10+
.vscode/
11+
12+
# C extensions
13+
*.so
14+
15+
# Distribution / packaging
16+
.Python
17+
build/
18+
develop-eggs/
19+
dist/
20+
downloads/
21+
eggs/
22+
.eggs/
23+
lib/
24+
lib64/
25+
parts/
26+
sdist/
27+
var/
28+
wheels/
29+
pip-wheel-metadata/
30+
share/python-wheels/
31+
*.egg-info/
32+
.installed.cfg
33+
*.egg
34+
MANIFEST
35+
36+
# PyInstaller
37+
# Usually these files are written by a python script from a template
38+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
39+
*.manifest
40+
*.spec
41+
42+
# Installer logs
43+
pip-log.txt
44+
pip-delete-this-directory.txt
45+
46+
# Unit test / coverage reports
47+
htmlcov/
48+
.tox/
49+
.nox/
50+
.coverage
51+
.coverage.*
52+
.cache
53+
nosetests.xml
54+
coverage.xml
55+
*.cover
56+
*.py,cover
57+
.hypothesis/
58+
.pytest_cache/
59+
60+
# Translations
61+
*.mo
62+
*.pot
63+
64+
# Django stuff:
65+
*.log
66+
local_settings.py
67+
db.sqlite3
68+
db.sqlite3-journal
69+
70+
# Flask stuff:
71+
instance/
72+
.webassets-cache
73+
74+
# Scrapy stuff:
75+
.scrapy
76+
77+
# Sphinx documentation
78+
docs/_build/
79+
80+
# PyBuilder
81+
target/
82+
83+
# Jupyter Notebook
84+
.ipynb_checkpoints
85+
86+
# IPython
87+
profile_default/
88+
ipython_config.py
89+
90+
# pyenv
91+
.python-version
92+
93+
# pipenv
94+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
95+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
96+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
97+
# install all needed dependencies.
98+
#Pipfile.lock
99+
100+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
101+
__pypackages__/
102+
103+
# Celery stuff
104+
celerybeat-schedule
105+
celerybeat.pid
106+
107+
# SageMath parsed files
108+
*.sage.py
109+
110+
# Environments
111+
.env
112+
.venv
113+
env/
114+
venv/
115+
ENV/
116+
env.bak/
117+
venv.bak/
118+
119+
# Spyder project settings
120+
.spyderproject
121+
.spyproject
122+
123+
# Rope project settings
124+
.ropeproject
125+
126+
# mkdocs documentation
127+
/site
128+
129+
# mypy
130+
.mypy_cache/
131+
.dmypy.json
132+
dmypy.json
133+
134+
# Pyre type checker
135+
.pyre/
136+
137+
db.sqlite
138+
db.sqlite-journal
139+
140+
#kern temp files
141+
user_activity_backup.tmp
142+
project_export*

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "submodules/model"]
2+
path = submodules/model
3+
url = https://github.com/code-kern-ai/refinery-submodule-model.git
4+
[submodule "submodules/s3"]
5+
path = submodules/s3
6+
url = https://github.com/code-kern-ai/refinery-submodule-s3.git

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM python:3.7
2+
3+
WORKDIR /app
4+
5+
COPY requirements.txt .
6+
7+
RUN pip3 install -r requirements.txt
8+
RUN python3 -m spacy download en_core_web_sm
9+
RUN python3 -m spacy download de_core_news_sm
10+
# RUN python3 -m spacy download zh_core_web_sm
11+
# RUN python3 -m spacy download da_core_news_sm
12+
# RUN python3 -m spacy download nl_core_news_sm
13+
# RUN python3 -m spacy download fr_core_news_sm
14+
# RUN python3 -m spacy download el_core_news_sm
15+
# RUN python3 -m spacy download it_core_news_sm
16+
# RUN python3 -m spacy download ja_core_news_sm
17+
# RUN python3 -m spacy download pl_core_news_sm
18+
# RUN python3 -m spacy download pt_core_news_sm
19+
# RUN python3 -m spacy download ru_core_news_sm
20+
# RUN python3 -m spacy download es_core_news_sm
21+
# RUN python3 -m spacy download xx_ent_wiki_sm
22+
23+
24+
COPY / .
25+
26+
CMD [ "/usr/local/bin/uvicorn", "--host", "0.0.0.0", "--port", "80", "app:app" ]

0 commit comments

Comments
 (0)