-
Notifications
You must be signed in to change notification settings - Fork 248
Development Environment
This page outlines setting up a working development environment for working with the DataLab repository.
Once you've cloned the repository locally, you'll need to setup your environment to include the tools and packages required to build and run the various components.
# Run once to setup tools
./tools/initonce.sh
# Run once per command prompt to setup environment vars etc.
source ./tools/initenv.sh
- Java - Java 1.7
- JavaScript - NodeJS 0.10.x, TypeScript 1.0
- Docker
- SDKs - gcloud
- Tools - ipython (and associated python dependencies - see below)
- Pkg-config (for building DataLab server - see below)
On the mac, the easiest way to perhaps get IPython and associated dependencies is to use a full python distribution ... like the Anaconda one. It includes dependencies like pandas and various python libraries. You'll want to install it and then update the packages to latest version (using the conda update <name of package>
command).
DataLab is designed to be run within the cloud, specifically on Google Compute Engine and using Google Cloud Platform services. It relies on the metadata service available within the cloud to resolve contextual information such as current project id, and retrieve tokens to authorize cloud API calls. A tool is included in the repository to simulate this metadata service. Run the following commands:
# Setup gcloud (once usually suffices, unless you need to change projects)
gcloud auth login
gcloud config set project <your cloud project>
gcloud config set compute/zone <zone name - eg. us-central1-a>
# Start local emulation of metadata service
node ./tools/metadata/server.js
IPython notebooks can be used to work against BigQuery APIs provided by DataLab.
# Run ipython with (transient) in-memory notebooks
ipym.sh
# Run ipython with notebooks in a cloud storage bucket
ipyc.sh
# Run ipython with notebooks in a local directory
ipy.sh <path to local notebooks dir>
Check out the sample notebooks in the sample directory to get started.
DataLab Server has a dependency on the 0mq messaging library used for communicating with language kernels via the IPython protocol. However, installing the bindings for 0mq available from NPM requires that the 0mq library already be installed and that pkg-config be available. Steps to setup:
- First setup prereqs
- Install Homebrew (http://brew.sh/)
- Install zeromq library and pkg-config:
brew install zeromq
- Next setup the environment
- Make sure pkg-config is available by adding Homebrew's binary path to
$PATH
:PATH=$PATH:/usr/local/bin
(add this to your~/.bashrc
configuration file) - Verify that pkg-config is available:
which pkg-config
- Make sure pkg-config is available by adding Homebrew's binary path to