Search is not available for this dataset
repo stringlengths 2 152 ⌀ | file stringlengths 15 239 | code stringlengths 0 58.4M | file_length int64 0 58.4M | avg_line_length float64 0 1.81M | max_line_length int64 0 12.7M | extension_type stringclasses 364
values |
|---|---|---|---|---|---|---|
nni | nni-master/ts/nni_manager/test/common/globals_arguments.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert/strict';
import { parseArgs } from 'common/globals/arguments';
const command = [
'--port 80',
'--experiment-id ID',
'--action resume',
'--experiments-directory DIR',
'--log-level error',
'--p... | 2,087 | 25.43038 | 71 | ts |
nni | nni-master/ts/nni_manager/test/common/globals_log_stream.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert/strict';
import fs from 'fs';
import os from 'os';
import path from 'path';
import { setTimeout } from 'timers/promises';
import { LogStream, initLogStream } from 'common/globals/log_stream';
import globals from 'com... | 3,317 | 31.851485 | 102 | ts |
nni | nni-master/ts/nni_manager/test/common/globals_shutdown.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert/strict';
import { setTimeout } from 'timers/promises';
import { Deferred } from 'ts-deferred';
import 'common/globals/unittest';
import { ShutdownManager, UnitTestHelpers } from 'common/globals/shutdown';
/* enviro... | 4,111 | 29.459259 | 98 | ts |
nni | nni-master/ts/nni_manager/test/common/logging.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert/strict';
import globals from 'common/globals/unittest';
import { Logger, getLogger, getRobustLogger } from 'common/log';
/* test cases */
// Write a log message in different format for each level.
// Checks the log... | 3,822 | 25.922535 | 77 | ts |
nni | nni-master/ts/nni_manager/test/common/shell_utils.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert/strict';
import fs from 'fs';
import fsPromises from 'fs/promises';
import os from 'os';
import path from 'path';
import { createScriptFile } from 'common/shellUtils';
let tempDir: string | null = null;
const asciiS... | 1,684 | 26.177419 | 73 | ts |
nni | nni-master/ts/nni_manager/test/common/task_scheduler.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert/strict';
import type { TrialKeeper } from 'common/trial_keeper/keeper';
import type { GpuSystemInfo } from 'common/trial_keeper/task_scheduler/collect_info';
import { TaskScheduler, UnitTestHelpers as Helpers } from ... | 6,423 | 29.736842 | 112 | ts |
nni | nni-master/ts/nni_manager/test/common/command_channel/http.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert/strict';
import { setTimeout } from 'timers/promises';
import globals from 'common/globals/unittest';
import { HttpChannelServer, UnitTestHelpers } from 'common/command_channel/http';
import { Command } from 'common/... | 3,644 | 29.889831 | 83 | ts |
nni | nni-master/ts/nni_manager/test/common/command_channel/websocket.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'node:assert/strict';
import { setTimeout } from 'node:timers/promises';
import type {
Command, CommandChannel, CommandChannelClient, CommandChannelServer
} from 'common/command_channel/interface';
import { UnitTestHelpe... | 6,040 | 27.766667 | 90 | ts |
nni | nni-master/ts/nni_manager/test/common/trial_keeper/process.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert/strict';
import fs from 'fs/promises';
import os from 'os';
import path from 'path';
import { setTimeout } from 'timers/promises';
import { Deferred } from 'common/deferred';
import { TrialProcess, TrialProcessOption... | 6,147 | 28.416268 | 113 | ts |
nni | nni-master/ts/nni_manager/test/core/assessor.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
_in_file = open(3, 'rb')
_out_file = open(4, 'wb')
def send(command, data):
command = command.encode('utf8')
data = data.encode('utf8')
msg = b'%b%14d%b' % (command, len(data), data)
_out_file.write(msg)
_out_file.flush()
... | 590 | 16.909091 | 50 | py |
nni | nni-master/ts/nni_manager/test/core/dataStore.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import { expect } from 'chai';
import { IocShim } from 'common/ioc_shim';
import { Database, DataStore, TrialJobInfo } from '../../common/datastore';
import { ExperimentProfile, TrialJobStatistics } from '../../common/manager';
... | 4,267 | 28.846154 | 94 | ts |
nni | nni-master/ts/nni_manager/test/core/dummy_assessor.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from nni.assessor import Assessor, AssessResult
class DummyAssessor(Assessor):
def assess_trial(self, trial_job_id, trial_history):
return AssessResult.Good
| 244 | 26.222222 | 56 | py |
nni | nni-master/ts/nni_manager/test/core/dummy_tuner.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from nni.tuner import Tuner
class DummyTuner(Tuner):
def generate_parameters(self, parameter_id):
return 'unit-test-parm'
def generate_multiple_parameters(self, parameter_id_list):
return ['unit-test-param1', 'unit-test-... | 569 | 26.142857 | 79 | py |
nni | nni-master/ts/nni_manager/test/core/import_all.test.ts | import * as glob from 'glob';
// Istanbul only generates report for used/imported files, the files are not used/imported by test cases
// are not included in code coverage reports.
// This is a workaround to import all files in order to show all source files in code coverage reports.
glob.sync('**/*.ts').forEach((fil... | 591 | 36 | 104 | ts |
nni | nni-master/ts/nni_manager/test/core/nnimanager.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import * as fs from 'fs';
import * as os from 'os';
import { assert } from 'chai';
import { IocShim } from 'common/ioc_shim';
import { Database, DataStore, TrialJobInfo } from '../../common/datastore';
import { Manager, TrialJob... | 18,189 | 44.361596 | 138 | ts |
nni | nni-master/ts/nni_manager/test/core/sqlDatabase.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import * as assert from 'assert';
import * as os from 'os';
import * as path from 'path';
import { Database, MetricDataRecord, TrialJobEvent, TrialJobEventRecord } from '../../common/datastore';
import { ExperimentConfig, Experim... | 6,725 | 38.333333 | 146 | ts |
nni | nni-master/ts/nni_manager/test/extensions/experimentManager.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { assert, expect } from 'chai';
import fs from 'fs';
import os from 'os';
import path from 'path';
import { cleanupUnitTest, prepareUnitTest } from '../../common/utils';
import { ExperimentsManager } from '../../extensions/experiments_m... | 1,724 | 30.363636 | 99 | ts |
nni | nni-master/ts/nni_manager/test/mock/datastore.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import { assert } from 'console';
import * as fs from 'fs';
import { Deferred } from 'ts-deferred';
import { DataStore, MetricData, MetricDataRecord, MetricType,
TrialJobEvent, TrialJobEventRecord, TrialJobInfo } from '../..... | 8,713 | 30.919414 | 114 | ts |
nni | nni-master/ts/nni_manager/test/mock/experimentManager.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export class MockedExperimentManager {
public getExperimentsInfo(): Promise<JSON> {
const expInfo = JSON.parse(JSON.stringify({
"test": {
"port": 8080,
"startTime": 1605246730756,
... | 973 | 26.055556 | 86 | ts |
nni | nni-master/ts/nni_manager/test/mock/mockTensorboardManager.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import type { TensorboardManager, TensorboardParams, TensorboardTaskInfo } from 'common/tensorboardManager';
const taskInfo: TensorboardTaskInfo = {
id: 'ID',
status: 'RUNNING',
trialJobIdList: [],
trialLogDirectoryList: [],
... | 1,217 | 26.681818 | 108 | ts |
nni | nni-master/ts/nni_manager/test/mock/mockedTrial.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import time
METRICS_FILENAME = '.nni/metrics'
MAGIC = 'ME'
def sdk_send_data(data):
out_dir = os.getenv('NNI_SYS_DIR')
if not os.path.isdir(out_dir):
raise Exception('Can not find NNI_SYS_DIR: {}'.format(out_dir))
... | 958 | 22.975 | 102 | py |
nni | nni-master/ts/nni_manager/test/mock/nniManager.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import { Deferred } from 'ts-deferred';
import { MetricDataRecord, MetricType, TrialJobInfo } from '../../common/datastore';
import { MethodNotImplementedError } from '../../common/errors';
import {
ExperimentConfig, Experim... | 6,417 | 31.09 | 122 | ts |
nni | nni-master/ts/nni_manager/test/mock/trainingService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import { assert } from 'chai';
import { EventEmitter } from 'events';
import { Deferred } from 'ts-deferred';
import { MethodNotImplementedError } from '../../common/errors';
import { TrainingService, TrialJobApplicationForm, Tr... | 7,326 | 36.382653 | 137 | ts |
nni | nni-master/ts/nni_manager/test/rest_server/mock_netron_server.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* A helper HTTP server that sends request informantion back as response.
* Used to check that RestServer will send correct requests to netron.app.
*
* It will automatically dispose itself so no need for stop().
**/
import type { Ad... | 1,165 | 24.911111 | 75 | ts |
nni | nni-master/ts/nni_manager/test/rest_server/nni_manager_handlers.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import { assert, expect } from 'chai';
import request from 'request';
import { IocShim } from 'common/ioc_shim';
import { Database, DataStore } from '../../common/datastore';
import { ExperimentProfile, Manager } from '../../com... | 4,921 | 35.191176 | 102 | ts |
nni | nni-master/ts/nni_manager/test/rest_server/rest_server.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert';
import fs from 'fs';
import path from 'path';
import globals from 'common/globals/unittest';
import { RestServer, UnitTestHelpers } from 'rest_server';
import * as mock_netron_server from './mock_netron_server';
l... | 5,074 | 32.833333 | 106 | ts |
nni | nni-master/ts/nni_manager/test/rest_server/static/index.html | <!DOCTYPE html>
<html>
mock index
</html>
| 44 | 8 | 15 | html |
nni | nni-master/ts/nni_manager/test/training_service/fileUtility.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import * as assert from 'assert';
import * as chai from 'chai';
import * as fs from 'fs';
import * as path from 'path';
import * as tar from 'tar';
import { execCopydir, tarAdd, validateCodeDir } from '../../training_service/commo... | 4,851 | 35.208955 | 95 | ts |
nni | nni-master/ts/nni_manager/test/training_service/kubeflowTrainingService.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import fs from 'fs';
import tmp from 'tmp';
import { cleanupUnitTest, prepareUnitTest } from '../../common/utils';
import { TrialConfigMetadataKey } from '..... | 2,232 | 32.328358 | 206 | ts |
nni | nni-master/ts/nni_manager/test/training_service/localTrainingService.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import fs from 'fs';
import path from 'path';
import tmp from 'tmp';
import { TrialJobApplicationForm, TrialJobDetail} from '../../common/trainingService';
i... | 5,315 | 36.174825 | 114 | ts |
nni | nni-master/ts/nni_manager/test/training_service/remote/linuxCommands.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { cleanupUnitTest, prepareUnitTest } from '../../../common/utils';
import { LinuxCommands } from '../../../training_service/remote_machine/extends/lin... | 3,655 | 36.306122 | 122 | ts |
nni | nni-master/ts/nni_manager/test/training_service/remote/shellExecutor.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import cpp from 'child-process-promise';
import fs from 'fs';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { ShellExecutor } from '../../../training_service/remote_machine/shellExecutor';
import... | 4,016 | 33.930435 | 157 | ts |
nni | nni-master/ts/nni_manager/test/training_service/remote/windowsCommands.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { cleanupUnitTest, prepareUnitTest } from '../../../common/utils';
import { WindowsCommands } from '../../../training_service/remote_machine/extends/w... | 4,328 | 41.441176 | 172 | ts |
nni | nni-master/ts/nni_manager/test/training_service/reusable/amlClient.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import * as chai from 'chai';
import { cleanupUnitTest, prepareUnitTest } from '../../../common/utils';
import chaiAsPromised = require("chai-as-promised");
import { AMLClient } from '../../../training_service/reusable/aml/amlClient';
describ... | 882 | 28.433333 | 109 | ts |
nni | nni-master/ts/nni_manager/test/training_service/reusable/mountedStorageService.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import * as chai from 'chai';
import * as fs from 'fs';
import * as path from 'path';
import { getLogger, Logger } from "../../../common/log";
import { cleanupUnitTest, prepareUnitTest } from '../../../common/utils';
import { Mou... | 4,470 | 34.484127 | 106 | ts |
nni | nni-master/ts/nni_manager/test/training_service/reusable/trialDispatcher.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import * as chai from 'chai';
import * as path from 'path';
import { getLogger, Logger } from "../../../common/log";
import { TrialJobApplicationForm, TrialJobStatus } from '../../../common/trainingService';
import { cleanupUnitTest, delay, pre... | 30,227 | 41.276923 | 186 | ts |
nni | nni-master/ts/nni_manager/test/training_service/reusable/utCommandChannel.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { encodeCommand } from "../../../core/ipcInterface";
import { Command, CommandChannel, RunnerConnection } from "../../../training_service/reusable/commandChannel";
import { Channel, EnvironmentInformation } from "../../../training_servic... | 1,966 | 32.913793 | 127 | ts |
nni | nni-master/ts/nni_manager/test/training_service/reusable/utEnvironmentService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { Channel, EnvironmentInformation, EnvironmentService, EnvironmentStatus } from "../../../training_service/reusable/environment";
import { EventEmitter } from 'events';
import { UtCommandChannel } from "./utCommandChannel";
export class... | 2,253 | 28.657895 | 136 | ts |
nni | nni-master/ts/nni_manager/test/training_service_v3/local.test.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert/strict';
import fs from 'fs/promises';
import { Server } from 'http';
import os from 'os';
import path from 'path';
import { setTimeout } from 'timers/promises';
import express from 'express';
import { DefaultMap } ... | 9,216 | 29.419142 | 140 | ts |
nni | nni-master/ts/nni_manager/training_service/common/clusterJobRestServer.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert';
import bodyParser from 'body-parser';
import { Request, Response, Router } from 'express';
import fs from 'fs';
import path from 'path';
import { Writable } from 'stream';
import { String } from 'typescript-string-o... | 6,426 | 38.429448 | 116 | ts |
nni | nni-master/ts/nni_manager/training_service/common/containerJobData.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export const CONTAINER_INSTALL_NNI_SHELL_FORMAT: string =
`#!/bin/bash
if python3 -c 'import nni' > /dev/null 2>&1; then
# nni module is already installed, skip
:
else
# Install nni
python3 -m pip install --user --upgrade nni
fi`;
expo... | 489 | 23.5 | 65 | ts |
nni | nni-master/ts/nni_manager/training_service/common/gpuData.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export enum ScheduleResultType {
// Schedule succeeded
SUCCEED,
// Temporarily, no enough available GPU right now
TMP_NO_AVAILABLE_GPU,
// Cannot match requirement even if all GPU are a
REQUIRE_EXCEED_TOTAL
}
/**
* G... | 2,618 | 29.811765 | 114 | ts |
nni | nni-master/ts/nni_manager/training_service/common/jobMetrics.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { TrialJobStatus } from 'common/trainingService';
/**
* Trial job metrics class
* Representing trial job metrics properties
*/
export class JobMetrics {
public readonly jobId: string;
public readonly metrics: string[];
p... | 652 | 27.391304 | 100 | ts |
nni | nni-master/ts/nni_manager/training_service/common/trialConfig.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* Trial job configuration class
* Representing trial job configurable properties
*/
export class TrialConfig {
// Trail command
public readonly command: string;
// Code directory
public readonly codeDir: string;
// ... | 942 | 26.735294 | 92 | ts |
nni | nni-master/ts/nni_manager/training_service/common/trialConfigMetadataKey.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* Enum of metadata keys for configuration
*/
export enum TrialConfigMetadataKey {
MACHINE_LIST = 'machine_list',
LOCAL_CONFIG = 'local_config',
TRIAL_CONFIG = 'trial_config',
REMOTE_CONFIG = 'remote_config',
HYBRID_CON... | 1,075 | 34.866667 | 71 | ts |
nni | nni-master/ts/nni_manager/training_service/common/util.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import cpp from 'child-process-promise';
import cp from 'child_process';
import fs from 'fs';
import ignore from 'ignore';
import path from 'path';
import tar from 'tar';
import { getLogger } from 'common/log';
import { String } from 'typescrip... | 8,241 | 31.836653 | 131 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/azureStorageClientUtils.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import azureStorage from 'azure-storage';
import fs from 'fs';
import path from 'path';
import { Deferred } from 'ts-deferred';
import { String } from 'typescript-string-operations';
import { getLogger } from 'common/log';
import { mkDirP } fro... | 9,162 | 40.840183 | 156 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/kubernetesApiClient.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import {Client1_10, config} from 'kubernetes-client';
import {getLogger, Logger} from 'common/log';
/**
* This function uses the environment variable
* 'KUBERNETES_SERVICE_HOST' to determine whether
* the code is running from within a kuber... | 8,992 | 36.627615 | 124 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/kubernetesConfig.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export type KubernetesStorageKind = 'nfs' | 'azureStorage' | 'pvc';
import {MethodNotImplementedError} from 'common/errors';
export abstract class KubernetesClusterConfig {
public readonly storage?: KubernetesStorageKind;
public readon... | 7,215 | 28.941909 | 122 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/kubernetesData.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { TrialJobApplicationForm, TrialJobDetail, TrialJobStatus } from 'common/trainingService';
/**
* KubeflowTrialJobDetail
*/
export class KubernetesTrialJobDetail implements TrialJobDetail {
public id: string;
public status: Tr... | 1,891 | 32.192982 | 128 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/kubernetesJobInfoCollector.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert';
import { MethodNotImplementedError, NNIError, NNIErrorNames } from 'common/errors';
import { getLogger, Logger } from 'common/log';
import { TrialJobStatus } from 'common/trainingService';
import { KubernetesCRDClie... | 1,876 | 44.780488 | 117 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/kubernetesJobRestServer.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { ClusterJobRestServer } from '../common/clusterJobRestServer';
import { KubernetesTrainingService } from './kubernetesTrainingService';
/**
* Kubeflow Training service Rest server, provides rest API to support kubeflow job metrics upd... | 1,311 | 36.485714 | 98 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/kubernetesTrainingService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import cpp from 'child-process-promise';
import path from 'path';
import azureStorage from 'azure-storage';
import {EventEmitter} from 'events';
import {Base64} from 'js-base64';
import {String} from 'typescript-string-operations';
import {Met... | 16,005 | 38.618812 | 148 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/frameworkcontroller/frameworkcontrollerApiClient.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import fs from 'fs';
import {GeneralK8sClient, KubernetesCRDClient} from '../kubernetesApiClient';
/**
* FrameworkController ClientV1
*/
class FrameworkControllerClientV1 extends KubernetesCRDClient {
/**
* constructor, to initializ... | 1,297 | 28.5 | 128 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/frameworkcontroller/frameworkcontrollerConfig.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert';
import {
AzureStorage, KeyVaultConfig, KubernetesClusterConfig, KubernetesClusterConfigAzure, KubernetesClusterConfigNFS,
KubernetesStorageKind, KubernetesTrialConfig, KubernetesTrialConfigTemplate, NFSConf... | 5,873 | 41.258993 | 140 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/frameworkcontroller/frameworkcontrollerJobInfoCollector.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { KubernetesCRDClient } from '../kubernetesApiClient';
import { KubernetesTrialJobDetail} from '../kubernetesData';
import { KubernetesJobInfoCollector } from '../kubernetesJobInfoCollector';
import { FrameworkControllerJobCompleteStatus... | 3,353 | 43.72 | 128 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/frameworkcontroller/frameworkcontrollerTrainingService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert';
import cpp from 'child-process-promise';
import fs from 'fs';
import path from 'path';
import {getExperimentId} from 'common/experimentStartupInfo';
import {
NNIManagerIpConfig, TrialJobApplicationForm, TrialJob... | 25,435 | 44.830631 | 140 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/kubeflow/kubeflowApiClient.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import fs from 'fs';
import { GeneralK8sClient, KubernetesCRDClient } from '../kubernetesApiClient';
import { KubeflowOperator } from './kubeflowConfig';
class TFOperatorClientV1Alpha2 extends KubernetesCRDClient {
/**
* constructor,... | 6,714 | 30.824645 | 117 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/kubeflow/kubeflowConfig.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert';
import { MethodNotImplementedError } from 'common/errors';
import { AzureStorage, KeyVaultConfig, KubernetesClusterConfig, KubernetesClusterConfigAzure, KubernetesClusterConfigNFS,
KubernetesStorageKind, Kuberne... | 6,718 | 36.747191 | 121 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/kubeflow/kubeflowJobInfoCollector.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { KubernetesCRDClient } from '../kubernetesApiClient';
import { KubernetesTrialJobDetail} from '../kubernetesData';
import { KubernetesJobInfoCollector } from '../kubernetesJobInfoCollector';
import { KubeflowJobStatus } from './kubeflow... | 3,087 | 44.411765 | 125 | ts |
nni | nni-master/ts/nni_manager/training_service/kubernetes/kubeflow/kubeflowTrainingService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert';
import cpp from 'child-process-promise';
import fs from 'fs';
import path from 'path';
import { getExperimentId } from 'common/experimentStartupInfo';
import {
NNIManagerIpConfig, TrialJobApplicationForm, Trial... | 25,407 | 53.290598 | 165 | ts |
nni | nni-master/ts/nni_manager/training_service/local/gpuScheduler.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import cpp from 'child-process-promise';
import fs from 'fs';
import os from 'os';
import path from 'path';
import { getLogger, Logger } from 'common/log';
import { delay } from 'common/utils';
import { GPUInfo, GPUSummary } from '../common/gpu... | 3,793 | 35.834951 | 125 | ts |
nni | nni-master/ts/nni_manager/training_service/local/localTrainingService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import cp from 'child_process';
import { EventEmitter } from 'events';
import fs from 'fs';
import path from 'path';
import ts from 'tail-stream';
import tkill from 'tree-kill';
import { NNIError, NNIErrorNames } from 'common/errors';
import { ... | 21,767 | 41.432749 | 143 | ts |
nni | nni-master/ts/nni_manager/training_service/local_v3/index.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export { LocalTrainingServiceV3 } from './local';
| 126 | 24.4 | 49 | ts |
nni | nni-master/ts/nni_manager/training_service/local_v3/local.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import path from 'node:path';
import { globals } from 'common/globals';
import { Logger, getLogger } from 'common/log';
import type { LocalConfig, TrainingServiceConfig } from 'common/experimentConfig';
import type { EnvironmentInfo, Metric, P... | 4,583 | 32.459854 | 119 | ts |
nni | nni-master/ts/nni_manager/training_service/remote_machine/gpuScheduler.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert';
import { getLogger, Logger } from 'common/log';
import { randomSelect } from 'common/utils';
import { RemoteMachineConfig } from 'common/experimentConfig';
import { GPUInfo, ScheduleResultType } from '../common/gpuD... | 10,773 | 45.640693 | 151 | ts |
nni | nni-master/ts/nni_manager/training_service/remote_machine/osCommands.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { RemoteCommandResult } from "./remoteMachineData";
abstract class OsCommands {
protected pathSpliter: string = '/';
protected multiplePathSpliter: RegExp = new RegExp(`[\\\\/]{2,}`);
protected normalizePath: RegExp = new R... | 2,427 | 49.583333 | 115 | ts |
nni | nni-master/ts/nni_manager/training_service/remote_machine/remoteMachineData.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { TrialJobApplicationForm, TrialJobDetail, TrialJobStatus } from 'common/trainingService';
import { RemoteMachineConfig } from 'common/experimentConfig';
import { GPUInfo, GPUSummary, ScheduleResultType } from '../common/gpuData';
import... | 4,730 | 29.720779 | 130 | ts |
nni | nni-master/ts/nni_manager/training_service/remote_machine/shellExecutor.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert';
import fs from 'fs';
import os from 'os';
import path from 'path';
import { Client, ClientChannel, ConnectConfig, SFTPWrapper } from 'ssh2';
import stream from 'stream';
import { Deferred } from "ts-deferred";
impor... | 18,936 | 42.038636 | 207 | ts |
nni | nni-master/ts/nni_manager/training_service/remote_machine/extends/linuxCommands.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { OsCommands } from "../osCommands";
import { RemoteCommandResult } from "../remoteMachineData";
class LinuxCommands extends OsCommands {
public getScriptExt(): string {
return "sh";
}
public generateStartScript(wo... | 5,535 | 34.948052 | 148 | ts |
nni | nni-master/ts/nni_manager/training_service/remote_machine/extends/windowsCommands.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { OsCommands } from "../osCommands";
import { RemoteCommandResult } from "../remoteMachineData";
class WindowsCommands extends OsCommands {
protected pathSpliter: string = '\\';
public getScriptExt(): string {
return "... | 6,077 | 41.802817 | 453 | ts |
nni | nni-master/ts/nni_manager/training_service/remote_v3/index.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export { RemoteTrainingServiceV3 } from './remote';
| 128 | 24.8 | 51 | ts |
nni | nni-master/ts/nni_manager/training_service/remote_v3/remote.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* Remote training service that runs trials on one or more SSH servers.
*
* It supports both POSIX and Windows servers,
* but requires the server to have a recent python installed.
**/
import { EventEmitter } from 'node:events';
im... | 10,942 | 35.598662 | 119 | ts |
nni | nni-master/ts/nni_manager/training_service/remote_v3/ssh.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* Mainly a wrapper around ssh2 library to provide promise APIs.
**/
import events from 'node:events';
import fs from 'node:fs/promises';
import util from 'node:util';
import { Client, ConnectConfig, SFTPWrapper } from 'ssh2';
import {... | 5,962 | 31.944751 | 99 | ts |
nni | nni-master/ts/nni_manager/training_service/remote_v3/worker.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* Manage SSH servers.
**/
import fs from 'node:fs/promises';
import path from 'node:path';
import type { WsChannel } from 'common/command_channel/websocket/channel';
import type { RemoteMachineConfig } from 'common/experimentConfig';
i... | 11,342 | 36.684385 | 119 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/commandChannel.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { EventEmitter } from "events";
import { getLogger, Logger } from "common/log";
import { TRIAL_COMMANDS } from "core/commands";
import { encodeCommand } from "core/ipcInterface";
import { Channel, EnvironmentInformation } from "./environ... | 5,125 | 38.129771 | 123 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/environment.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { getLogger, Logger } from "common/log";
import { TrialJobStatus } from "common/trainingService";
import { GPUInfo } from "training_service/common/gpuData";
import { CommandChannel } from "./commandChannel";
import { WebCommandChannel } ... | 7,553 | 36.39604 | 133 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/gpuScheduler.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import assert from 'assert';
import { PlacementConstraint } from 'common/trainingService';
import { getLogger, Logger } from 'common/log';
import { randomSelect } from 'common/utils';
import { GPUInfo, ScheduleResultType } from '../common/gpuDa... | 17,208 | 47.476056 | 180 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/routerTrainingService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { getLogger, Logger } from 'common/log';
import { MethodNotImplementedError } from 'common/errors';
import { ExperimentConfig, RemoteConfig, KubeflowConfig, FrameworkControllerConfig } from 'common/experimentConfig';
import { TrainingSer... | 5,875 | 44.550388 | 131 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/sharedStorage.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { SharedStorageConfig } from 'common/experimentConfig';
import { StorageService } from './storageService'
export type SharedStorageType = 'NFS' | 'AzureBlob'
export type LocalMountedType = 'usermount' | 'nnimount' | 'nomount'
export ab... | 853 | 39.666667 | 71 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/storageService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import fs from 'fs';
import os from 'os';
import path from 'path';
import { getLogger, Logger } from 'common/log';
import { uniqueString } from 'common/utils';
import { tarAdd } from '../common/util';
export abstract class StorageService {
... | 8,564 | 45.548913 | 159 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/trial.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { TrialJobApplicationForm, TrialJobDetail, TrialJobStatus } from "common/trainingService";
import { GPUInfo } from "training_service/common/gpuData";
import { EnvironmentInformation, NodeInformation } from "./environment";
export class ... | 1,468 | 33.97619 | 97 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/trialDispatcher.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { EventEmitter } from 'events';
import fs from 'fs';
import path from 'path';
import { Writable } from 'stream';
import { String } from 'typescript-string-operations';
import { NNIError, NNIErrorNames, MethodNotImplementedError } from 'c... | 46,694 | 47.539501 | 242 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/aml/amlClient.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { Deferred } from 'ts-deferred';
import { PythonShell } from 'python-shell';
export class AMLClient {
public subscriptionId: string;
public resourceGroup: string;
public workspaceName: string;
public experimentId: string... | 6,131 | 37.086957 | 90 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/aml/amlConfig.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { TrialConfig } from 'training_service/common/trialConfig';
import { EnvironmentInformation } from '../environment';
import { AMLClient } from '../aml/amlClient';
export class AMLClusterConfig {
public readonly subscriptionId: strin... | 1,398 | 32.309524 | 108 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/channels/amlCommandChannel.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { delay } from "common/utils";
import { AMLEnvironmentInformation } from '../aml/amlConfig';
import { CommandChannel, RunnerConnection } from "../commandChannel";
import { Channel, EnvironmentInformation } from "../environment";
class A... | 4,438 | 37.267241 | 135 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/channels/fileCommandChannel.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { IocShim } from 'common/ioc_shim';
import { delay } from "common/utils";
import { CommandChannel, RunnerConnection } from "../commandChannel";
import { Channel, EnvironmentInformation } from "../environment";
import { StorageService } f... | 5,373 | 37.113475 | 138 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/channels/webCommandChannel.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { Server as SocketServer } from "ws";
import { getBasePort, getExperimentId } from "common/experimentStartupInfo";
import { INITIALIZED } from 'core/commands';
import { CommandChannel, RunnerConnection } from "../commandChannel";
import ... | 5,497 | 37.71831 | 218 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/dlc/dlcClient.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { Deferred } from 'ts-deferred';
import { PythonShell } from 'python-shell';
import { getLogger, Logger } from 'common/log';
export class DlcClient {
private log: Logger;
public type: string;
public image: string;
public... | 6,591 | 34.826087 | 94 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/dlc/dlcConfig.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { TrialConfig } from 'training_service/common/trialConfig';
import { EnvironmentInformation } from '../environment';
import { DlcClient } from '../dlc/dlcClient';
export class DlcClusterConfig {
public readonly type: string;
pub... | 1,147 | 28.435897 | 81 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/environments/amlEnvironmentService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import fs from 'fs';
import path from 'path';
import { AmlConfig } from 'common/experimentConfig';
import { ExperimentStartupInfo } from 'common/experimentStartupInfo';
import { IocShim } from 'common/ioc_shim';
import { getLogger, Logger } fro... | 5,663 | 41.586466 | 138 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/environments/dlcEnvironmentService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import fs from 'fs';
import path from 'path';
import { Deferred } from 'ts-deferred';
import { DlcConfig } from 'common/experimentConfig';
import { ExperimentStartupInfo } from 'common/experimentStartupInfo';
import { IocShim } from 'common/ioc... | 6,247 | 41.503401 | 192 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/environments/environmentServiceFactory.ts | import { AMLEnvironmentService } from './amlEnvironmentService';
import { LocalEnvironmentService } from './localEnvironmentService';
import { RemoteEnvironmentService } from './remoteEnvironmentService';
import { KubeflowEnvironmentService } from './kubernetes/kubeflowEnvironmentService';
import { FrameworkControllerE... | 2,003 | 49.1 | 108 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/environments/localEnvironmentService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import fs from 'fs';
import path from 'path';
import tkill from 'tree-kill';
import { ExperimentConfig } from 'common/experimentConfig';
import { ExperimentStartupInfo } from 'common/experimentStartupInfo';
import { IocShim } from 'common/ioc_s... | 7,144 | 50.035714 | 221 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/environments/remoteEnvironmentService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import fs from 'fs';
import path from 'path';
import { IocShim } from 'common/ioc_shim';
import { getLogger, Logger } from 'common/log';
import { EnvironmentInformation, EnvironmentService } from '../environment';
import { getLogLevel } from 'c... | 15,190 | 49.468439 | 277 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/environments/kubernetes/frameworkcontrollerEnvironmentService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
'use strict';
import cpp from 'child-process-promise';
import * as fs from 'fs';
import * as path from 'path';
import { FrameworkControllerConfig, FrameworkControllerTaskRoleConfig, toMegaBytes } from '../../../../common/experimentConfig';
imp... | 15,000 | 42.607558 | 139 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/environments/kubernetes/kubeflowEnvironmentService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import cpp from 'child-process-promise';
import fs from 'fs';
import path from 'path';
import { KubeflowConfig, toMegaBytes } from 'common/experimentConfig';
import { ExperimentStartupInfo } from 'common/experimentStartupInfo';
import { Environ... | 13,978 | 48.747331 | 169 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/environments/kubernetes/kubernetesEnvironmentService.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import cpp from 'child-process-promise';
import path from 'path';
import azureStorage from 'azure-storage';
import {Base64} from 'js-base64';
import {String} from 'typescript-string-operations';
import { ExperimentStartupInfo } from 'common/exp... | 11,179 | 39.952381 | 148 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/heterogenous/heterogenousConfig.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export class HeterogenousConfig {
public readonly trainingServicePlatforms: string[];
constructor(trainingServicePlatforms: string[]) {
this.trainingServicePlatforms = trainingServicePlatforms;
}
}
| 300 | 24.083333 | 65 | ts |
nni | nni-master/ts/nni_manager/training_service/reusable/remote/remoteConfig.ts | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { EnvironmentInformation } from '../environment';
import { RemoteMachineConfig } from 'common/experimentConfig';
/**
* RemoteMachineEnvironmentInformation
*/
export class RemoteMachineEnvironmentInformation extends EnvironmentInformat... | 376 | 28 | 81 | ts |