Skip to content

Dev_Getting Started on UNIX based Systems

Flavio Alexander edited this page Dec 29, 2015 · 13 revisions

If you are a developer and want to help build CodaLab, this page will explain how to to get started.

To use and test the submission process, a queue server will need to be installed. RabbitMQ installs easily on Linux and Windows and requires no configuration out of the box for testing purposes. A database besides SQLite is recommended. MySQL and Postgres work on Windows, Linux and Mac.

Install Prerequisites

CodaLab is built with Python, supporting development on local machines with Windows, Linux, Mac and BSD. If something is broken, please open a new issue.

In this section, we will walk you through installing Python 2.7.x, installing prerequisites, and running the CodaLab site in a local virtual environment.

Assuming a fresh Ubuntu install the following commands should get you started. Environment variables are used to control settings for a flexible build process. The build script will accept an environment variable, CONFIG_MODULE_PATH, to a location of an installable python source package which will get installed and be used as the settings module, which is specifically specified with DJANGO_SETTINGS_MODULE.

  1. Install Python 2.7. For current Debian-based Linux distributions (such as Ubuntu), BSD and Mac Python 2.7 is usually installed. However Redhat-based Linux distributions, such as RHEL and CentOS, are sometimes behind the curve and do not have Python 2.7. As of this writing, CentOS 6.4 is at Python 2.6, which is well on its way to EOL. Python 2.6 may work, but code will be written with 2.7 and 3.3+ in mind. Below are instructions for Ubuntu Linux 13.04+.

  2. Install PIP.

    sudo apt-get install python-pip

  3. Install virtualenv.

    sudo apt-get install python-virtualenv

  4. Install Git.

    sudo apt-get install git

  5. Install the prerequisites for MySQL-Python.

    sudo apt-get install build-essential python-dev libmysqlclient-dev

Install Compass (optional)

If you want to make changes to CodaLab's stylesheets via SCSS files, you will need to install Compass. Note that this step is only required if you plan to make any changes to stylesheets.

  • Install Ruby from http://rubyinstaller.org/downloads/. (Version 1.9.3 is recommended). During installation be sure to select the option to add Ruby to your PATH.

  • Open a command window and install compass by executing:

    sudo gem install compass

Take the following steps to generate the css files after you've made changes to the scss files in the sass folder:

 `cd codalab/apps/web/static`

 `compass compile`

Alternatively, you can run the compass watch command to start a process which will automatically re-generate the files when changes are made:

 `cd codalab/apps/web/static`

 `compass watch .`

Install the JavaScript Closure Compiler (optional)

If you need to modify any JavaScript files, you'll need the JavaScript Closure Compiler. Note that this step is only required if you make changes to JavaScript files.

  1. Install the JavaScript Closure compiler.

    Take the following steps to generate the javascript files after you've made changes to the js folder:

    cd codalab/codalab/apps/web/static

    python ../../../../scripts/javascript.py ~/java/compiler.jar

Next steps

Clone this wiki locally