Skip to content

Commit

Permalink
MRG: Merge pull request #1 from aerosense-ai/fix/fix-dashboard
Browse files Browse the repository at this point in the history
Improve dashboard
  • Loading branch information
cortadocodes authored Aug 16, 2022
2 parents 3c252d2 + d9fdec8 commit 7ad1039
Show file tree
Hide file tree
Showing 31 changed files with 1,331 additions and 7,537 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,10 @@ on:
workflow_dispatch:

jobs:
publish:
# This job will only run if the PR has been merged (and not closed without merging).
if: "github.event.pull_request.merged == true && !contains(github.event.pull_request.head.message, 'skipci')"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Test package is publishable with PyPI test server
uses: JRubics/[email protected]
with:
python_version: "3.9"
pypi_token: ${{ secrets.TEST_PYPI_TOKEN }}
repository_name: "testpypi"
repository_url: "https://test.pypi.org/legacy/"

- name: Publish latest package to PyPI
uses: JRubics/[email protected]
with:
python_version: "3.9"
poetry_version: "==1.1.12" # (PIP version specifier syntax)
pypi_token: ${{ secrets.PYPI_TOKEN }}
ignore_dev_requirements: "yes"

release:
# This job will only run if the PR has been merged (and not closed without merging).
if: "github.event.pull_request.merged == true && !contains(github.event.pull_request.head.message, 'skipci')"
runs-on: ubuntu-latest
needs: [publish]
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,48 +36,3 @@ jobs:

- name: Check version
run: check-semantic-version pyproject.toml

run-tests:
if: "!contains(github.event.head_commit.message, 'skipci')"
strategy:
fail-fast: true
matrix:
python: ["3.8", "3.9", "3.10"]
os: [ubuntu-latest] # [ubuntu-latest, windows-latest, macos-latest] for full coverage but this gets expensive quickly
runs-on: ${{ matrix.os }}

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

# See the repo of this action for way more advanced caching strategies than used here
- name: Install Poetry
uses: snok/install-poetry@v1

# For more advanced configuration see https://github.com/ymyzk/tox-gh-actions
- name: Install tox and plugins
run: |
python -m pip install --upgrade pip
python -m pip install tox==3.24.5 tox-gh-actions==2.9.1 tox-poetry==0.4.1
- name: Setup tmate session [DEBUG]
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true'}}
uses: mxschmitt/action-tmate@v3

# For more advanced configuration see https://github.com/ymyzk/tox-gh-actions
- name: Run tests using tox
run: tox

- name: Upload coverage to Codecov
# This seems redundant inside the test matrix but actually isn't, since different
# dependency combinations may cause different lines of code to be hit (e.g. backports)
uses: codecov/codecov-action@v1
with:
file: coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
.DS_Store

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -134,3 +135,5 @@ dmypy.json

# Ignore gcp credentials
gcp-credentials-*

.dashboard_cache
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ repos:
# which if it includes an issue number will
# auto-link pull requests to that issue on github, eg:
# my-branch-to-fix-issue-#6
- "^([a-z][a-z0-9#]*)(-[a-z0-9#]+)*$"
- "^([a-z][a-z0-9#]*)([/-][a-z0-9#]+)*$"

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.2.1"
Expand Down
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM python:3.10-slim

WORKDIR /workspaces/aerosense-dashboard

# Install poetry
RUN pip install poetry
RUN poetry config virtualenvs.create false

# Install python dependencies. Note that poetry installs any root packages by default, but this is not available at this
# stage of caching dependencies. So we do a dependency-only install here to cache the dependencies, then a full poetry
# install post-create to install any root packages.
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-interaction --no-root

COPY . .
RUN poetry install

EXPOSE $PORT

ARG GUNICORN_WORKERS=1
ENV GUNICORN_WORKERS=$GUNICORN_WORKERS

ARG GUNICORN_THREADS=8
ENV GUNICORN_THREADS=$GUNICORN_THREADS

# Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run to handle instance scaling.
CMD exec gunicorn --bind :$PORT --workers $GUNICORN_WORKERS --threads $GUNICORN_THREADS --timeout 0 app:app
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# aerosense-dashboard
A panel-based dashboard for the aerosense project

A `dash`-based dashboard for the Aerosense project.
Loading

0 comments on commit 7ad1039

Please sign in to comment.