Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initial release with approved language
* basic "hello world" scaffolding of application-review webapp

* Docker container images for development and production
* docker-compose wrapper for ease of development
* supervisor-managed gunicorn webserver

* bootstrap etl and project-management shell

* application models and ETL command to populate them

* deployment to elastic beanstalk

* use allauth for (oauth) registration and render application for review

* support HTTP EC2 health check, Google OAuth, and production logging

* compatibility with Django admin site

* added pyenv configuration file for project virtualenv

* added project management commands for logging into AWS ECR and for executing django-management commands in running container

* *basic* README

* proper markdown indentation

* added reviewer survey data to wufoo etl command, fixed loading of (sub)-fields, and fixed streaming

* ignore direnv's .envrc for use in development

* added minimal querying of reviewer table, added to review model, added view logic for nothing to review, and added rendering of most basic review form to review page

* working draft of application-review submission and most basic styling

* improved error templates and shared fonts

* do not request reviewer to review application they have already reviewed

* added to command `loadapps` the subcommand `inspect` and the option `--dry-run`, and added informational output

* improved ignore files

* improved header, messages flash, various styling, and overrode sign-in/-out templates

* disabled wufoo survey column type inference to avoid inappropriate casting/truncation and implemented optional primary-key indexing

* cleaned up application/reference presentation, both styling and restructuring fields; replaced inline-emoji with image-based emoji CSS library; and, renamed review path `/review/application/`

* set default ordering of survey entry rows (for consistent presentation)

* set default login redirect url to site index; and, implement reviewer whitelist s.t. *some people* need not have registered via Wufoo

* consolidated schema by merging ratings into review table, cleaned up form handling, made review form match latest specification, and added instructions to review page

* made review form sidebar "sticky" s.t. it follows the window as the document (application) is scrolled

* fixed internal anchor references

* formatted login form to look a little nicer

* increased ETL process timeout from 1 to 3 minutes

* added handling to SurveyEntry.entries for missing survey data

* configured SMTP via AWS SES; and extended email confirmation and password management to enable a reviewer invitation workflow

* changed overall recommendation approval value from "accept" to "interview"

* replaced indeterminate rating/evaluation image and tweaked its styling

* made page/reference/review counts distinct; and, *secondarily* order applications to review by those with the most references

* added support for survey entries with duplicate keys and fixed overwriting of applicant name with that of their advisor

* refined application-decision schema

* language changes
  • Loading branch information
rayidghani authored and jesteria committed Feb 2, 2018
1 parent 9a63af5 commit c6b5628
Show file tree
Hide file tree
Showing 52 changed files with 3,581 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .ebignore
@@ -0,0 +1,12 @@
__pycache__

.envrc

# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml

/bak/

/Dockerfile
10 changes: 10 additions & 0 deletions .gitignore
@@ -0,0 +1,10 @@
__pycache__

.envrc

# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml

/bak/
1 change: 1 addition & 0 deletions .python-version
@@ -0,0 +1 @@
appy
52 changes: 52 additions & 0 deletions Dockerfile
@@ -0,0 +1,52 @@
# appy-reviews container build file
#

ARG PYVERSION=3.6.3

FROM python:$PYVERSION

# build for production by default, but allow use of alternative Python
# requirement files for alternative runtime targets (such as development)
ARG TARGET=production

# redeclare PYVERSION argument for access in label (FIXME: does this work?)
ARG PYVERSION

LABEL version="0.1" \
pyversion="$PYVERSION" \
target="$TARGET"

ENV DEBIAN_FRONTEND noninteractive
ENV PYTHONUNBUFFERED 1

RUN apt-get update && apt-get install -y \
supervisor \
&& rm -rf /var/lib/apt/lists/*

RUN groupadd webapp \
&& useradd webapp -g webapp
RUN mkdir -p /var/log/webapp \
&& chown webapp /var/log/webapp \
&& chmod ug+rx /var/log/webapp
RUN mkdir -p /var/run/webapp \
&& chown webapp /var/run/webapp \
&& chmod ug+rx /var/run/webapp

RUN mkdir -p /var/log/supervisor
COPY supervisor.conf /etc/supervisor/conf.d/webapp.conf

RUN mkdir -p /etc/webapp
COPY gunicorn.conf /etc/webapp/
COPY requirement /etc/webapp/requirement

WORKDIR /app
COPY src /app

RUN pip install \
--no-cache-dir \
--trusted-host pypi.python.org \
-r /etc/webapp/requirement/$TARGET.txt

CMD supervisord -n -c /etc/supervisor/supervisord.conf

EXPOSE 8000
12 changes: 12 additions & 0 deletions Dockerrun.aws.json
@@ -0,0 +1,12 @@
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "093198349272.dkr.ecr.us-west-2.amazonaws.com/dsapp/appy-reviews/web:latest",
"Update": true
},
"Ports": [
{
"ContainerPort": "8000"
}
]
}
30 changes: 30 additions & 0 deletions README.md
@@ -1,2 +1,32 @@
# appy-reviews

A "smart" Web application for reviewing DSSG program application submissions

## Management

### Requirements

* docker
* pyenv-virtualenv

### Set-up

1. Create a pyenv virtualenv `appy` under Python v3.6.3:

pyenv virtualenv 3.6.3 appy

1. Install console requirements:

pip install -r requirement/console.txt

1. Optionally export environment variables:

* `DATABASE_URL=postgres://appy_reviews:PASSWORD@DBHOST:DBPORT/appy_reviews`
* `AWS_PROFILE`
* `AWS_EB_PROFILE`

### CLI

Project development, deployment, _etc._ are managed via `argcmdr`:

manage --help
14 changes: 14 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,14 @@
version: '2'

services:
web:
build:
context: .
args:
TARGET: development
ports:
- "8000:8000"
volumes:
- ./src:/app
environment:
APPY_DEBUG: 1
13 changes: 13 additions & 0 deletions gunicorn.conf
@@ -0,0 +1,13 @@
backlog = 2048
chdir = "/app"
bind = "0.0.0.0:8000"
pidfile = "/var/run/webapp/gunicorn.pid"
daemon = False
debug = False
workers = 4
accesslog = "/var/log/webapp/gunicorn-webapp-access.log"
errorlog = "/var/log/webapp/gunicorn-webapp-error.log"
loglevel = "debug" # was info
proc_name = "webapp"
user = "webapp"
umask = 0000

0 comments on commit c6b5628

Please sign in to comment.