paiConfig.ts 1.73 KB
Newer Older
liuzhe-lz's avatar
liuzhe-lz committed
1
2
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
3
4
5

'use strict';

6
import {TrialConfig} from '../common/trialConfig';
7
import { TrialJobApplicationForm, TrialJobDetail, TrialJobStatus  } from '../../common/trainingService';
8
9
10

export class PAIClusterConfig {
    public readonly userName: string;
11
    public readonly passWord?: string;
SparkSnail's avatar
SparkSnail committed
12
    public host: string;
13
    public readonly token?: string;
14
15
16
17
18
19

    /**
     * Constructor
     * @param userName User name of PAI Cluster
     * @param passWord password of PAI Cluster
     * @param host Host IP of PAI Cluster
20
     * @param token PAI token of PAI Cluster
21
     */
chicm-ms's avatar
chicm-ms committed
22
    constructor(userName: string, host: string, passWord?: string, token?: string) {
23
24
25
        this.userName = userName;
        this.passWord = passWord;
        this.host = host;
26
        this.token = token;
27
28
29
    }
}

30
/**
31
 * PAI trial job detail
32
 */
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
export class PAITrialJobDetail implements TrialJobDetail {
    public id: string;
    public status: TrialJobStatus;
    public paiJobName: string;
    public submitTime: number;
    public startTime?: number;
    public endTime?: number;
    public tags?: string[];
    public url?: string;
    public workingDirectory: string;
    public form: TrialJobApplicationForm;
    public logPath: string;
    public isEarlyStopped?: boolean;

    constructor(id: string, status: TrialJobStatus, paiJobName: string,
                submitTime: number, workingDirectory: string, form: TrialJobApplicationForm, logPath: string) {
        this.id = id;
        this.status = status;
        this.paiJobName = paiJobName;
        this.submitTime = submitTime;
        this.workingDirectory = workingDirectory;
        this.form = form;
        this.tags = [];
        this.logPath = logPath;
57
    }
58
}