Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Development Environment

Brandon Dutra edited this page Jun 19, 2017 · 23 revisions

This page outlines the steps to creating a working development environment for working with the DataLab repository.

Dependencies

This is a list of thing you'll need to setup ... more details on each further below.

  • Python 2.7.x, various python libraries for data analysis and datalab dependencies, and IPython 4.2.x
  • Node.js 6.10.x (the frontend web server is built in node.js) and supporting tools.
  • Bower and the Polymer CLI are used for building the new experimental UI.
  • Google Cloud SDK for all things Google Cloud Platform related.
  • Docker for creating and running the datalab container.

Python

On a Mac, the easiest way to perhaps get IPython and associated dependencies is to use a python distribution ... like the miniconda. This allows easy setup of python and required dependencies. 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).

# Mac
mkdir ~/tools
wget -O ~/tools/miniconda.sh \
    http://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh
chmod +x ~/tools/miniconda.sh && ~/tools/miniconda.sh
~/tools/miniconda/bin/conda update -all -y
~/tools/miniconda/bin/conda install -y \
    pip ipython=4.2 jinja2 pyzmq tornado requests mock
~/tools/miniconda/bin/pip install httplib2 oauth2client

# add to ~/.bashrc
export PATH=~/tools/miniconda/bin:$PATH

# Linux
Use https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh instead

Node.js

First install node.js. This installs the node and npm.

mkdir -p ~/tools/node
wget -nv https://nodejs.org/dist/v6.10.0/node-v6.10.0-linux-x64.tar.gz -O node.tar.gz
tar xzf node.tar.gz -C ~/tools/node --strip-components=1
rm node.tar.gz

# add to ~/.bashrc
export PATH=~/tools/node/bin:$PATH

Next install the TypeScript compiler (which compiles typescript into javascript), Bower, and the Polymer CLI:

sudo npm install -g typescript bower polymer-cli

Google Cloud SDK

Additionally you'll need the Google Cloud SDK locally installed and configured.

# Install gcloud - [more info](https://cloud.google.com/sdk/)
curl https://sdk.cloud.google.com | bash

# 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>

Docker

Finally, you'll want to setup docker to build and run the docker container. You can get it here.

You can read on docker here.

Next Steps

You should now be set to build and run DataLab in your development environment. Also, be sure to checkout the page on developer workflow for how we manage the development process.

Clone this wiki locally