Skip to content

Commit

Permalink
Merge pull request #74 from microsoft/master
Browse files Browse the repository at this point in the history
pull
  • Loading branch information
chicm-ms authored Mar 4, 2020
2 parents 16a1b27 + cdeafa6 commit e246633
Show file tree
Hide file tree
Showing 24 changed files with 12,790 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ build:
cp -rf src/nni_manager/config src/nni_manager/dist/
#$(_INFO) Building WebUI $(_END)
cd src/webui && $(NNI_YARN) && $(NNI_YARN) build
#$(_INFO) Building NAS UI $(_END)
cd src/nasui && $(NNI_YARN) && $(NNI_YARN) build

# All-in-one target for non-expert users
# Installs NNI as well as its dependencies, and update bashrc to set PATH
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- job: 'basic_test_pr_macOS'
pool:
vmImage: 'macOS 10.13'
vmImage: 'macOS-10.15'
strategy:
matrix:
Python36:
Expand All @@ -94,8 +94,8 @@ jobs:
python3 -m pip install torch==1.2.0 --user
python3 -m pip install torchvision==0.4.0 --user
python3 -m pip install tensorflow==1.13.1 --user
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
brew install swig@3
rm /usr/local/bin/swig
ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig
nnictl package install --name=SMAC
displayName: 'Install dependencies'
Expand Down
23 changes: 23 additions & 0 deletions src/nasui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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*
52 changes: 52 additions & 0 deletions src/nasui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"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",
"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"
}
Binary file added src/nasui/public/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions src/nasui/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!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>
27 changes: 27 additions & 0 deletions src/nasui/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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}.`);
});
38 changes: 38 additions & 0 deletions src/nasui/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
svg {
overflow: hidden;
}

.node {
white-space: nowrap;
}

.node.input rect, .node.output rect {
fill: #9d0f0f;
}

.node.hub rect {
fill: #0f309d;
}

.node.blob rect {
fill: #0F9D58;
}

.node text {
fill: #fff;
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
font-weight: 500;
}

.cluster rect {
stroke: #333;
fill: #000;
fill-opacity: 0.1;
stroke-width: 1.5px;
}

.edgePath path.path {
stroke: #333;
stroke-width: 1.5px;
fill: none;
}
Loading

0 comments on commit e246633

Please sign in to comment.