This Vagrant configuration allows you to run TensorFlow Docker image (from the Udacity Deep Learning course authors) on your Windows machine and share the assignments
folder on the Windows machine with the TensorFlow Docker container, so that all your work will stay on your Windows machine.
As Docker runs on Linux containers we would need to run a Linux Virtual Machine(VM) to be able to run Docker images. So first install Vagrant.
Before you run VM, make sure you have enough RAM and CPUs on your Windows machine. Current Vagrant configuration will use 2 CPUs and 8GB of RAM to run VM (Deep Learning course authors recommend using 8G). You can fix these numbers in Vagrantfile.
Make sure the following ports are not occupied by any other process and are free to use by VM:
- 2222 - used to SSH into VM
- 6006 - reserved for TensorBoard
- 8888 - used by Jupyter Notebook
-
Clone this repository:
> git clone https://github.com/dimchansky/tensorflow-udacity-vagrant
-
Run VM with the Docker image (all Vagrant commands need to be run from the folder you've cloned repository to):
> vagrant up tensorflow-udacity
-
When VM is ready, open http://localhost:8888/ in your browser.
-
At this point TensorFlow is almost ready, but you need to copy the assignments from Docker image to shared working folder (
assignments
folder on your Windows machine). So press the New button on the TensorFlow page in your browser and then press Terminal. Type the following commands in the Terminal:# cp -a /notebooks/. /assignments # chmod -R 666 /assignments # exit
After this you can close the Terminal page and goto http://localhost:8888/. Now you should see all the assignments and are ready to get to work.
When you're done with you work you can destroy docker container and halt the VM:
> vagrant destroy tensorflow-udacity
> vagrant halt
Please note that all your files will stay in ./assignments
folder on your Windows machine.
Next time you can run Docker container in the VM just by running the command:
> vagrant up tensorflow-udacity
The second time it will start faster, because it's already configured. When VM is ready just open http://localhost:8888/ in your browser and you'll see all your files from the assignments folder.
> vagrant docker-logs
command can be used to see the logs of a running TensorFlow Notebook. It can be useful to troubleshoot TensorFlow problems.
You can SSH into the VM by running the command (you should have ssh.exe in your Windows path):
> ssh vagrant@localhost -p 2222
The password is vagrant
.
After you SSH into the VM you can run bash
in the TensorFlow docker container by running the command:
$ docker exec -it tensorflow-udacity bash
The VM takes about 3GB on your disk (check your %USERPROFILE%/VirtualBox VMs
folder). You can destroy this image when you're done with the course. All your assignments will stay in ./assignments
folder on your Windows machine.
> vagrant destroy
You can also remove vagrant box that had been used to create a VM. The following command will show you all the boxes installed on your machine:
> vagrant box list
You should see something like:
phusion/ubuntu-14.04-amd64 (virtualbox, 2014.04.30)
Run the following command to remove the phusion/ubuntu-14.04-amd64
box:
> vagrant box remove phusion/ubuntu-14.04-amd64