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

Fix install.sh add add trial log path #109

Merged
merged 25 commits into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dc780cd
Merge pull request #1 from Microsoft/master
SparkSnail Sep 14, 2018
86243e7
Merge pull request #2 from Microsoft/master
SparkSnail Sep 14, 2018
3d1e4e9
fix nnictl bug
Sep 14, 2018
b0b2136
fix nnictl create bug
Sep 14, 2018
6d09780
Merge pull request #4 from Microsoft/master
SparkSnail Sep 17, 2018
04ccb73
Merge branch 'master' of https://github.com/SparkSnail/nni into t-shy…
Sep 17, 2018
408a361
add experiment status logic
Sep 17, 2018
7c3d80c
add more information for nnictl
Sep 17, 2018
6c0a4f1
fix Evolution Tuner bug
Sep 17, 2018
1e61de8
refactor code
Sep 18, 2018
08a46ae
fix code in updater.py
Sep 18, 2018
61772d0
fix nnictl --help
Sep 19, 2018
356272f
fix classArgs bug
Sep 19, 2018
ab1b34c
update check response.status_code logic
Sep 19, 2018
6d669c6
Merge pull request #6 from Microsoft/master
SparkSnail Sep 19, 2018
d9636b3
Merge branch 'master' of https://github.com/SparkSnail/nni into t-shy…
Sep 19, 2018
22b73bb
show trial log path
Sep 19, 2018
af2615d
Merge pull request #8 from Microsoft/master
SparkSnail Sep 20, 2018
57e1086
Merge branch 'master' of https://github.com/SparkSnail/nni into t-shy…
Sep 20, 2018
805fc57
update document
Sep 20, 2018
d863197
fix install.sh
Sep 21, 2018
f6b7c0a
Merge pull request #9 from Microsoft/master
SparkSnail Sep 24, 2018
9904639
Merge branch 'master' of https://github.com/SparkSnail/nni into t-shy…
Sep 24, 2018
8279ee4
set default vallue for maxTrialNum and maxExecDuration
Sep 24, 2018
52bea3b
fix nnictl
Sep 25, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/NNICTLDOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,19 @@ nnictl log
| --head, -h| False| |show head lines of stderr|
| --tail, -t| False| |show tail lines of stderr|
| --path, -p| False| |show the path of stderr file|

* __nnictl log trial__
* Description

Show trial log path.

* Usage

nnictl log trial [options]

Options:

| Name, shorthand | Required|Default | Description |
| ------ | ------ | ------ |------ |
| --id, -I| False| |the id of trial|

4 changes: 3 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash
make easy-install
make build
make install-dependencies
make dev-install
source ~/.bashrc
4 changes: 2 additions & 2 deletions tools/nnicmd/config_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
'authorName': str,
'experimentName': str,
'trialConcurrency': And(int, lambda n: 1 <=n <= 999999),
'maxExecDuration': Regex(r'^[1-9][0-9]*[s|m|h|d]$'),
'maxTrialNum': And(int, lambda x: 1 <= x <= 99999),
Optional('maxExecDuration'): Regex(r'^[1-9][0-9]*[s|m|h|d]$'),
Optional('maxTrialNum'): And(int, lambda x: 1 <= x <= 99999),
'trainingServicePlatform': And(str, lambda x: x in ['remote', 'local', 'pai']),
Optional('searchSpacePath'): os.path.exists,
'useAnnotation': bool,
Expand Down
5 changes: 5 additions & 0 deletions tools/nnicmd/launcher_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ def validate_common_content(experiment_config):
'''Validate whether the common values in experiment_config is valid'''
try:
CONFIG_SCHEMA.validate(experiment_config)
#set default value
if experiment_config.get('maxExecDuration') is None:
experiment_config['maxExecDuration'] = '999d'
if experiment_config.get('maxTrialNum') is None:
experiment_config['maxTrialNum'] = 99999
except Exception as exception:
raise Exception(exception)

Expand Down
4 changes: 4 additions & 0 deletions tools/nnicmd/nnictl.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def parse_args():
parser_log_stderr.add_argument('--head', '-H', dest='head', type=int, help='get head -100 content of stderr')
parser_log_stderr.add_argument('--path', '-p', action='store_true', default=False, help='get the path of stderr file')
parser_log_stderr.set_defaults(func=log_stderr)
parser_log_trial = parser_log_subparsers.add_parser('trial', help='get trial log path')
parser_log_trial.add_argument('--id', '-I', dest='id', help='find trial log path by id')
parser_log_trial.set_defaults(func=log_trial)


args = parser.parse_args()
args.func(args)
Expand Down
30 changes: 30 additions & 0 deletions tools/nnicmd/nnictl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,36 @@ def log_stderr(args):
'''get stderr log'''
log_internal(args, 'stderr')

def log_trial(args):
''''get trial log path'''
trial_id_path_dict = {}
nni_config = Config()
rest_port = nni_config.get_config('restServerPort')
rest_pid = nni_config.get_config('restServerPid')
if not detect_process(rest_pid):
print_error('Experiment is not running...')
return
running, response = check_rest_server_quick(rest_port)
if running:
response = rest_get(trial_jobs_url(rest_port), 20)
if response and check_response(response):
content = json.loads(response.text)
for trial in content:
trial_id_path_dict[trial['id']] = trial['logPath']
else:
print_error('Restful server is not running...')
exit(0)
if args.id:
if trial_id_path_dict.get(args.id):
print('id:' + args.id + ' path:' + trial_id_path_dict[args.id])
else:
print_error('trial id is not valid!')
exit(0)
else:
for key in trial_id_path_dict.keys():
print('id:' + key + ' path:' + trial_id_path_dict[key])


def get_config(args):
'''get config info'''
nni_config = Config()
Expand Down