Commit 33f35014 authored by Zejun Lin's avatar Zejun Lin Committed by fishyds
Browse files

Update Makefile (#151)

* test

* update setup.py

* update Makefile and install.sh

* rever setup.py

* change color

* update doc

* update doc

* fix auto-completion's extra space

* update Makefile

* update webui
parent 46954344
......@@ -122,7 +122,7 @@ easy-install: install
easy-install: update-bash-config
easy-install:
#$(_INFO) Complete! #(_END)
#$(_INFO) Complete! $(_END)
# Target for setup.py
......@@ -203,21 +203,22 @@ install-dependencies: $(NODE_TARBALL) $(YARN_TARBALL) $(SERVE_TARBALL)
.PHONY: install-python-modules
install-python-modules:
#$(_INFO) Installing Python SDK $(_END)
cd src/sdk/pynni && python3 setup.py install $(PIP_MODE)
cd src/sdk/pynni && $(PIP_INSTALL) $(PIP_MODE) .
#$(_INFO) Installing nnictl $(_END)
cd tools && python3 setup.py install $(PIP_MODE)
cd tools && $(PIP_INSTALL) $(PIP_MODE) .
.PHONY: install-node-modules
install-node-modules:
mkdir -p $(INSTALL_PREFIX)/nni
rm -rf ${PWD}/src/nni_manager/dist/node_modules
#$(_INFO) Installing NNI Manager $(_END)
cp -rT src/nni_manager/dist $(INSTALL_PREFIX)/nni/nni_manager
cp -rT src/nni_manager/node_modules $(INSTALL_PREFIX)/nni/nni_manager/node_modules
cp -rT ${PWD}/src/nni_manager/dist $(INSTALL_PREFIX)/nni/nni_manager
cp -rT ${PWD}/src/nni_manager/node_modules $(INSTALL_PREFIX)/nni/nni_manager/node_modules
#$(_INFO) Installing Web UI $(_END)
cp -rT src/webui/build $(INSTALL_PREFIX)/nni/webui
cp -rT ${PWD}/src/webui/build $(INSTALL_PREFIX)/nni/webui
.PHONY: install-dev-modules
......@@ -231,11 +232,11 @@ install-dev-modules:
mkdir -p $(INSTALL_PREFIX)/nni
#$(_INFO) Installing NNI Manager $(_END)
ln -sf $(PWD)/src/nni_manager/dist $(INSTALL_PREFIX)/nni/nni_manager
ln -sf $(PWD)/src/nni_manager/node_modules $(INSTALL_PREFIX)/nni/nni_manager/node_modules
ln -sf ${PWD}/src/nni_manager/dist $(INSTALL_PREFIX)/nni/nni_manager
ln -sf ${PWD}/src/nni_manager/node_modules $(INSTALL_PREFIX)/nni/nni_manager/node_modules
#$(_INFO) Installing Web UI $(_END)
ln -sf $(PWD)/src/webui/build $(INSTALL_PREFIX)/nni/webui
ln -sf ${PWD}/src/webui/build $(INSTALL_PREFIX)/nni/webui
.PHONY: install-scripts
......
......@@ -13,7 +13,7 @@ The targets will be detailed later.
## Dependencies
NNI requires at least Node.js, Yarn, and setuptools to build, while PIP and TypeScript are also recommended.
NNI requires at least Node.js, Yarn, and PIP to build, while TypeScript is also recommended.
NNI requires Node.js, serve, and all dependency libraries to run.
Required Node.js libraries (including TypeScript) can be installed by Yarn, and required Python libraries can be installed by setuptools or PIP.
......
#!/bin/bash
make install-dependencies
make build
make dev-install
make install-examples
make update-bash-config
make easy-install
source ~/.bashrc
......@@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"antd": "^3.9.3",
"antd": "^3.8.1",
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"echarts": "^4.1.0",
......
......@@ -11,7 +11,7 @@ class SlideBar extends React.Component<{}, {}> {
<ul className="nav">
<li>
<IndexLink to={'/oview'} activeClassName="high">
<Icon className="icon" type="experiment" theme="outlined" />Overview
<Icon className="icon" type="rocket" />Overview
<Icon className="floicon" type="right" />
</IndexLink>
</li>
......@@ -41,7 +41,7 @@ class SlideBar extends React.Component<{}, {}> {
</li>
<li>
<a href="https://github.com/Microsoft/nni/issues" target="_blank">
<Icon className="icon" type="smile" theme="outlined" />Feedback
<Icon className="icon" type="smile" />Feedback
</a>
</li>
</ul>
......
##NNI CTL
## NNI CTL
The NNI CTL module is used to control Neural Network Intelligence, including start a new experiment, stop an experiment and update an experiment etc.
##Environment
## Environment
```
Ubuntu 16.04 or other Linux OS
python >= 3.5
```
##Installation
1.Enter tools directory
## Installation
2.Use pip3 to install packages
1. Enter tools directory
2.1 Install for current user:
2. Use pip3 to install packages
* Install for current user:
pip3 install --user -e .
2.2 Install for all users:
* Install for all users:
pip3 install -e .
3.Change the mode of nnictl file
1. Change the mode of nnictl file
chmod +x ./nnictl
4.Add nnictl to your PATH system environment variable.
2. Add nnictl to your PATH system environment variable.
* You could use `export` command to set PATH variable temporary.
......@@ -43,7 +44,8 @@ python >= 3.5
3.source /etc/profile
##To start using NNI CTL
## To start using NNI CTL
please reference to the [NNI CTL document].
......
......@@ -81,4 +81,4 @@ _nnictl()
fi
}
complete -F _nnictl nnictl
complete -o nospace -F _nnictl nnictl
__nnictl_cmds="create resume update stop trial webui experiment config rest log"
__nnictl_create_cmds="--config --webuiport"
__nnictl_resume_cmds="--experiment --manager --webuiport"
__nnictl_update_cmds="searchspace concurrency duration"
__nnictl_update_searchspace_cmds="--filename"
__nnictl_update_concurrency_cmds="--value"
__nnictl_update_duration_cmds="--value"
__nnictl_trial_cmds="ls kill"
__nnictl_trial_kill_cmds="--trialid"
__nnictl_webui_cmds="start stop url"
__nnictl_webui_start_cmds="--port"
__nnictl_experiment_cmds="show"
__nnictl_config_cmds="show"
__nnictl_rest_cmds="check"
__nnictl_log_cmds="stdout stderr"
__nnictl_log_stdout_cmds="--tail --head --path"
__nnictl_log_stderr_cmds="--tail --head --path"
__nnictl_remain_args()
{
ret=${!1} # ret = $__nnictl_xxx_cmds
# for arg in COMP_WORDS[:-1]:
for arg in "${COMP_WORDS[@]::${#COMP_WORDS[@]}-1}"; do
# remove previously set argument from ret
if [[ $arg == --* ]]; then
ret=${ret/$arg/}
fi
done
echo $ret
}
_nnictl()
{
_words_cnt=${#COMP_WORDS[@]}
if [ $_words_cnt == 1 ]; then
# no argument input, list all commands
complete -W "$_nnictl_cmds"
elif [ $_words_cnt == 2 ]; then
# completing frst argument from __nnictl_cmds
COMPREPLY=($(compgen -W "$__nnictl_cmds" -- "${COMP_WORDS[1]}"))
elif [ $_words_cnt == 3 ]; then
# completing second argument from __nnictl_${FirstArg}_cmds
args=__nnictl_${COMP_WORDS[1]}_cmds
COMPREPLY=($(compgen -W "${!args}" -- "${COMP_WORDS[2]}"))
elif [[ ${COMP_WORDS[-2]} != -* ]]; then
# last argument does not starts with "-", so this one is likely to be "--xxx"
if [[ ${COMP_WORDS[2]} == -* ]]; then
# second argument starts with "-", use __nnictl_${FirstArg}_cmds
args=__nnictl_${COMP_WORDS[1]}_cmds
else
# second argument is a word, use __nnictl_${FirstArg}_{SecondArg}_cmds
args=__nnictl_${COMP_WORDS[1]}_${COMP_WORDS[2]}_cmds
fi
# remove already set arguments from candidates
remain_args=$(__nnictl_remain_args ${args})
COMPREPLY=($(compgen -W "$remain_args" -- "${COMP_WORDS[-1]}"))
fi
}
complete -F _nnictl nnictl
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