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.13-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ambition-edc-0.1.13.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.13.macosx-10.13-x86_64.tar.gz
Algorithm Hash digest
SHA256 b592ffe38d9925eb6ea3b95667b0a9b17b6fb5fdfedad6e642bbfe7d7009d341
MD5 d86141a6189fa5b9c3b2e4ad3ff2a444
BLAKE2b-256 0d4e73449d5d5386bdb122fee2432cfa069a52c89f6cecf4149709e3b3055958

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ambition_edc-0.1.13-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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 5ecfb35e3066fed801673420b6c6a26cdd7dc108131272f7a671581cd96b7e69
MD5 c045c6357a9ccdbcf540c5ca63873bf2
BLAKE2b-256 bda844a8dc3c4f92fcf2e5b42f7bf1c6744478afd5a2867ce4479dffafc194de

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