home | prev | next

Windows Deployment via PyPI

INTRODUCTION

Parameter Values
  1. Readers of this document are expected to make appropriate adjustments where their system's parameters differ from those described in this process.
  2. Particularly for security-sensitive settings, such as usernames and passwords, readers are strongly encouraged:
    1. DO select parameter values which are secure and relevant to their installation.
    2. DO NOT use the example default parameter values provided here (which are insecure).
  3. The default parameter values and examples used throughout this document are only provided for the purposes of illustrating the installation process steps as concretely as possible.
Some example default values of important installation parameters are shown here:
Installation Parameter Example Installation Parameter Value
MDCS application installation platform Windows operating system
MDCS application installation path c:\mdcs
MDCS application IP address 127.0.0.1
MDCS application port number 8000
MDCS virtual environment name mdcs_env
MDCS Superuser username mgi_superuser
MDCS Superuser email user_email@institution.com
MDCS Superuser password mgi_superuser_pwd
MongoDB administrative username mdb_admin_user
MongoDB administrative password mdb_admin_pwd
MongoDB non-administrative username mdb_user
MongoDB non-administrative password mdb_pwd
Redis configuration file c:\Program Files\Redis\redis.windows.conf
This document will use the following abstract settings in the instructions that follow:
Installation Parameter Parameter Value Used In This Document
MDCS application installation path <install_path>
MDCS application IP address <ip_address>
MDCS application port number <port_number>
MDCS virtual environment name <mdcs_virtual_environment_name>
MDCS Superuser username <mdcs_superuser_username>
MDCS Superuser email <mdcs_superuser_email>
MDCS Superuser password <mdcs_superuser_password>
MongoDB administrative username <mongodb_admin_username>
MongoDB administrative password <mongodb_admin_password>
MongoDB non-administrative username <mongodb_nonadmin_username>
MongoDB non-administrative password <mongodb_nonadmin_password>
Redis configuration file <redis_configuratiaon_filename>
Assumptions
Conventions

INSTALLATION INSTRUCTIONS

1. Install supporting applications on your host system.
2. Configure the execution environment.
3. Open terminal window #1 and perform the first set of installation commands.

Open a terminal window.

$ cmd.exe
Install mkvirtualenv
Install the latest version of pip installation utility inside the newly-created virtual-environment.
$$ python -m pip install --upgrade pip
Download, extract, and configure mdcs from git repository.
$$ cd mdcs-master
Create configuration file directory for MongoDB.
$$ mkdir conf
Create data directory for MongoDB.
$$ mkdir data\db
Create <install_path>\mdcs-master\conf\mongodb.conf file with the following content:
net:
   bindIp: <ip_address>
security:
   authorization: enabled
storage:
   dbPath: <install_path>/mdcs-master/data/db
net:
   bindIp: 127.0.0.1
security:
   authorization: enabled
storage:
   dbPath: c:/mdcs/mdcs-master/data/db
Install MDCS supporting and core software packages.
$$ pip install -e git://github.com/MongoEngine/django-mongoengine.git@v0.2.1#egg=django-mongoengine
$$ pip install --no-cache-dir -r requirements.txt
$$ pip install --no-cache-dir -r requirements.core.txt
Start MongoDB server.
$$ mongod --config conf\mongodb.conf
4. Open terminal window #2 and perform the next set of installation commands.
Open terminal window.
$ cmd.exe
Open virtual environment and move to the release installation directory.
Create MongoDB administrative user.

NOTE: Enter your own mongodb administrative username and password here. See the example below.

$$ mongo --port 27017
 
    use admin
    db.createUser(
    {
    user: "<mongodb_admin_username>",
    pwd: "<mongodb_admin_password>",
    roles: [ { role: "userAdminAnyDatabase", db: "admin"},"backup","restore"]
    }
    )
    exit
$$ mongo --port 27017
 
    use admin
    db.createUser(
    {
    user: "mdb_admin_user",
    pwd: "mdb_admin_pwd",
    roles: [ { role: "userAdminAnyDatabase", db: "admin"},"backup","restore"]
    }
    )
    exit
Create MongoDB non-administrative user.
$$ mongo --port 27017 -u "<mongodb_admin_username>" -p "<mongodb_admin_username>" --authenticationDatabase admin
    use mgi
    db.createUser(
    {
     user: "<mongodb_nonadmin_username>",
     pwd: "<mongodb_nonadmin_password>",
     roles: ["readWrite"]
    }
    )
    exit
$$ mongo --port 27017 -u "mdb_admin_user" -p "mdb_admin_pwd" --authenticationDatabase admin
    use mgi
    db.createUser(
    {
     user: "mdb_user",
     pwd: "mdb_pwd",
     roles: ["readWrite"]
    }
    )
    exit
Edit and save <install_path>\mdcs-master\mdcs\settings.py file.
Start Redis server.
(ON WINDOWS ONLY) Remove incompatibility with celery 4.x.
$$ pip uninstall celery
$$ pip install celery==3.1.18
 
Start celery.
$$ celery -A mdcs worker -l info -Ofair --purge
5. Open terminal window #3 and perform the last set of installation commands.
$ cd <install_path>\mdcs-master\
$ workon mdcs_env
$$ python manage.py migrate auth
$$ python manage.py migrate
$$ python manage.py collectstatic --noinput
$$ python manage.py createsuperuser
Run the system.
6. Open system URL in a browser.
7. Login with superuser credentials.

Appendix A: Starting up a fully-installed system from a shutdown state

Ensure MongoDB, Redis, and Celery are running in command-line windows.
in terminal window #1
$$ mongod --config conf\mongodb.conf
in terminal window #2
$$ redis-server "c:\Program Files\Redis\redis.windows.conf"
$$ celery -A mdcs worker -l info -Ofair --purge
in terminal window #3
Run the system.
Open browser: http://<ip_address>:<port_number>
Login with superuser credentials.