Skip to content

Commit

Permalink
Merge branch 'feature/render-final' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
philipbelesky committed May 14, 2022
2 parents 7224d07 + f96cb47 commit e472aba
Show file tree
Hide file tree
Showing 27 changed files with 450 additions and 248 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Change Log
---------
*Release date: TBD*

- Added the ability to deploy to Render as a 1-click Heroku-like deployment option
- Round weights can be modified within tournament preferences, rather than just by the Edit Database.
- Preformed panels can now be applied 'directly', in a linear top-to-bottom fashion. However, this method will not account for soft or hard conflicts. Thanks to Enting Lee for the pull request!

Expand Down
10 changes: 7 additions & 3 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Tabbycat is a draw tabulation system for British Parliamentary and a variety of

## 🔍 Features

- Deployable to [Heroku](https://www.heroku.com/) for an easy, fast, and free setup
- A range of setup options. Tabbycat powers Calico, a paid service for hosting tournaments. Tabbycat can also run as a local installation (natively, or via Docker) and be deployed to the free-tiers of the Render or Heroku platforms.
- Enter data from multiple computers simultaneously and (optionally) display results, draws, and other information online
- Collect ballots and feedback online, or from printed forms customised for each round ( adjudicator feedback questions and rankings [are configurable](http://tabbycat.readthedocs.io/en/stable/features/adjudicator-feedback.html))
- Automated adjudicator allocations based on adjudicator ranking, debate priority, and conflicts/clashes
Expand All @@ -33,13 +33,17 @@ Our user guide is at [tabbycat.readthedocs.io](http://tabbycat.readthedocs.io/).

## ⬆️ Installation

Tabbycat can be deployed in a number of ways. While you can set it up to [run on your own computer](https://tabbycat.readthedocs.io/en/stable/install/local.html) most users will want to run it as a website.
Tabbycat can be deployed in a number of ways.

[Calico](https://calicotab.com/) is a managed hosting service run by one of Tabbycat's developers. For a flat fee, it will host tab websites, automatically manage their setup and performance, and provide ongoing access to the released tab. Click this button to deploy to Calico:

[![Deploy](https://raw.githubusercontent.com/gist/tienne-B/fc04ecd3c11a38424b642b4bba60e8d9/raw/b2c71d7d6a0d368d3e9dfd8002af729d155ad09b/calicodeploy.svg)](https://calicotab.com/tournaments/new/)

Tabbycat is **currently unavailable as a 1-click installation** on the [Heroku](https://www.heroku.com) web platform. If you are unable to use Calico, we suggest [creating a local installation](https://tabbycat.readthedocs.io/en/stable/install/local.html). We hope to address this issue or [develop an alternate installation method](https://tabbycat.readthedocs.io/en/feature-render/index.html) in a future version of Tabbycat.
Tabbycat is **no longer available as a 1-click Heroku installation**. If you do not want to use Calico, you have a few alternate options:

1. For online tournaments where long-term data preservation is unnecessary, we have [a 1-click installer that uses the Render platform](https://tabbycat.readthedocs.io/en/stable/install/render.html) and runs within its free tier of services
2. For tournaments where online access is unnecessary, you can [install and run Tabbycat from your own computer](https://tabbycat.readthedocs.io/en/stable/install/local.html)
3. For online tournaments in general, you can still deploy to Heroku, [but will need to run a script from your computer's command line](https://tabbycat.readthedocs.io/en/stable/install/heroku.html)

## 💪 Support and Contributing

Expand Down
3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ updates:
- dependency-name: ipython
versions:
- "< 6.6, >= 6.5.a"
- dependency-name: scout-apm
versions:
- "< 1.2.4, >= 1.2.3.a"
- dependency-name: selenium
versions:
- "< 3.14.1, >= 3.14.0.a"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

env:
## Environment variable
GITHUB_CI: true # Just 'CI' clashes with Render

steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FROM python:3.9

# Just needed for all things python (note this is setting an env variable)
ENV PYTHONUNBUFFERED 1
# Needed for correct settings input
ENV IN_DOCKER 1

# Setup Node/NPM
RUN apt-get update
Expand Down
4 changes: 3 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ django-summernote = "*"
dj-cmd = "*"
django-redis = "*"
django-cors-headers = "*"
psycopg2 = "*"
psycopg2-binary = "*"
asgiref = "*"
channels = "*"
channels-redis = "*"
ipython = "==7.*"
Expand All @@ -34,6 +35,7 @@ dj-database-url = "*"
honcho = "*"
gunicorn = "*"
sentry-sdk = "*"
whitenoise = "*"

[dev-packages]
pre-commit = "*"
Expand Down
93 changes: 77 additions & 16 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 0 additions & 59 deletions app.json

This file was deleted.

1 change: 0 additions & 1 deletion bin/artillery-draw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# PUBLIC_FAST_CACHE_TIMEOUT=30
# PUBLIC_SLOW_CACHE_TIMEOUT=30
# TAB_PAGES_CACHE_TIMEOUT=30
# SCOUT_MONITOR=false
# Hobby dynos
# Note that a single heroku dyno has a hard limit of 50 requests in its backlog;
# testing limits should not exceed that (say 40 to account for latency?) else
Expand Down
1 change: 0 additions & 1 deletion bin/artillery-tab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# PUBLIC_FAST_CACHE_TIMEOUT=30
# PUBLIC_SLOW_CACHE_TIMEOUT=30
# TAB_PAGES_CACHE_TIMEOUT=30
# SCOUT_MONITOR=false
# Hobby dynos
# Note that a single heroku dyno has a hard limit of 50 requests in its backlog;
# testing limits should not exceed that (say 40 to account for latency?) else
Expand Down
26 changes: 26 additions & 0 deletions bin/render-compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# exit on error
set -o errexit

echo "-----> Install dependencies"
python -m pip install pipenv
pipenv install --system

echo "-----> I'm post-compile hook"
cd ./tabbycat/

echo "-----> Running database migration"
python manage.py migrate --noinput

echo "-----> Running dynamic preferences checks"
python manage.py checkpreferences

echo "-----> Running static asset compilation"
npm install -g @vue/cli-service-global
npm install
npm run build

echo "-----> Running static files compilation"
python manage.py collectstatic --noinput

echo "-----> Post-compile done"
6 changes: 0 additions & 6 deletions bin/serve_local

This file was deleted.

2 changes: 1 addition & 1 deletion deploy_heroku.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def get_git_push_spec():
run_heroku_command(["buildpacks:add", "heroku/python"])

# Set config variables
command = ["config:set", "DISABLE_COLLECTSTATIC=1", "ON_HEROKU=1"]
command = ["config:set", "DISABLE_COLLECTSTATIC=1", "ON_HEROKU=1", "USING_NGINX=1"]
secret_key = get_random_secret_key()

if platform.system() == "Windows": # Windows shell needs escaping
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ services:
- DEBUG=0
- DOCKER_REDIS=1
- IN_DOCKER=1
- USING_NGINX=1

worker:
environment:
- DEBUG=0
- DOCKER_REDIS=1
- IN_DOCKER=1
- USING_NGINX=1
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ services:
- IN_DOCKER=1
- DISABLE_SENTRY=1
- DOCKER_REDIS=1
- USING_NGINX=1
ports:
- "127.0.0.1:8000:8000"
volumes:
Expand All @@ -57,6 +58,7 @@ services:
- IN_DOCKER=1
- DISABLE_SENTRY=1
- DOCKER_REDIS=1
- USING_NGINX=1
volumes:
- ./tabbycat/settings:/tcd/tabbycat/settings
working_dir: /tcd
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ formats too. If you're looking for a general overview of the software, check out
:maxdepth: 1
:caption: Installation

install/render
install/heroku
install/local
install/docker
Expand Down
Loading

0 comments on commit e472aba

Please sign in to comment.