Commit 6873a3cf authored by Zejun Lin's avatar Zejun Lin Committed by QuanluZhang
Browse files

support conda (#90) (#110)

* support install from venv and travis CI

* support install from venv and travis CI

* support install from venv and travis CI

* support conda

* support conda

* modify example config path to relative path and increase maxTrialNum

* undo messy commit

* undo messy commit
parent cc5218e5
# Setting variables # Setting variables
SHELL := /bin/bash SHELL := /bin/bash
PIP_INSTALL := python3 -m pip install
PIP_UNINSTALL := python3 -m pip uninstall
## Install directories ## Install directories
ifeq ($(shell id -u), 0) # is root ifeq ($(shell id -u), 0) # is root
...@@ -143,8 +145,8 @@ dev-install: ...@@ -143,8 +145,8 @@ dev-install:
.PHONY: uninstall .PHONY: uninstall
uninstall: uninstall:
-pip3 uninstall -y nni -$(PIP_UNINSTALL) -y nni
-pip3 uninstall -y nnictl -$(PIP_UNINSTALL) -y nnictl
-rm -rf $(INSTALL_PREFIX)/nni -rm -rf $(INSTALL_PREFIX)/nni
-rm -f $(BIN_PATH)/nnimanager -rm -f $(BIN_PATH)/nnimanager
-rm -f $(BIN_PATH)/nnictl -rm -f $(BIN_PATH)/nnictl
...@@ -219,10 +221,10 @@ install-node-modules: ...@@ -219,10 +221,10 @@ install-node-modules:
.PHONY: install-dev-modules .PHONY: install-dev-modules
install-dev-modules: install-dev-modules:
#$(_INFO) Installing Python SDK $(_END) #$(_INFO) Installing Python SDK $(_END)
cd src/sdk/pynni && pip3 install $(PIP_MODE) -e . cd src/sdk/pynni && $(PIP_INSTALL) $(PIP_MODE) -e .
#$(_INFO) Installing nnictl $(_END) #$(_INFO) Installing nnictl $(_END)
cd tools && pip3 install $(PIP_MODE) -e . cd tools && $(PIP_INSTALL) $(PIP_MODE) -e .
mkdir -p $(INSTALL_PREFIX)/nni mkdir -p $(INSTALL_PREFIX)/nni
......
...@@ -161,10 +161,6 @@ function parseArg(names: string[]): string { ...@@ -161,10 +161,6 @@ 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))}`;
} }
......
...@@ -236,14 +236,16 @@ class NNIManager implements Manager { ...@@ -236,14 +236,16 @@ class NNIManager implements Manager {
newCwd = cwd; newCwd = cwd;
} }
// TO DO: add CUDA_VISIBLE_DEVICES // TO DO: add CUDA_VISIBLE_DEVICES
let nniEnv = {
NNI_MODE: mode,
NNI_CHECKPOINT_DIRECTORY: dataDirectory,
NNI_LOG_DIRECTORY: getLogDir()
};
let newEnv = Object.assign({}, process.env, nniEnv);
const tunerProc: ChildProcess = spawn(command, [], { const tunerProc: ChildProcess = spawn(command, [], {
stdio, stdio,
cwd: newCwd, cwd: newCwd,
env: { env: newEnv,
NNI_MODE: mode,
NNI_CHECKPOINT_DIRECTORY: dataDirectory,
NNI_LOG_DIRECTORY: getLogDir()
},
shell: true shell: true
}); });
this.dispatcherPid = tunerProc.pid; this.dispatcherPid = tunerProc.pid;
......
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