Skip to main content

Ambition Trial EDC (https://doi.org/10.1186/ISRCTN72509687)

Project description

pypi travis coverage

Ambition Edc

(P.I. Joe Jarvis)

http://www.isrctn.com/ISRCTN72509687

VENV Installation

See also [docker install](#docker-install)

There are three requirements files

  • requirements_dev.txt # installs all in editable mode from your workspace

  • requirements_production.txt # installs each by tag

  • requirements.txt # installs each from develop branch (for ci / tests)

See ambition/ubuntu.txt for required ubuntu packages

Decide on the user account for the installation. E.g. ambition.

sudo su ambition

create folders

mkdir  ~/.venvs
mkdir -p ~/source/ambition/log/

create VENV

python3 -m venv ~/.venvs/ambition

activate VENV

source ~/.venvs/ambition/bin/activate

update pip

pip install -U pip ipython

clone main project

cd ~/source/ \
&& git clone https://github.com/ambition-trial/ambition.git

change to project folder

cd ~/source/ambition

copy your .env file into the project root

cp /some/path/to/.env ~/source/ambition/.env

install requirements, select the require file. See requirements options above.

   # pip install -r requirements.txt

   pip install -r requirements_production.txt

create database and populate timezone table

   mysql -u <user> -p -Bse 'create database ambition character set utf8;' \
   && mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

migrate database

python manage.py migrate

import required data

python manage.py import_randomization_list \
&& python manage.py import_holidays

check

python manage.py check

Environment variables

Settings variables are store in the environment. See django-environ and 12-factor-django.

Place your .env file in the root of the project.

Logging

If logging through syslog is implemented, you need to configure rsyslog.

   nano /etc/rsyslog.d/30-ambition.conf

add this to the file
   # /etc/rsyslog.d/30-ambition.conf
   local7.*                                             /var/log/ambition.log
   & ~  # This stops local7.* from going anywhere else.

restart rsyslog
   sudo service rsyslog restart

view the log
tail -n 25 -f /var/log/ambition.log

Docker Install

Install Docker Compose.

create a droplet for the host

log into your host and create a user account for the app

useradd ambition
usermod -aG docker ambition
usermod -aG sudo ambition

log out and log back in as user ambition

ssh ambition@example.com

The rest of the steps assume you are logged into your host as user ambition

checkout the main ambition repo into app

cd ~/
git checkout -b develop git https://github.com/ambition-trial/ambition.git app

make a folder on your host for the container volumes

sudo mkdir -p /srv/ambition/

copy or scp your .env file into the app root

cp /some/path/to/.env ~/app/.env

scp .production ambition@example.com:~/app/.env

edit ~/app/.env file as required, for example

from app/ build images for ambition_production and mysql and bring them up

docker-compose -f compose/local.yml build \
&& docker-compose -f compose/local.yml up
docker cp /some/path/to/crypto_keys/ ambition_production:$DJANGO_KEY_FOLDER

Copy the randomization_list.csv file to the container

docker cp /some/path/to/randomization_list.csv ambition_production:$DJANGO_ETC_FOLDER

In another shell, log into the container

docker exec -it ambition_production /bin/bash

run migrations and other management commands as required

python manage.py migrate
python manage.py import_holidays
python manage.py migrate import_randomization_list

While still in the container, run check

python manage.py check

Start runserver

python manage.py runserver 0.0.0.0:8000

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

ambition_edc-0.1.12-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file ambition-edc-0.1.12.macosx-10.13-x86_64.tar.gz.

File metadata

  • Download URL: ambition-edc-0.1.12.macosx-10.13-x86_64.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.0

File hashes

Hashes for ambition-edc-0.1.12.macosx-10.13-x86_64.tar.gz
Algorithm Hash digest
SHA256 a6a6f530780b9c4176503d6bdd9eac42d3120e13ee9548fc14f56c1f4fd15251
MD5 86502929c47d844fd2f4d36f71622639
BLAKE2b-256 93daec675b0a14581ece250f240b41bd0b364cbf66d2bec5b5572c71d859e626

See more details on using hashes here.

File details

Details for the file ambition_edc-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: ambition_edc-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.0

File hashes

Hashes for ambition_edc-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 1c1091bcebe41802f1135097870608bfc82bd0c907474697ecd72387d3a45001
MD5 25e3ab29b21680ddcf54203304406e7f
BLAKE2b-256 66d5bca2e17d45cd5917196da67352a0882d6e6d5f0b8bb3895bb38cc5cab55c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page