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

Flowapi module #456

Merged
merged 11 commits into from
Mar 11, 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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defaults:
FLOWDB_PORT: 5432
MPLBACKEND: "agg"
REDIS_HOST: "localhost"
QUART_APP: "app.main:create_app()"
QUART_APP: "flowapi.main:create_app()"
DB_USER: analyst
LOG_DIRECTORY: "."
SERVER: localhost
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:
- run:
name: Run API unit tests
command: |
pipenv run python -m pytest --junitxml=test_results/pytest/results.xml --cov=app/ \
pipenv run python -m pytest --junitxml=test_results/pytest/results.xml --cov=flowapi/ \
--cov-report term --cov-report xml --durations=10
- store_test_results:
path: test_results
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Query classes are now required to declare the column names they return via the `column_names` property
- FlowDB test data and synthetic data images are now available from their own Docker repos (Flowminder/flowdb-testdata, Flowminder/flowdb-synthetic-data)
- Changed query class name from `NocturnalCalls` to `NocturnalEvents`.
- FlowAPI is now an installable python module

### Removed
- Arbitrary `Flow` maths
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ services:
ports:
- ${FLOWMACHINE_PORT:-5555}:5555
volumes:
- ./flowmachine/:/app
- ./flowmachine/:/flowapi
depends_on:
- redis
tty: true
Expand Down Expand Up @@ -134,7 +134,7 @@ services:
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-secret}
- LOG_LEVEL=${LOG_LEVEL:-debug}
volumes:
- ./flowapi/app:/flowapi/app
- ./flowapi/flowapi:/flowapi/flowapi
tty: true
stdin_open: true
restart: always
Expand Down
23 changes: 19 additions & 4 deletions flowapi/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
build/
dist/
tests/
.env
# This .dockerignore file follows the "whitelisting" approach described here:
# https://youknowfordevs.com/2018/12/07/getting-control-of-your-dockerignore-files.html

#
# First, exclude everything by default:
#
*

#
# Now un-exclude only those folders and files that are needed for building the image:
#
!Pipfile
!Pipfile.lock
!flowapi/
!setup.cfg
!setup.py
!versioneer.py
!start.sh
!README.md
2 changes: 1 addition & 1 deletion flowapi/.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ DB_PASS=foo
DB_HOST=localhost
FLOWDB_PORT=9000
JWT_SECRET_KEY=secret
QUART_APP="app.main:create_app()"
QUART_APP="flowapi.main:create_app()"
QUART_DEBUG=1
5 changes: 3 additions & 2 deletions flowapi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ FROM python:3.7
WORKDIR /flowapi
COPY Pipfile* /
RUN pip install pipenv && pipenv install --deploy
COPY app /flowapi/app
COPY . /flowapi/
RUN pipenv install --skip-lock .
RUN mkdir /var/log/flowapi
VOLUME /var/log/flowapi
ENV QUART_ENV=production
CMD ["pipenv", "run", "./app/start.sh"]
CMD ["pipenv", "run", "./start.sh"]
5 changes: 3 additions & 2 deletions flowapi/Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ FROM python:3.7
WORKDIR /flowapi
COPY Pipfile* /
RUN pip install pipenv && pipenv install --dev
COPY app /flowapi/app
COPY . /flowapi/
RUN pipenv install --skip-lock .
RUN mkdir /var/log/flowapi
VOLUME /var/log/flowapi
ENV QUART_ENV=development
CMD pipenv run hypercorn --debug --reload --bind 0.0.0.0:9090 "app.main:create_app()"
CMD pipenv run hypercorn --debug --reload --bind 0.0.0.0:9090 "flowapi.main:create_app()"
147 changes: 0 additions & 147 deletions flowapi/app/main.py

This file was deleted.

File renamed without changes.
Loading