Powertrain is a system designed to manage and execute large-scale neuroimaging projects across VUIIS.
It is currently in the planning stages. Documentation can be found here
Powertrain is supported by VUIIS. The following people are involved:
- Scott Burns
- Brian Boyd
- Benjamin Yvernault
- Kevin Wilson
- Stephen Damon
- Adam Anderson
- Bennett Landman
Where possible, we try to follow 12 Factor Application principles including:
- Explicit dependencies (see the
req
folder) - Config in the environment
- Development/production parity
Powertrain will most likely be built upon:
- Flask, a minimal web framework for python.
- SQLAlchemy, the database toolkit for python.
- Postgres, the worlds most advanced open source database.
You should use a virtualenv & virtualenvwrapper to setup your environment. After setting up these tools, make a virtual environment like so:
$ mkvirtualenv powertrain
$ workon powertrain
$ git clone https://github.com/VUIIS/powertrain powertrain
$ cd powertrain && pip install -r reqs/dev.txt
Powertrain honors the following envvars:
SECRET_KEY
: used by Flask all over the place, notably secure cookiesFLASK_CONFIG
: seeconfig.config
. String describing config environmentMAIL_SERVER
: SMTP serverMAIL_PORT
: SMTP server portMAIL_USERNAME
: username for mail serverMAIL_PASSWORD
: SMTP passwordDEV_DATABASE_URL
: database url for development purposesTEST_DATABASE_URL
: database url for testing purposesADMIN
: email account that has administrator rightsFLASK_COVERAGE
:./manage.py test
will display coverage report after finishing unittests.
Powertrain uses Postgres under the hood. On OS X, download & start Postgres.app. When Postgres.app is running, a fully-featured Postgres 9.3 (at the time of this writing) server is running on the system. When you quit, the server is not running. With the server running, make a development & testing database.
On Linux, use your package manager of choice to install postgres. Then:
$ createdb -E utf-8 -U `whoami` powertrain
$ createdb -E utf-8 -U `whoami` powertrain_testing
$ export DEV_DATABASE_URL=postgres://`whoami`@localhost/powertrain
$ export TEST_DATABASE_URL=postgres://`whoami`@localhost/powertrain_testing
Powertrain uses Alembic and Flask-Migrate for schema migrations. To update your dev database after a new migration:
$ ./manage.py db upgrade
To generate a new migration (when models change):
$ ./manage.py db migrate
This will create a new migration in migrations/versions
that must be reviewed before placed into source-control.
$ export FLASK_COVERAGE=1; make test
Run it early, run it often.