Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from LucienZhang/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
LucienZhang authored Apr 6, 2020
2 parents 8d81d98 + 749a8c2 commit 55b8976
Show file tree
Hide file tree
Showing 35 changed files with 1,181 additions and 25,924 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on:
release:
types:
- published
- created
- edited
- prereleased

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build & Push Docker Image
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: lucienzhangzl/website
tags: latest
tag_with_ref: true
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test

on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
release:
types:
- published
- created
- edited
- prereleased

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
run: |
pip install pytest
pytest
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM python:3.7.5
FROM python:3.7
WORKDIR /data/project
ENV PYTHONIOENCODING utf-8
ENV LANG en_US.UTF-8

COPY . .
VOLUME [ "/data/project/website/instance", "/data/project/website/static" ]
VOLUME [ "/data/project/website/instance" ]
RUN pip install -r requirements.txt
CMD [ "gunicorn", "website:create_app()", "-c", "./website/instance/gunicorn.conf.py" ]
35 changes: 0 additions & 35 deletions azure-pipelines.yml

This file was deleted.

75 changes: 0 additions & 75 deletions fabfile.py

This file was deleted.

2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from website import create_app

if __name__ == "__main__":
app = create_app('test')
app = create_app()
app.run(port=app.config['PORT'])
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
flask==1.1.1
Flask-Misaka==1.0.0
gunicorn==20.0.4
requests
Pillow
numpy
78 changes: 0 additions & 78 deletions scripts/get_weights.sh

This file was deleted.

50 changes: 0 additions & 50 deletions scripts/setup.sh

This file was deleted.

4 changes: 2 additions & 2 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

sys.path.append(str(Path(__file__).resolve().parents[1]))
from website import create_app
from website import create_app # noqa

app = create_app('test')
app.testing = True
Expand All @@ -16,5 +16,5 @@ def client():


def test_get(client):
for uri in ['/', '/ml', '/ml/project?name=mnist']:
for uri in ['/', '/ml', '/ml/project/mnist', '/ml/demo/mnist']:
assert client.get(uri, follow_redirects=True).status_code == 200
1 change: 1 addition & 0 deletions website/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class TestConfig(Config):
TESTING = True
GUNICORN = False
PORT = 5000
TF_PREDICT_URL = 'http://localhost:8501/v1/models/{}:predict'


config = {
Expand Down
Loading

0 comments on commit 55b8976

Please sign in to comment.