amlConfig.ts 1.47 KB
Newer Older
SparkSnail's avatar
SparkSnail committed
1
2
3
4
5
6
7
8
9
10
11
12
13
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

'use strict';

import { TrialConfig } from '../../common/trialConfig';
import { EnvironmentInformation } from '../environment';
import { AMLClient } from '../aml/amlClient';

export class AMLClusterConfig {
    public readonly subscriptionId: string;
    public readonly resourceGroup: string;
    public readonly workspaceName: string;
14
15
16
    public readonly computeTarget: string;
    public useActiveGpu?: boolean;
    public maxTrialNumPerGpu?: number;
SparkSnail's avatar
SparkSnail committed
17

18
19
    constructor(subscriptionId: string, resourceGroup: string, workspaceName: string, computeTarget: string,
                useActiveGpu?: boolean, maxTrialNumPerGpu?: number) {
SparkSnail's avatar
SparkSnail committed
20
21
22
        this.subscriptionId = subscriptionId;
        this.resourceGroup = resourceGroup;
        this.workspaceName = workspaceName;
23
24
25
        this.computeTarget = computeTarget;
        this.useActiveGpu = useActiveGpu;
        this.maxTrialNumPerGpu = maxTrialNumPerGpu;
SparkSnail's avatar
SparkSnail committed
26
27
28
29
30
31
32
33
    }
}

export class AMLTrialConfig extends TrialConfig {
    public readonly image: string;
    public readonly command: string;
    public readonly codeDir: string;

34
    constructor(codeDir: string, command: string, image: string) {
SparkSnail's avatar
SparkSnail committed
35
36
37
38
39
40
41
42
43
        super("", codeDir, 0);
        this.codeDir = codeDir;
        this.command = command;
        this.image = image;
    }
}

export class AMLEnvironmentInformation extends EnvironmentInformation {
    public amlClient?: AMLClient;
SparkSnail's avatar
SparkSnail committed
44
    public currentMessageIndex: number = -1;
SparkSnail's avatar
SparkSnail committed
45
}