const.ts 1.99 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;

7
const prefix = getPrefix();
8
9
const RESTAPI = '/api/v1/nni';
const MANAGER_IP = prefix === undefined ? RESTAPI : `${prefix}${RESTAPI}`;
10
const DOWNLOAD_IP = `/logs`;
11

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

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

65
66
67
const TOOLTIP_BACKGROUND_COLOR = '#484848';
const MAX_TRIAL_NUMBERS = 'Max trial No.';

68
export {
69
70
71
    MANAGER_IP,
    DOWNLOAD_IP,
    trialJobStatus,
72
    EXPERIMENTSTATUS,
73
74
75
76
77
78
79
80
81
    WEBUIDOC,
    CONTROLTYPE,
    MONACO,
    COLUMN,
    DRAWEROPTION,
    OPERATION,
    METRIC_GROUP_UPDATE_THRESHOLD,
    METRIC_GROUP_UPDATE_SIZE,
    CONCURRENCYTOOLTIP,
82
83
84
    SUPPORTED_SEARCH_SPACE_TYPE,
    TOOLTIP_BACKGROUND_COLOR,
    MAX_TRIAL_NUMBERS
85
};