Page History
...
- Log in to the Microsoft Azure Portal
.Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptNameExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include - Go to VM Screen, select "+ NEW" from the lower left corner of the screen.
On the pane that appears select, Compute > Virtual Machine > Quick Create.
Code Block DNS Name: pick something unique and memorable Image: Ubuntu Server 13.04 New Password/Confirm: provide a good password for the azureuser Region/Affinity Group: West US
Click Create a virtual machine.
Once your virtual machine is created, select it from the VM screen.
Go to the Endpoints menu.
(+ Add) an Endpoint at the bottom of the screen.
Code Block Provide the following information Name: HTTP Public Port: 80 Private Port: 8000
Restart the VM from the management console.
Troubleshooting note: You may get a message that Endpoint was successfully created but restart failed. In this case, go back to Dashboard (Management Console) and click Restart. In some cases, multiple attempts may be required.
At this point, it appears that a restart is not mandatory to continue with configuration.
Now you can login to it and start configuring things.
- Login to your VM via ssh as: azureuser <password provided at vm build - Step 3)
Things to do once you're in Ubuntu.
sudo apt-get update
enter password (azureuser password from Step 3)
sudo apt-get upgrade -y
sudo apt-get install git python-pip -y
sudo pip install virtualenv
Installation Prerequisites
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+.
Code Block sudo apt-get install python2.7 python2.7-dev python-virtualenv
Install PIP
.Multiexcerpt include nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include Code Block sudo apt-get install python-pip
Install virtualenv.
Code Block sudo apt-get install python-virtualenv
Install Git
.Multiexcerpt include nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include Code Block sudo apt-get install git
Install the prerequisites for MySQL-Python
.Multiexcerpt include nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include Code Block sudo apt-get install build-essential python-dev libmysqlclient-dev
Create Storage Containers
Create Storage Containers
In order to test uploading and running bundles in CodaLab, you will need to have a In order to test uploading and running bundles in CodaLab, you will need to have a Windows Azure storage account
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Multiexcerpt include | ||||||||
---|---|---|---|---|---|---|---|---|
|
- Log on to the Azure Portal
.Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include - In the left pane, click Storage.
- Select your storage account.
- At the bottom of the dashboard, click Manage Access Keys. Copy your access keys. You'll need them later.
- At the top of the dashboard page, click Containers.
- At the bottom of the Containers page click Add.
- Create a new container named "bundles". Set the Access to "Private".
- Add another container named "public". Set the Access to "Public Blob".
...
Install azure-cli
.Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include In Ubuntu it can be installed using the following command:
Code Block sudo apt-get install nodejs-legacy sudo apt-get install npm sudo npm install -g azure-cli
To login run the following command:
Code Block azure login
Copy the code offered to you, above, and open a browser to http://aka.ms/devicelogin
. Enter the code, and then you are prompted to enter the username and password for the identity you want to use. When that process completes, the command shell completes the log in process.Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include From command line
azure sb namespace create <name> <location>
where<location>
can be "East US"- Log on to the Azure Portal
.Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptNameExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include - In the left pane, click Service Bus.
- Select the service bus you just created.
- At the top of the screen click Queues.
- Click Create a new queue.
- Click Quick Create and create a new queue named "compute".
- Click Create A New Queue.
- At the bottom of the screen, click New, and create another queue named "response".
- In the left pane, click Service Bus.
- At the bottom of the page, click Connection Information.
- Copy the following connection information:
- Namespace name
- Default issuer
- Default key
...
Install CodaLab
the CodaLab repoMultiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include
from GitHub.Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include Clone your fork:
...
For more details and recommended practices, see Developer Guidelines
Multiexcerpt include | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Run the dev_setup script.
Windows
Code Block cd codalab .\dev_setup.bat
If you are going to use SQL Server as a database, you will need to install the Python PyODBC library
. Before runningMultiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include dev_setup
, you can download the installer, then run the setup script as follows (assuming the installer was downloaded at the root of a D drive):Code Block cd codalab dev_setup.bat D:\pyodbc-3.0.7.win-amd64-py2.7.exe
Linux
Code Block cd codalab source ./dev_setup.sh
Activate the virtual environment.
...
Info | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
If you want to use MySQL
|
...
Make sure you have a valid management certificate to connect to the Service Management endpoint. This tutorial
explains how to create a certificate and upload it to the Azure management portal.Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include Open
codalab/codalabtools/compute/enableCORS.py
in a text editor, and updateaccount_name
andaccount_key
with the account name and key for your blob storage account:Code Block import sys import yaml from os.path import dirname, abspath # Add codalabtools to the module search path sys.path.append(dirname(dirname(abspath(__file__)))) from codalabtools.azure_extensions import (Cors,CorsRule,set_storage_service_cors_properties) account_name = "<your blob storage account name>" account_key = "<your blob storage account key>" cors_rule = CorsRule() cors_rule.allowed_origins = '*' # this is fine for dev setup cors_rule.allowed_methods = 'PUT' cors_rule.exposed_headers = '*' cors_rule.allowed_headers = '*' cors_rule.max_age_in_seconds = 1800 cors_rules = Cors() cors_rules.cors_rule.append(cors_rule) set_storage_service_cors_properties(account_name, account_key, cors_rules)
- Save your changes, activate your virtual environment and run the script:
...
To initialize the database, you will need to run a few standard Django commands
Multiexcerpt include | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
You can already run the Django web site on your local machine as described on this page
.Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include You have also forked the codalab-cli
project and have gone through the steps listed in the ReadmeMultiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include
.Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include
...
Use the following command to start the CodaLab server locally.
python manage.py runserver
Open a browser and navigate to http://127.0.0.1:8000
to preview the site.Multiexcerpt include MultiExcerptName ExitDisclaimer nopanel true MultiExcerptName ExitDisclaimer PageWithExcerpt wikicontent:Exit Disclaimer to Include
...