Skip to content

Commit c2a8373

Browse files
authored
Clarify DEVELOPMENT.md from a new dev perspective (#622)
This clarifies some things that I encountered - in particular, it specifies that you'll probably want TensorFlow installed in a virtualenv, and it updates the advice about getting the nightly build now that tf-nightly is on pypi (https://pypi.python.org/pypi/tf-nightly). It also links to Bazel installation instructions just for the sake of being explicit.
1 parent bb26115 commit c2a8373

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

DEVELOPMENT.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
# How to Develop TensorBoard
22

3-
TensorBoard at HEAD relies on the nightly installation of TensorFlow, so please install TensorFlow nightly for development. To install TensorFlow nightly, `pip install` the link to the [appropriate whl file listed at the TensorFlow repository](https://github.com/tensorflow/tensorflow).
3+
TensorBoard at HEAD relies on the nightly installation of TensorFlow: this allows plugin authors to use the latest features of TensorFlow, but it means release versions of TensorFlow may not suffice for development. We recommend installing TensorFlow nightly in a [Python virtualenv](https://virtualenv.pypa.io), and then running your modified development copy of TensorBoard within that virtualenv. To install TensorFlow nightly within the virtualenv, you can simply run
44

5-
Our decision to develop on TensorFlow nightly has pros and cons. A main advantage is that plugin authors can use the latest features of TensorFlow. A disadvantage is that the previous release of TensorFlow does not suffice for development.
5+
```sh
6+
$ virtualenv tf
7+
$ source tf/bin/activate
8+
(tf)$ pip install --upgrade pip
9+
(tf)$ pip install tf-nightly
10+
```
11+
12+
TensorBoard builds are done with [Bazel](https://bazel.build), so you may need to [install Bazel](https://docs.bazel.build/versions/master/install.html). The Bazel build will automatically "vulcanize" all the HTML files and generate a "binary" launcher script. When HTML is vulcanized, it means all the script tags and HTML imports are inlined into one big HTML file. Then the Bazel build puts that index.html file inside a static assets zip. The python HTTP server then reads static assets from that zip while serving.
613

7-
Running TensorBoard automatically asks Bazel to create a vulcanized HTML binary:
14+
You can build and run TensorBoard via Bazel (from within the TensorFlow nightly virtualenv) as follows:
815

916
```sh
10-
bazel run //tensorboard -- --logdir /path/to/logs
17+
(tf)$ bazel build tensorboard
18+
(tf)$ ./bazel-bin/tensorboard/tensorboard --logdir path/to/logs
19+
# Or combine the above steps as:
20+
(tf)$ bazel run //tensorboard -- --logdir /path/to/logs
1121
```
1222

13-
To generate fake data for a plugin, run its demo script. For instance, this command generates fake scalar data in `/tmp/scalars_demo`:
23+
To generate fake log data for a plugin, run its demo script. For instance, this command generates fake scalar data in `/tmp/scalars_demo`:
1424

1525
```sh
16-
bazel run //tensorboard/plugins/scalar:scalars_demo
26+
(tf)$ bazel run //tensorboard/plugins/scalar:scalars_demo
1727
```

0 commit comments

Comments
 (0)