Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manager: add I/O for TensorboardInfo files #1806

Merged
merged 4 commits into from
Feb 7, 2019

Conversation

wchargin
Copy link
Contributor

@wchargin wchargin commented Feb 5, 2019

Summary:
This commit implements functions write_info_file, remove_info_file,
and get_all on the tensorboard.manager module. See docs for details.

Supersedes part of #1795.

Test Plan:
Integration tests included; run bazel test //tensorboard:manager_test.

wchargin-branch: tensorboardinfo-io

tensorboard/manager_test.py Outdated Show resolved Hide resolved
@wchargin wchargin changed the base branch from master to wchargin-cache-key-str February 5, 2019 04:42
@wchargin wchargin removed the request for review from nfelt February 5, 2019 19:52
@wchargin wchargin changed the base branch from wchargin-cache-key-str to master February 5, 2019 19:57
tensorboard/manager.py Show resolved Hide resolved
tensorboard/manager_test.py Show resolved Hide resolved
@wchargin wchargin force-pushed the wchargin-tensorboardinfo-io branch 2 times, most recently from 4a4ed31 to c62bcaa Compare February 6, 2019 16:08
@wchargin
Copy link
Contributor Author

wchargin commented Feb 6, 2019

@manivaradarajan, would you like me to wait for your review before
merging?

Summary:
This commit implements functions `write_info_file`, `remove_info_file`,
and `get_all` on the `tensorboard.manager` module. See docs for details.

Supersedes part of #1795.

Test Plan:
Integration tests included; run `bazel test //tensorboard:manager_test`.

wchargin-branch: tensorboardinfo-io
wchargin-branch: tensorboardinfo-io
Test Plan:
Fingers crossed (haven’t run locally; will see what Travis thinks).

wchargin-branch: tensorboardinfo-io
wchargin added a commit that referenced this pull request Feb 6, 2019
Summary:
This commit wires up `TensorBoard.main` to the `TensorboardInfo` I/O
introduced in #1806.

Test Plan:
Run `bazel run //tensorboard -- --logdir ./whatever/`, then verify that
an info file has been created…

    $ ls /tmp/.tensorboard-info/
    pid-85532.info

…and that the file is visible to the Python APIs:

    $ python
    >>> from tensorboard import manager
    >>> infos = manager.get_all()
    >>> len(infos)
    1
    >>> infos[0].pid
    85532
    >>> infos[0].port
    6006

Then, SIGTERM the server and verify that this is reflected from Python…

    >>> import os
    >>> os.kill(infos[0].pid, 15)
    >>> manager.get_all()
    []

…and that the underlying file is gone:

    $ ls /tmp/.tensorboard-info/ | wc -l
    0

wchargin-branch: write-tensorboardinfo
tensorboard/manager.py Show resolved Hide resolved
tensorboard/manager.py Outdated Show resolved Hide resolved
wchargin-branch: tensorboardinfo-io
@wchargin wchargin merged commit 20435a1 into master Feb 7, 2019
wchargin added a commit that referenced this pull request Feb 7, 2019
Summary:
This commit wires up `TensorBoard.main` to the `TensorboardInfo` I/O
introduced in #1806.

Test Plan:
Run `bazel run //tensorboard -- --logdir ./whatever/`, then verify that
an info file has been created…

    $ ls /tmp/.tensorboard-info/
    pid-85532.info

…and that the file is visible to the Python APIs:

    $ python
    >>> from tensorboard import manager
    >>> infos = manager.get_all()
    >>> len(infos)
    1
    >>> infos[0].pid
    85532
    >>> infos[0].port
    6006

Then, SIGTERM the server and verify that this is reflected from Python…

    >>> import os
    >>> os.kill(infos[0].pid, 15)
    >>> manager.get_all()
    []

…and that the underlying file is gone:

    $ ls /tmp/.tensorboard-info/ | wc -l
    0

wchargin-branch: write-tensorboardinfo
wchargin added a commit that referenced this pull request Feb 7, 2019
Summary:
This commit wires up `TensorBoard.main` to the `TensorboardInfo` I/O
introduced in #1806.

Test Plan:
Run `bazel run //tensorboard -- --logdir ./whatever/`, then verify that
an info file has been created…

    $ ls /tmp/.tensorboard-info/
    pid-85532.info

…and that the file is visible to the Python APIs:

    $ python
    >>> from tensorboard import manager
    >>> infos = manager.get_all()
    >>> len(infos)
    1
    >>> infos[0].pid
    85532
    >>> infos[0].port
    6006

Then, SIGTERM the server and verify that this is reflected from Python…

    >>> import os
    >>> os.kill(infos[0].pid, 15)
    >>> manager.get_all()
    []

…and that the underlying file is gone:

    $ ls /tmp/.tensorboard-info/ | wc -l
    0

wchargin-branch: write-tensorboardinfo
@wchargin wchargin deleted the wchargin-tensorboardinfo-io branch February 7, 2019 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants