"test/vscode:/vscode.git/clone" did not exist on "4bde67c4d82c49b0c2b2fe5253ca7f775dba5122"
Unverified Commit 80b6cb3b authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

Merge pull request #3030 from microsoft/v2.0

Merge v2.0 into master
parents 77dac12b ff1af7f2
......@@ -3,7 +3,7 @@
import ast
import astor
from nni_cmd.common_utils import print_warning
from nni.tools.nnictl.common_utils import print_warning
from .utils import ast_Num, ast_Str
......
......@@ -6,7 +6,7 @@ import logging
import os
import netifaces
from schema import Schema, And, Optional, Regex, Or, SchemaError
from nni.package_utils import create_validator_instance, get_all_builtin_names, get_builtin_algo_meta
from nni.tools.package_utils import create_validator_instance, get_all_builtin_names, get_builtin_algo_meta
from .constants import SCHEMA_TYPE_ERROR, SCHEMA_RANGE_ERROR, SCHEMA_PATH_ERROR
from .common_utils import get_yml_content, print_warning
......
......@@ -9,8 +9,9 @@ import random
import time
import tempfile
from subprocess import Popen, check_call, CalledProcessError, PIPE, STDOUT
from nni_annotation import expand_annotations, generate_search_space
from nni.package_utils import get_builtin_module_class_name, get_nni_installation_path
from nni.tools.annotation import expand_annotations, generate_search_space
from nni.tools.package_utils import get_builtin_module_class_name
import nni_node
from .launcher_utils import validate_all_content
from .rest_utils import rest_put, rest_post, check_rest_server, check_response
from .url_utils import cluster_metadata_url, experiment_url, get_local_urls
......@@ -52,15 +53,16 @@ def start_rest_server(port, platform, mode, config_file_name, foreground=False,
print_normal('Starting restful server...')
entry_dir = get_nni_installation_path()
entry_dir = nni_node.__path__[0]
if (not entry_dir) or (not os.path.exists(entry_dir)):
print_error('Fail to find nni under python library')
exit(1)
entry_file = os.path.join(entry_dir, 'main.js')
node_command = 'node'
if sys.platform == 'win32':
node_command = os.path.join(entry_dir[:-3], 'Scripts', 'node.exe')
node_command = os.path.join(entry_dir, 'node.exe')
else:
node_command = 'node'
cmds = [node_command, '--max-old-space-size=4096', entry_file, '--port', str(port), '--mode', platform]
if mode == 'view':
cmds += ['--start_mode', 'resume']
......
......@@ -13,8 +13,8 @@ from functools import cmp_to_key
from datetime import datetime, timezone
from subprocess import Popen
from pyhdfs import HdfsClient
from nni.package_utils import get_nni_installation_path
from nni_annotation import expand_annotations
from nni.tools.annotation import expand_annotations
import nni_node
from .rest_utils import rest_get, rest_delete, check_rest_server_quick, check_response
from .url_utils import trial_jobs_url, experiment_url, trial_job_id_url, export_data_url, metric_data_url
from .config_utils import Config, Experiments
......@@ -424,13 +424,14 @@ def webui_nas(args):
'''launch nas ui'''
print_normal('Starting NAS UI...')
try:
entry_dir = get_nni_installation_path()
entry_dir = nni_node.__path__[0]
entry_file = os.path.join(entry_dir, 'nasui', 'server.js')
node_command = 'node'
if sys.platform == 'win32':
node_command = os.path.join(entry_dir[:-3], 'Scripts', 'node.exe')
node_command = os.path.join(entry_dir, 'node.exe')
else:
node_command = 'node'
cmds = [node_command, '--max-old-space-size=4096', entry_file, '--port', str(args.port), '--logdir', args.logdir]
subprocess.run(cmds)
subprocess.run(cmds, cwd=entry_dir)
except KeyboardInterrupt:
pass
......
......@@ -6,7 +6,7 @@ from collections import defaultdict
import json
import pkginfo
import nni
from nni.package_utils import read_installed_package_meta, get_installed_package_meta, \
from nni.tools.package_utils import read_installed_package_meta, get_installed_package_meta, \
write_package_meta, get_builtin_algo_meta, get_not_installable_builtin_names, ALGO_TYPES
from .constants import INSTALLABLE_PACKAGE_META
......@@ -19,7 +19,7 @@ def install_by_name(package_name):
if package_name not in INSTALLABLE_PACKAGE_META:
raise RuntimeError('{} is not found in installable packages!'.format(package_name))
requirements_path = os.path.join(nni.__path__[0], INSTALLABLE_PACKAGE_META[package_name]['code_sub_dir'], 'requirements.txt')
requirements_path = os.path.join(nni.__path__[0], 'algorithms/hpo', INSTALLABLE_PACKAGE_META[package_name]['code_sub_dir'], 'requirements.txt')
assert os.path.exists(requirements_path)
return install_requirements_command(requirements_path)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment