amlConfig.ts 1.37 KB
Newer Older
SparkSnail's avatar
SparkSnail committed
1
2
3
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

4
import { TrialConfig } from 'training_service/common/trialConfig';
SparkSnail's avatar
SparkSnail committed
5
6
7
8
9
10
11
import { EnvironmentInformation } from '../environment';
import { AMLClient } from '../aml/amlClient';

export class AMLClusterConfig {
    public readonly subscriptionId: string;
    public readonly resourceGroup: string;
    public readonly workspaceName: string;
12
13
    public readonly computeTarget: string;
    public maxTrialNumPerGpu?: number;
SparkSnail's avatar
SparkSnail committed
14

15
    constructor(subscriptionId: string, resourceGroup: string, workspaceName: string, computeTarget: string,
liuzhe-lz's avatar
liuzhe-lz committed
16
                maxTrialNumPerGpu?: number) {
SparkSnail's avatar
SparkSnail committed
17
18
19
        this.subscriptionId = subscriptionId;
        this.resourceGroup = resourceGroup;
        this.workspaceName = workspaceName;
20
21
        this.computeTarget = computeTarget;
        this.maxTrialNumPerGpu = maxTrialNumPerGpu;
SparkSnail's avatar
SparkSnail committed
22
23
24
25
26
27
28
29
    }
}

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

30
    constructor(codeDir: string, command: string, image: string) {
SparkSnail's avatar
SparkSnail committed
31
32
33
34
35
36
37
38
39
        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
40
    public currentMessageIndex: number = -1;
SparkSnail's avatar
SparkSnail committed
41
}