Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

fix #1578 and some improvements #2354

Closed

Conversation

squirrelsc
Copy link
Member

@squirrelsc squirrelsc commented Apr 21, 2020

Add shell support for ssh connection, so that remote script can be started with user environment.

Minor fixes,

  1. Fix gpu_metrics_collector to support pyenv. As pyenv will create one more process, so that original pgrep code always got extra processes, and cannot start gpu_metrics_collector.
  2. Fix NASUI failure on dev-install-node-modules, to create subfolder every time.
  3. Add .gitignore items for dev-install.
  4. Add node --watch for nni_manager for better dev experience.

dev env test passed.

Chi Song added 4 commits April 21, 2020 17:22
fix gpu_metrics_collector to support pyenv
fix NASUI failure on dev-install-node-modules
add .gitignore links for dev-install
.gitignore Outdated
@@ -84,3 +84,8 @@ venv.bak/

# In case you place source code in ~/nni/
/experiments
src/sdk/pynni/nni/nni
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add these folders?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are links, and created by dev-install.

const log: Logger = getLogger();
log.debug(`remoteExeCommand: command: [${command}]`);
const deferred: Deferred<RemoteCommandResult> = new Deferred<RemoteCommandResult>();
let stdout: string = '';
let stderr: string = '';
let exitCode: number;
let captureStdOut = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of captureStdout?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the shell is using user's interactive environment, there are startup outputs, like what we see when login a SSH shell. This kind of outputs won't be captured, and output.

pidList = list(map(int, pidList))
pidList.remove(os.getpid())
return not pidList
else:
pgrep_output = subprocess.check_output('pgrep -fxu "$(whoami)" \'python3 -m nni_gpu_tool.gpu_metrics_collector\'', shell=True)
pgrep_output = subprocess.check_output(
'pgrep -afu "$(whoami)" \'python3 -m nni_gpu_tool.gpu_metrics_collector\'', shell=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why use -a instead of -x?
`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-x means exact match and -a means output command text also. It works with default Python, but if user uses multiple Python tools, like pyenv, the command line won't be exact match like this. So use a more complex filter to handle this situation.

pidList = list(map(int, pidList))
pidList.remove(os.getpid())
return not pidList
else:
pgrep_output = subprocess.check_output('pgrep -fxu "$(whoami)" \'python3 -m nni_gpu_tool.gpu_metrics_collector\'', shell=True)
pgrep_output = subprocess.check_output(
Copy link
Contributor

@ultmaster ultmaster Apr 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our line length limit is 140.

.gitignore Outdated
@@ -84,3 +84,8 @@ venv.bak/

# In case you place source code in ~/nni/
/experiments
src/sdk/pynni/nni/nni
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are wrong soft links. We should investigate in why they are created.

@chicm-ms
Copy link
Contributor

suggest to merge into a dev branch to run integration-test-remote and integration-test-remote-windows pipelines first

@squirrelsc
Copy link
Member Author

suggest to merge into a dev branch to run integration-test-remote and integration-test-remote-windows pipelines first

@chicm-ms
what's process to create a dev branch, and how to enable those tests on dev branch?

Makefile Outdated
@@ -211,6 +211,7 @@ dev-install-node-modules:
sed -ie 's/$(NNI_VERSION_TEMPLATE)/$(NNI_VERSION_VALUE)/' $(NNI_PKG_FOLDER)/package.json
ln -sf ${PWD}/src/nni_manager/node_modules $(NNI_PKG_FOLDER)/node_modules
ln -sf ${PWD}/src/webui/build $(NNI_PKG_FOLDER)/static
mkdir -p $(NASUI_PKG_FOLDER)
ln -sf ${PWD}/src/nasui/build $(NASUI_PKG_FOLDER)/build
ln -sf ${PWD}/src/nasui/server.js $(NASUI_PKG_FOLDER)/server.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to remove this line, or will give

# Installing NNI Package 
rm -rf /home/yann/.local/nni
ln -sf /home/yann/code/nni/src/nni_manager/dist /home/yann/.local/nni
cp src/nni_manager/package.json /home/yann/.local/nni
sed -ie 's/999.0.0-developing/v0.2-1270-g06bc964/' /home/yann/.local/nni/package.json
ln -sf /home/yann/code/nni/src/nni_manager/node_modules /home/yann/.local/nni/node_modules
ln -sf /home/yann/code/nni/src/webui/build /home/yann/.local/nni/static
mkdir -p /home/yann/.local/nni/nasui
ln -sf /home/yann/code/nni/src/nasui/build /home/yann/.local/nni/nasui/build
ln -sf /home/yann/code/nni/src/nasui/server.js /home/yann/.local/nni/nasui/server.js
ln: '/home/yann/code/nni/src/nasui/server.js' and '/home/yann/.local/nni/nasui/server.js' are the same file
Makefile:207: recipe for target 'dev-install-node-modules' failed
make: *** [dev-install-node-modules] Error 1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't hit this issue, and it's not changed this time.

@squirrelsc
Copy link
Member Author

Create #2370 as a dev branch. please continue review there.

@squirrelsc squirrelsc closed this Apr 24, 2020
@squirrelsc squirrelsc deleted the compatible_gpu_metrics branch April 26, 2020 09:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants