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-edc/ubuntu.txt for required ubuntu packages

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

sudo su edc

create folders

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

create VENV

python3 -m venv ~/.venvs/ambition-edc

activate VENV

source ~/.venvs/ambition-edc/bin/activate

update pip

pip install -U pip ipython

clone main project

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

change to project folder

cd ~/source/ambition-edc

copy your .env file into the project root

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

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

   # choose one
   pip install -r requirements/stable.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.

Docker Install

Work in progress….

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ambition-edc-0.1.14.macosx-10.13-x86_64.tar.gz
  • Upload date:
  • Size: 27.2 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.24.0 CPython/3.7.0

File hashes

Hashes for ambition-edc-0.1.14.macosx-10.13-x86_64.tar.gz
Algorithm Hash digest
SHA256 ca41b6c361b9136641796d97f1d9643a74d4e56818455030dbae363a690c8418
MD5 1f9f2e9df57ab73d30beb580814b5f7c
BLAKE2b-256 28dd96f0282271dbf68c85d2f8fb791c948afcbc62c2af607ed2fecb324be7e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ambition_edc-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 17.6 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.24.0 CPython/3.7.0

File hashes

Hashes for ambition_edc-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 85baa02eabc8d1cb92c65cf2c9ccc64128b939bc9bdc4e91a52475c1f26edaa6
MD5 f5096f8e0b29125d56f5e5d246c589e6
BLAKE2b-256 517e96df9390ad748e379293825c6c51cf87ca1ff00c7c3710541d8f7cd535e7

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