Skip to content

Commit 139df6f

Browse files
author
JWittmeyer
committed
Inital commit
0 parents  commit 139df6f

19 files changed

+896
-0
lines changed

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

.gitmodules

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

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM python:3.10
2+
3+
WORKDIR /program
4+
5+
COPY requirements.txt .
6+
7+
RUN pip3 install -r requirements.txt
8+
9+
COPY / .
10+
11+
CMD [ "/usr/local/bin/uvicorn", "--host", "0.0.0.0", "--port", "80", "app:app" ]

0 commit comments

Comments
 (0)