const.ts 2.27 KB
Newer Older
1
2
import { getPrefix } from './function';

3
4
5
6
// when there are more trials than this threshold, metrics will be updated in group of this size to avoid freezing
const METRIC_GROUP_UPDATE_THRESHOLD = 100;
const METRIC_GROUP_UPDATE_SIZE = 20;

liuzhe-lz's avatar
liuzhe-lz committed
7
8
9
10
11
12
13
/**
 *  RESTAPI and DOWNLOAD_IP must be synchronized with:
 *    - nni/experiment/rest.py
 *    - ts/nni_manager/rest_server/index.ts
 *  Remember to update them if the values are changed or if this file is moved.
 **/

14
const prefix = getPrefix();
15
16
const RESTAPI = '/api/v1/nni';
const MANAGER_IP = prefix === undefined ? RESTAPI : `${prefix}${RESTAPI}`;
17
const DOWNLOAD_IP = `/logs`;
18

19
const WEBUIDOC = 'https://nni.readthedocs.io/en/latest/Tutorial/WebUI.html';
20

21
const trialJobStatus = [
Deshui Yu's avatar
Deshui Yu committed
22
23
24
25
26
27
    'UNKNOWN',
    'WAITING',
    'RUNNING',
    'SUCCEEDED',
    'FAILED',
    'USER_CANCELED',
Lijiao's avatar
Lijiao committed
28
29
    'SYS_CANCELED',
    'EARLY_STOPPED'
Deshui Yu's avatar
Deshui Yu committed
30
];
31
32
33
34
35
36
const EXPERIMENTSTATUS = [
    'INITIALIZED',
    'RUNNING',
    'ERROR',
    'STOPPING',
    'STOPPED',
37
    'VIEWED',
38
39
40
41
    'DONE',
    'NO_MORE_TRIAL',
    'TUNER_NO_MORE_TRIAL'
];
42
const CONTROLTYPE = ['MAX_EXEC_DURATION', 'MAX_TRIAL_NUM', 'TRIAL_CONCURRENCY', 'SEARCH_SPACE'];
43
const MONACO = {
Lijiao's avatar
Lijiao committed
44
    readOnly: true,
45
    automaticLayout: true,
46
    scrollBeyondLastLine: false
Lijiao's avatar
Lijiao committed
47
};
v-liguo's avatar
v-liguo committed
48
49
50
51
52
const DRAWEROPTION = {
    minimap: { enabled: false },
    readOnly: true,
    automaticLayout: true
};
53
const OPERATION = 'Operation';
54
// defatult selected column
55
const COLUMN = ['Trial No.', 'ID', 'Duration', 'Status', 'Default', OPERATION];
56
const CONCURRENCYTOOLTIP = 'Trial concurrency is the number of trials running concurrently.';
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const SUPPORTED_SEARCH_SPACE_TYPE = [
    'choice',
    'layer_choice',
    'input_choice',
    'randint',
    'uniform',
    'quniform',
    'loguniform',
    'qloguniform',
    'normal',
    'qnormal',
    'lognormal',
    'qlognormal'
];
Lijiaoa's avatar
Lijiaoa committed
71

72
73
const TOOLTIP_BACKGROUND_COLOR = '#484848';
const MAX_TRIAL_NUMBERS = 'Max trial No.';
74
const RETIARIIPARAMETERS = 'mutation_summary';
75

76
export {
77
78
79
    MANAGER_IP,
    DOWNLOAD_IP,
    trialJobStatus,
80
    EXPERIMENTSTATUS,
81
82
83
84
85
86
87
88
89
    WEBUIDOC,
    CONTROLTYPE,
    MONACO,
    COLUMN,
    DRAWEROPTION,
    OPERATION,
    METRIC_GROUP_UPDATE_THRESHOLD,
    METRIC_GROUP_UPDATE_SIZE,
    CONCURRENCYTOOLTIP,
90
91
    SUPPORTED_SEARCH_SPACE_TYPE,
    TOOLTIP_BACKGROUND_COLOR,
92
93
    MAX_TRIAL_NUMBERS,
    RETIARIIPARAMETERS
94
};