Unverified Commit 5d0251fc authored by Yuge Zhang's avatar Yuge Zhang Committed by GitHub
Browse files

Remove NAS UI (#4088)

parent 52b70bc1
......@@ -5,7 +5,7 @@ tensorflow
keras == 2.4.3
torch == 1.9.0+cu111
torchvision == 0.10.0+cu111
pytorch-lightning >= 1.2.8
pytorch-lightning >= 1.4.2
onnx
peewee
graphviz
......
......@@ -52,7 +52,6 @@ TypeScript (Linux and macOS)
* If ``ts/nni_manager`` is changed, run ``yarn watch`` under this folder. It will watch and build code continually. The ``nnictl`` need to be restarted to reload NNI manager.
* If ``ts/webui`` is changed, run ``yarn dev``\ , which will run a mock API server and a webpack dev server simultaneously. Use ``EXPERIMENT`` environment variable (e.g., ``mnist-tfv1-running``\ ) to specify the mock data being used. Built-in mock experiments are listed in ``src/webui/mock``. An example of the full command is ``EXPERIMENT=mnist-tfv1-running yarn dev``.
* If ``ts/nasui`` is changed, run ``yarn start`` under the corresponding folder. The web UI will refresh automatically if code is changed. There is also a mock API server that is useful when developing. It can be launched via ``node server.js``.
TypeScript (Windows)
********************
......
......@@ -12,7 +12,7 @@ from .updater import update_searchspace, update_concurrency, update_duration, up
from .nnictl_utils import stop_experiment, trial_ls, trial_kill, list_experiment, experiment_status,\
log_trial, experiment_clean, platform_clean, experiment_list, \
monitor_experiment, export_trials_data, trial_codegen, webui_url, \
get_config, log_stdout, log_stderr, search_space_auto_gen, webui_nas, \
get_config, log_stdout, log_stderr, search_space_auto_gen, \
save_experiment, load_experiment
from .algo_management import algo_reg, algo_unreg, algo_show, algo_list
from .constants import DEFAULT_REST_PORT
......@@ -188,10 +188,6 @@ def parse_args():
parser_webui_url = parser_webui_subparsers.add_parser('url', help='show the url of web ui')
parser_webui_url.add_argument('id', nargs='?', help='the id of experiment')
parser_webui_url.set_defaults(func=webui_url)
parser_webui_nas = parser_webui_subparsers.add_parser('nas', help='show nas ui')
parser_webui_nas.add_argument('--port', default=6060, type=int, help='port of nas ui')
parser_webui_nas.add_argument('--logdir', default='.', type=str, help='the logdir where nas ui will read data')
parser_webui_nas.set_defaults(func=webui_nas)
#parse config command
parser_config = subparsers.add_parser('config', help='get config information')
......
......@@ -13,7 +13,6 @@ import traceback
from datetime import datetime, timezone
from subprocess import Popen
from nni.tools.annotation import expand_annotations
import nni_node # pylint: disable=wrong-import-order, import-error
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
......@@ -457,21 +456,6 @@ def webui_url(args):
experiments_dict = Experiments().get_all_experiments()
print_normal('{0} {1}'.format('Web UI url:', ' '.join(experiments_dict[experiment_id].get('webuiUrl'))))
def webui_nas(args):
'''launch nas ui'''
print_normal('Starting NAS UI...')
try:
entry_dir = nni_node.__path__[0]
entry_file = os.path.join(entry_dir, 'nasui', 'server.js')
if sys.platform == 'win32':
node_command = os.path.join(entry_dir, 'node.exe')
else:
node_command = os.path.join(entry_dir, 'node')
cmds = [node_command, '--max-old-space-size=4096', entry_file, '--port', str(args.port), '--logdir', args.logdir]
subprocess.run(cmds, cwd=entry_dir)
except KeyboardInterrupt:
pass
def local_clean(directory):
'''clean up local data'''
print_normal('removing folder {0}'.format(directory))
......
......@@ -136,7 +136,7 @@ def trial_keeper_help_info(*args):
def check_version(args):
try:
trial_keeper_version = pkg_resources.get_distribution('nni').version
except pkg_resources.ResolutionError as err:
except pkg_resources.ResolutionError:
# package nni does not exist, try nni-tool package
nni_log(LogType.Error, 'Package nni does not exist!')
os._exit(1)
......
......@@ -103,7 +103,7 @@ def trial_runner_help_info(*args):
def check_version(args):
try:
trial_runner_version = pkg_resources.get_distribution('nni').version
except pkg_resources.ResolutionError as err:
except pkg_resources.ResolutionError:
# package nni does not exist, try nni-tool package
nni_log(LogType.Error, 'Package nni does not exist!')
os._exit(1)
......
......@@ -191,8 +191,6 @@ stages:
set -e
cd ts/nni_manager
yarn test
cd ../nasui
CI=true yarn test
displayName: TypeScript unit test
- task: PublishTestResults@2
......@@ -295,8 +293,6 @@ stages:
set -e
cd ts/nni_manager
yarn test
cd ../nasui
CI=true yarn test
displayName: TypeScript unit test
- job: macos
......@@ -356,7 +352,6 @@ stages:
set -e
export CI=true
(cd ts/nni_manager && yarn test --exclude test/core/nnimanager.test.ts)
(cd ts/nasui && yarn test)
displayName: TypeScript unit test
- script: |
......
......@@ -46,7 +46,6 @@ jobs:
export PATH=$PATH:$PWD/toolchain/yarn/bin
export CI=true
(cd ts/nni_manager && yarn test)
(cd ts/nasui && yarn test)
displayName: Unit test
continueOnError: true
......
......@@ -149,10 +149,6 @@ def compile_ts():
_yarn('ts/webui')
_yarn('ts/webui', 'build')
_print('Building NAS UI')
_yarn('ts/nasui')
_yarn('ts/nasui', 'build')
_print('Building JupyterLab extension')
_yarn('ts/jupyter_extension')
_yarn('ts/jupyter_extension', 'build')
......@@ -172,10 +168,6 @@ def symlink_nni_node():
_symlink('ts/webui/build', 'nni_node/static')
Path('nni_node/nasui').mkdir(exist_ok=True)
_symlink('ts/nasui/build', 'nni_node/nasui/build')
_symlink('ts/nasui/server.js', 'nni_node/nasui/server.js')
_symlink('ts/jupyter_extension/dist', 'nni_node/jupyter-extension')
......@@ -207,10 +199,6 @@ def copy_nni_node(version):
shutil.copytree('ts/webui/build', 'nni_node/static')
Path('nni_node/nasui').mkdir(exist_ok=True)
shutil.copytree('ts/nasui/build', 'nni_node/nasui/build')
shutil.copyfile('ts/nasui/server.js', 'nni_node/nasui/server.js')
shutil.copytree('ts/jupyter_extension/dist', 'nni_node/jupyter-extension')
......@@ -245,8 +233,6 @@ generated_files = [
'ts/nni_manager/node_modules',
'ts/webui/build',
'ts/webui/node_modules',
'ts/nasui/build',
'ts/nasui/node_modules',
# unit test
'ts/nni_manager/.nyc_output',
......
$CWD = $PWD
$ErrorActionPreference = "Stop"
# -------------For python unittest-------------
## ------Run annotation test------
echo ""
echo "===========================Testing: nni_annotation==========================="
cd $CWD/../tools/
cmd /c "python -m unittest -v nni_annotation/test_annotation.py 2>&1"
if ($LASTEXITCODE -ne 0) {
throw "Exit code $LASTEXITCODE"
}
## Export certain environment variables for unittest code to work
$env:NNI_TRIAL_JOB_ID="test_trial_job_id"
$env:NNI_PLATFORM="unittest"
## ------Run sdk test------
echo ""
echo "===========================Testing: nni_sdk==========================="
cd $CWD/../src/sdk/pynni/
cmd /c "python -m unittest discover -v tests 2>&1"
if ($LASTEXITCODE -ne 0) {
throw "Exit code $LASTEXITCODE"
}
# -------------For typescript unittest-------------
cd $CWD/../src/nni_manager
echo ""
echo "===========================Testing: nni_manager==========================="
cmd /c "npm run test 2>&1"
# don't check now. adding back later.
# if ($LASTEXITCODE -ne 0) {
# throw "Exit code $LASTEXITCODE"
# }
#!/bin/bash
set -e
CWD=${PWD}
# -------------For python unittest-------------
## ------Run annotation test------
echo ""
echo "===========================Testing: nni_annotation==========================="
#cd ${CWD}/../tools/
#python3 -m unittest -v nni_annotation/test_annotation.py
## Export certain environment variables for unittest code to work
export NNI_TRIAL_JOB_ID=test_trial_job_id
export NNI_PLATFORM=unittest
## ------Run sdk test------
echo ""
echo "===========================Testing: nni_sdk==========================="
#cd ${CWD}/../src/sdk/pynni/
#python3 -m unittest discover -v tests
# -------------For typescript unittest-------------
#cd ${CWD}/../ts/nni_manager
echo ""
echo "===========================Testing: nni_manager==========================="
#npm run test
# -------------For NASUI unittest-------------
#cd ${CWD}/../ts/nasui
echo ""
echo "===========================Testing: nasui==========================="
#CI=true npm test
## ------Run nnictl unit test------
echo ""
echo "===========================Testing: nnictl==========================="
#cd ${CWD}/../tools/nni_cmd/
#python3 -m unittest discover -v tests
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"name": "nasnni-vis-ts",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.9.3",
"@material-ui/icons": "^4.9.1",
"cytoscape": "^3.14.0",
"cytoscape-dagre": "^2.2.2",
"cytoscape-panzoom": "^2.5.3",
"express": "^4.17.1",
"lodash": "^4.17.15",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.4.0",
"typeface-roboto": "^0.0.75",
"typescript": "~3.7.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"eject": "react-scripts eject",
"test": "react-scripts test",
"backend": "node server.js"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"@types/cytoscape": "^3.14.0",
"@types/jest": "^24.0.0",
"@types/lodash": "^4.14.149",
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0"
},
"proxy": "http://localhost:8080"
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/icon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<title>NNI NAS Board</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
const express = require('express');
const path = require('path');
const fs = require('fs');
const app = express();
const argv = require('minimist')(process.argv.slice(2));
const port = argv.port || 8080;
const logdir = argv.logdir || './mockdata';
app.use(express.static(path.join(__dirname, 'build')));
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
app.get('/refresh', (req, res) => {
const graph = fs.readFileSync(path.join(logdir, 'graph.json'), 'utf8');
const log = fs.readFileSync(path.join(logdir, 'log'), 'utf-8')
.split('\n')
.filter(Boolean)
.map(JSON.parse);
res.send({
'graph': JSON.parse(graph),
'log': log,
});
});
app.listen(port, '0.0.0.0', () => {
console.log(`NNI NAS board is running on port ${port}, logdir is ${logdir}.`);
});
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