Commit c1bda85e authored by Crysple's avatar Crysple Committed by QuanluZhang
Browse files

support install from venv and travis CI

parent 1208833d
BIN_PATH ?= ${HOME}/.local/bin BIN_PATH ?= ${HOME}/.local/bin
INSTALL_PREFIX ?= ${HOME}/.local INSTALL_PREFIX ?= ${HOME}/.local
PIP_MODE ?= --user
EXAMPLES_PATH ?= ${HOME}/nni/examples EXAMPLES_PATH ?= ${HOME}/nni/examples
WHOAMI := $(shell whoami) WHOAMI := $(shell whoami)
.PHONY: build install uninstall dev-install
YARN := $(INSTALL_PREFIX)/yarn/bin/yarn YARN := $(INSTALL_PREFIX)/yarn/bin/yarn
ifndef TRAVIS
PIP_MODE ?= --user
endif
.PHONY: build install uninstall dev-install
build: build:
### Building NNI Manager ### ### Building NNI Manager ###
...@@ -63,7 +65,7 @@ install: ...@@ -63,7 +65,7 @@ install:
pip-install: pip-install:
ifneq ('$(HOME)', '/root') ifneq ('$(HOME)', '/root')
ifeq (${WHOAMI}, root) ifeq (${WHOAMI}, root)
### Sorry, sudo make install is not supported ### ### Sorry, sudo pip install is not supported ###
exit 1 exit 1
endif endif
endif endif
......
...@@ -154,6 +154,10 @@ function parseArg(names: string[]): string { ...@@ -154,6 +154,10 @@ function parseArg(names: string[]): string {
function getMsgDispatcherCommand(tuner: any, assessor: any): string { function getMsgDispatcherCommand(tuner: any, assessor: any): string {
let command: string = `python3 -m nni --tuner_class_name ${tuner.className}`; let command: string = `python3 -m nni --tuner_class_name ${tuner.className}`;
if (process.env.VIRTUAL_ENV) {
command = path.join(process.env.VIRTUAL_ENV, 'bin/') +command;
}
if (tuner.classArgs !== undefined) { if (tuner.classArgs !== undefined) {
command += ` --tuner_args ${JSON.stringify(JSON.stringify(tuner.classArgs))}`; command += ` --tuner_args ${JSON.stringify(JSON.stringify(tuner.classArgs))}`;
} }
......
...@@ -80,5 +80,6 @@ if __name__ == '__main__': ...@@ -80,5 +80,6 @@ if __name__ == '__main__':
print(RED + 'FAIL' + CLEAR) print(RED + 'FAIL' + CLEAR)
print('%r' % e) print('%r' % e)
traceback.print_exc() traceback.print_exc()
raise e
subprocess.run(['nnictl', 'stop']) subprocess.run(['nnictl', 'stop'])
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