-
Notifications
You must be signed in to change notification settings - Fork 249
Build and Run
This page outlines the steps to build the sources and run DataLab locally. As a starting point, make sure you have a fully initialized environment.
The first step is to build the individual components in the sources
directory.
cd sources
./build.sh
This should produce build outputs into the build
directory at the root of the repository.
The next step is to package those build outputs into a docker container. As an attempt to optimize the build process, first pull the last known good build of the previously deployed container.
cd $REPO_DIR/containers/datalab
sudo docker pull gcr.io/cloud_datalab/datalab:latest
./build.sh
You can run the docker container locally.
cd $REPO_DIR/containers/datalab
./run.sh [shell]
Then connect to http://127.0.0.1:8081/ from your browser.
The optional shell
flag causes the container to start, but stop at the command prompt inside the container, i.e. not start the DataLab server automatically. From within the shell, you can inspect the docker container content, manually start/stop DataLab without killing the running the container instance. This allows making tactical changes within the built container and re-running.
To run the unit tests:
cd $REPO_DIR/sources
./test.sh
The unit tests mock out access to BigQuery, GCS, etc, and so these are fairly superficial. Functional testing DataLab at this stage requires running and manually testing the product... specifically opening the sample notebooks and re-running them to ensure things work.
-
If you get 'connection refused' when connecting to http://127.0.0.1:8081/ on a Mac, make sure you have the necessary port forwarding rule in your VirtualBox settings for boot2docker-vm. Go to Applications - VirtualBox, select the boo2docker-vm, click Settings - Network - Port Forwarding, and make sure you have a rule to forward TCP port 8081 on Host IP 127.0.0.1 to guest port 8081. You may need to logout/login for the changes to take full effect.
-
If a timeout occurs when pulling an image in the build process, run:
boot2docker stop boot2docker delete boot2docker init boot2docker up