|
1 | 1 | # How to Develop TensorBoard
|
2 | 2 |
|
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 |
4 | 4 |
|
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. |
6 | 13 |
|
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: |
8 | 15 |
|
9 | 16 | ```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 |
11 | 21 | ```
|
12 | 22 |
|
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`: |
14 | 24 |
|
15 | 25 | ```sh
|
16 |
| -bazel run //tensorboard/plugins/scalar:scalars_demo |
| 26 | +(tf)$ bazel run //tensorboard/plugins/scalar:scalars_demo |
17 | 27 | ```
|
0 commit comments