diff --git a/docs/en_US/Tutorial/Nnictl.rst b/docs/en_US/Tutorial/Nnictl.rst index 98cf1a62bc..4b3d40f7b2 100644 --- a/docs/en_US/Tutorial/Nnictl.rst +++ b/docs/en_US/Tutorial/Nnictl.rst @@ -28,7 +28,6 @@ nnictl support commands: * `nnictl config <#config>`__ * `nnictl log <#log>`__ * `nnictl webui <#webui>`__ -* `nnictl tensorboard <#tensorboard>`__ * `nnictl algo <#algo>`__ * `nnictl ss_gen <#ss_gen>`__ * `nnictl --version <#version>`__ @@ -1311,97 +1310,6 @@ Manage webui - Experiment ID -:raw-html:`` - -Manage tensorboard -^^^^^^^^^^^^^^^^^^ - - -* - **nnictl tensorboard start** - - - * - Description - - Start the tensorboard process. - - * - Usage - - .. code-block:: bash - - nnictl tensorboard start - - * - Options - -.. list-table:: - :header-rows: 1 - :widths: auto - - * - Name, shorthand - - Required - - Default - - Description - * - id - - False - - - - ID of the experiment you want to set - * - --trial_id, -T - - False - - - - ID of the trial - * - --port - - False - - 6006 - - The port of the tensorboard process - - - -* - Detail - - - #. NNICTL support tensorboard function in local and remote platform for the moment, other platforms will be supported later. - #. If you want to use tensorboard, you need to write your tensorboard log data to environment variable [NNI_OUTPUT_DIR] path. - #. In local mode, nnictl will set --logdir=[NNI_OUTPUT_DIR] directly and start a tensorboard process. - #. In remote mode, nnictl will create a ssh client to copy log data from remote machine to local temp directory firstly, and then start a tensorboard process in your local machine. You need to notice that nnictl only copy the log data one time when you use the command, if you want to see the later result of tensorboard, you should execute nnictl tensorboard command again. - #. If there is only one trial job, you don't need to set trial id. If there are multiple trial jobs running, you should set the trial id, or you could use [nnictl tensorboard start --trial_id all] to map --logdir to all trial log paths. - - -* - **nnictl tensorboard stop** - - - * - Description - - Stop all of the tensorboard process. - - * - Usage - - .. code-block:: bash - - nnictl tensorboard stop - - * - Options - -.. list-table:: - :header-rows: 1 - :widths: auto - - * - Name, shorthand - - Required - - Default - - Description - * - id - - False - - - - ID of the experiment you want to set - :raw-html:`` diff --git a/nni/tools/nnictl/common_utils.py b/nni/tools/nnictl/common_utils.py index ba4aad7233..3667f8adfd 100644 --- a/nni/tools/nnictl/common_utils.py +++ b/nni/tools/nnictl/common_utils.py @@ -81,14 +81,6 @@ def get_user(): else: return os.environ['USER'] -def check_tensorboard_version(): - try: - import tensorboard - return tensorboard.__version__ - except: - print_error('import tensorboard error!') - exit(1) - def generate_temp_dir(): '''generate a temp folder''' def generate_folder_name(): diff --git a/nni/tools/nnictl/nnictl.py b/nni/tools/nnictl/nnictl.py index dbdae0d84d..fd8697337e 100644 --- a/nni/tools/nnictl/nnictl.py +++ b/nni/tools/nnictl/nnictl.py @@ -16,7 +16,6 @@ save_experiment, load_experiment from .algo_management import algo_reg, algo_unreg, algo_show, algo_list from .constants import DEFAULT_REST_PORT -from .tensorboard_utils import start_tensorboard, stop_tensorboard init(autoreset=True) if os.environ.get('COVERAGE_PROCESS_START'): @@ -250,18 +249,6 @@ def show_messsage_for_nnictl_package(args): parser_package_subparsers.add_argument('args', nargs=argparse.REMAINDER) parser_package_subparsers.set_defaults(func=show_messsage_for_nnictl_package) - #parse tensorboard command - parser_tensorboard = subparsers.add_parser('tensorboard', help='manage tensorboard') - parser_tensorboard_subparsers = parser_tensorboard.add_subparsers() - parser_tensorboard_start = parser_tensorboard_subparsers.add_parser('start', help='start tensorboard') - parser_tensorboard_start.add_argument('id', nargs='?', help='the id of experiment') - parser_tensorboard_start.add_argument('--trial_id', '-T', dest='trial_id', help='the id of trial') - parser_tensorboard_start.add_argument('--port', dest='port', default=6006, type=int, help='the port to start tensorboard') - parser_tensorboard_start.set_defaults(func=start_tensorboard) - parser_tensorboard_stop = parser_tensorboard_subparsers.add_parser('stop', help='stop tensorboard') - parser_tensorboard_stop.add_argument('id', nargs='?', help='the id of experiment') - parser_tensorboard_stop.set_defaults(func=stop_tensorboard) - #parse top command parser_top = subparsers.add_parser('top', help='monitor the experiment') parser_top.add_argument('--time', '-t', dest='time', type=int, default=3, help='the time interval to update the experiment status, ' \ diff --git a/nni/tools/nnictl/nnictl_utils.py b/nni/tools/nnictl/nnictl_utils.py index 9637ecb2e7..16942b74ef 100644 --- a/nni/tools/nnictl/nnictl_utils.py +++ b/nni/tools/nnictl/nnictl_utils.py @@ -223,14 +223,6 @@ def stop_experiment(args): rest_pid = experiments_dict.get(experiment_id).get('pid') if rest_pid: kill_command(rest_pid) - tensorboard_pid_list = experiments_dict.get(experiment_id).get('tensorboardPidList') - if tensorboard_pid_list: - for tensorboard_pid in tensorboard_pid_list: - try: - kill_command(tensorboard_pid) - except Exception as exception: - print_error(exception) - experiments_config.update_experiment(experiment_id, 'tensorboardPidList', []) print_normal('Stop experiment success.') def trial_ls(args): diff --git a/nni/tools/nnictl/tensorboard_utils.py b/nni/tools/nnictl/tensorboard_utils.py deleted file mode 100644 index fe8262c355..0000000000 --- a/nni/tools/nnictl/tensorboard_utils.py +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT license. - -import os -import json -import re -import tempfile -from subprocess import call, Popen -from .rest_utils import rest_get, check_rest_server_quick, check_response -from .config_utils import Config, Experiments -from .url_utils import trial_jobs_url, get_local_urls -from .constants import REST_TIME_OUT -from .common_utils import print_normal, print_warning, print_error, print_green, detect_process, detect_port, check_tensorboard_version -from .nnictl_utils import check_experiment_id -from .ssh_utils import create_ssh_sftp_client, copy_remote_directory_to_local - -def parse_log_path(args, trial_content): - '''parse log path''' - path_list = [] - host_list = [] - for trial in trial_content: - if args.trial_id and args.trial_id != 'all' and trial.get('trialJobId') != args.trial_id: - continue - pattern = r'(?P
.+)://(?P