Unverified Commit f5b89bb6 authored by J-shang's avatar J-shang Committed by GitHub
Browse files

Merge pull request #4776 from microsoft/v2.7

parents 7aa44612 1546962f
...@@ -467,7 +467,7 @@ class RemoteMachineTrainingService implements TrainingService { ...@@ -467,7 +467,7 @@ class RemoteMachineTrainingService implements TrainingService {
throw new Error(`Can not get trial job detail for job: ${trialJobId}`); throw new Error(`Can not get trial job detail for job: ${trialJobId}`);
} }
const trialLocalTempFolder: string = path.join(this.expRootDir, 'trials-local', trialJobId); const trialLocalTempFolder: string = path.join(this.expRootDir, 'trials', trialJobId);
await executor.createFolder(executor.joinPath(trialJobDetail.workingDirectory, '.nni')); await executor.createFolder(executor.joinPath(trialJobDetail.workingDirectory, '.nni'));
...@@ -582,7 +582,7 @@ class RemoteMachineTrainingService implements TrainingService { ...@@ -582,7 +582,7 @@ class RemoteMachineTrainingService implements TrainingService {
const executor = await this.getExecutor(trialJobId); const executor = await this.getExecutor(trialJobId);
const trialWorkingFolder: string = executor.joinPath(executor.getRemoteExperimentRootDir(getExperimentId()), 'trials', trialJobId); const trialWorkingFolder: string = executor.joinPath(executor.getRemoteExperimentRootDir(getExperimentId()), 'trials', trialJobId);
const trialLocalTempFolder: string = path.join(this.expRootDir, 'trials-local', trialJobId); const trialLocalTempFolder: string = path.join(this.expRootDir, 'trials', trialJobId);
const fileName: string = generateParamFileName(hyperParameters); const fileName: string = generateParamFileName(hyperParameters);
const localFilepath: string = path.join(trialLocalTempFolder, fileName); const localFilepath: string = path.join(trialLocalTempFolder, fileName);
......
...@@ -29,6 +29,7 @@ export class FrameworkControllerEnvironmentService extends KubernetesEnvironment ...@@ -29,6 +29,7 @@ export class FrameworkControllerEnvironmentService extends KubernetesEnvironment
this.config = config; this.config = config;
// Create kubernetesCRDClient // Create kubernetesCRDClient
this.kubernetesCRDClient = FrameworkControllerClientFactory.createClient(this.config.namespace); this.kubernetesCRDClient = FrameworkControllerClientFactory.createClient(this.config.namespace);
this.genericK8sClient.setNamespace = this.config.namespace ?? "default"
// Create storage // Create storage
if (this.config.storage.storageType === 'azureStorage') { if (this.config.storage.storageType === 'azureStorage') {
if (this.config.storage.azureShare === undefined || if (this.config.storage.azureShare === undefined ||
...@@ -194,7 +195,7 @@ export class FrameworkControllerEnvironmentService extends KubernetesEnvironment ...@@ -194,7 +195,7 @@ export class FrameworkControllerEnvironmentService extends KubernetesEnvironment
kind: 'Framework', kind: 'Framework',
metadata: { metadata: {
name: frameworkcontrollerJobName, name: frameworkcontrollerJobName,
namespace: this.config.namespace ? this.config.namespace : "default", namespace: this.config.namespace ?? "default",
labels: { labels: {
app: this.NNI_KUBERNETES_TRIAL_LABEL, app: this.NNI_KUBERNETES_TRIAL_LABEL,
expId: this.experimentId, expId: this.experimentId,
......
...@@ -26,6 +26,7 @@ export class KubeflowEnvironmentService extends KubernetesEnvironmentService { ...@@ -26,6 +26,7 @@ export class KubeflowEnvironmentService extends KubernetesEnvironmentService {
// Create kubernetesCRDClient // Create kubernetesCRDClient
this.kubernetesCRDClient = KubeflowOperatorClientFactory.createClient( this.kubernetesCRDClient = KubeflowOperatorClientFactory.createClient(
this.config.operator, this.config.apiVersion); this.config.operator, this.config.apiVersion);
this.kubernetesCRDClient.namespace = this.config.namespace ?? "default";
// Create storage // Create storage
if (this.config.storage.storageType === 'azureStorage') { if (this.config.storage.storageType === 'azureStorage') {
if (this.config.storage.azureShare === undefined || if (this.config.storage.azureShare === undefined ||
...@@ -41,7 +42,7 @@ export class KubeflowEnvironmentService extends KubernetesEnvironmentService { ...@@ -41,7 +42,7 @@ export class KubeflowEnvironmentService extends KubernetesEnvironmentService {
this.config.operator, this.config.apiVersion, keyValutConfig, azureStorage); this.config.operator, this.config.apiVersion, keyValutConfig, azureStorage);
this.azureStorageAccountName = azureKubeflowClusterConfig.azureStorage.accountName; this.azureStorageAccountName = azureKubeflowClusterConfig.azureStorage.accountName;
this.azureStorageShare = azureKubeflowClusterConfig.azureStorage.azureShare; this.azureStorageShare = azureKubeflowClusterConfig.azureStorage.azureShare;
this.genericK8sClient.setNamespace = this.config.namespace ?? "default";
this.createStoragePromise = this.createAzureStorage( this.createStoragePromise = this.createAzureStorage(
azureKubeflowClusterConfig.keyVault.vaultName, azureKubeflowClusterConfig.keyVault.vaultName,
azureKubeflowClusterConfig.keyVault.name azureKubeflowClusterConfig.keyVault.name
...@@ -186,7 +187,7 @@ export class KubeflowEnvironmentService extends KubernetesEnvironmentService { ...@@ -186,7 +187,7 @@ export class KubeflowEnvironmentService extends KubernetesEnvironmentService {
kind: this.kubernetesCRDClient.jobKind, kind: this.kubernetesCRDClient.jobKind,
metadata: { metadata: {
name: kubeflowJobName, name: kubeflowJobName,
namespace: 'default', namespace: this.kubernetesCRDClient.namespace,
labels: { labels: {
app: this.NNI_KUBERNETES_TRIAL_LABEL, app: this.NNI_KUBERNETES_TRIAL_LABEL,
expId: this.experimentId, expId: this.experimentId,
......
...@@ -77,7 +77,7 @@ export class KubernetesEnvironmentService extends EnvironmentService { ...@@ -77,7 +77,7 @@ export class KubernetesEnvironmentService extends EnvironmentService {
if (this.genericK8sClient === undefined) { if (this.genericK8sClient === undefined) {
throw new Error("genericK8sClient undefined!"); throw new Error("genericK8sClient undefined!");
} }
const namespace = this.genericK8sClient.getNamespace ? this.genericK8sClient.getNamespace : "default" const namespace = this.genericK8sClient.getNamespace ?? "default";
await this.genericK8sClient.createSecret( await this.genericK8sClient.createSecret(
{ {
apiVersion: 'v1', apiVersion: 'v1',
...@@ -180,7 +180,7 @@ export class KubernetesEnvironmentService extends EnvironmentService { ...@@ -180,7 +180,7 @@ export class KubernetesEnvironmentService extends EnvironmentService {
const body = fs.readFileSync(filePath).toString('base64'); const body = fs.readFileSync(filePath).toString('base64');
const registrySecretName = String.Format('nni-secret-{0}', uniqueString(8) const registrySecretName = String.Format('nni-secret-{0}', uniqueString(8)
.toLowerCase()); .toLowerCase());
const namespace = this.genericK8sClient.getNamespace ? this.genericK8sClient.getNamespace : "default" const namespace = this.genericK8sClient.getNamespace ?? "default";
await this.genericK8sClient.createSecret( await this.genericK8sClient.createSecret(
{ {
apiVersion: 'v1', apiVersion: 'v1',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment