Code Monkey home page Code Monkey logo

adage-server's Introduction

adage-server

Codeship Status for greenelab/adage-server Code Climate

Get a working instance of the adage-server running

Note: The following steps assume you have already installed PostgreSQL (>=9.4), NGINX (>=1.10), supervisord (>=3.2), Python (2.7) and Elasticsearch (1.7) on Ubuntu (16.04).

Fork and clone the adage-server repository

Fork the adage-server repository on Github (see Github's documentation for forking repositories) and then clone that fork you made in the directory of your choice.

cd /<your chosen directory>/
git clone [email protected]:<your github account>/adage-server.git

Edit settings in config.py file

The config.py file (in the adage-server/adage/adage folder) contains many of the settings for the deployment. The idea is that you should edit adage-server/adage/adage/config.py.template from the repository with your deployment's information and save it as config.py. This puts all of the secrets and deployment-specific information into a single, easily-controlled file.

Set the full path of parent directory where adage-server repository was cloned into in the 'home_dir' key of the OS_CONFIG setting.

OS_CONFIG = {
    'home_dir':  '/<path to directory>/',
}

Set up Database Name, User, Password and Host in databases settings:

CONFIG.update({
    'databases': {
        'default': {

            # This example uses psycopg2 for PostgreSQL, but you can use any
            # of the Engines supported by Django. For more information, see:
            # https://docs.djangoproject.com/en/dev/ref/settings/#databases

            'ENGINE': 'django.db.backends.postgresql_psycopg2',

             # database name and user cannot have upper case letters
             'NAME': '<your_adage_database_name>',
             'USER': '<your_adage_db_username>',
             'PASSWORD': '<your_db_username_password>',

             # Wherever PostgreSQL is being hosted,
             # usually localhost for development
             'HOST': 'localhost',

             # Port where it is being hosted from,
             # usually 5432
             'PORT': '5432',
        }
    },
})

Set up the database name, user, and password on PostgreSQL

# Switch to postgres user, enter the superuser password when you
# are prompted
sudo su - postgres

# Create adage-server database specified in previous step
createdb <your_adage_database_name>

# Create adage-server database user specified in previous step
createuser -P <your_adage_db_username>
# This prompts you to enter the password for new role/user (also
# the one specified in config.py file in previous step)

# Enter psql interface:
psql

# Give all privileges of this newly created database to the
# newly created user
GRANT ALL PRIVILEGES ON DATABASE <your_adage_database_name> TO <your_adage_db_username>;

# Also give this user permissions to create databases - this is needed to be
# able to run the Django test suite (since a test database is created).
ALTER USER <your_adage_db_username> CREATEDB;

Install Python dependencies

# Start a Python virtual environment in the adage-server root
# or wherever you keep your Python virtual environments
virtualenv <virtual envs location>/adageenv
source <virtual envs location>/adageenv/bin/activate

# Install Python requirements
cd adage/
pip install -r requirements.txt

Run Django migration of database tables

python manage.py migrate

Download other necessary files

Download the get_pseudo_sdrf.py and gen_spreadsheets.py files from this repository, and put them in whichever parent directory the adage-server repository has been cloned into.

Build adage-server web interface

cd interface/

# Download newest version of Node.js. Also, the command
# "curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -"
# is needed before the "sudo apt-get install -y nodejs" if you are
# running a Ubuntu version older than 16.04.
sudo apt-get install -y nodejs

# Install needed interface packages
sudo npm -g install grunt-cli karma-cli bower
npm install
bower install

# Run Grunt to build the interface
grunt

adage-server's People

Contributors

dongbohu avatar mhuyck avatar cgreene avatar rzelayafavila avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.