Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
fix clone issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Binyang2014 committed Dec 13, 2019
1 parent 1ab4cff commit e5af896
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions src/webportal/src/app/job-submission/job-submission-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import {
} from './utils/utils';
import { SpinnerLoading } from '../components/loading';
import config from '../config/webportal.config';
import { PAI_PLUGIN, PAI_STORAGE } from './utils/constants';
import { PAI_PLUGIN } from './utils/constants';

const SIDEBAR_PARAM = 'param';
const SIDEBAR_SECRET = 'secret';
Expand Down Expand Up @@ -290,24 +290,37 @@ export const JobSubmissionPage = ({

// Init plugins for pure k8s based PAI
useEffect(() => {
if (config.launcherType === 'k8s') {
const plugin = get(extras, PAI_PLUGIN);
if (!plugin) {
// Init SSH default settings for old/empty jobs
const updatedPlugin = [
{
plugin: 'ssh',
parameters: {
jobssh: true,
},
if (config.launcherType !== 'k8s') {
return;
}

const plugin = get(extras, PAI_PLUGIN);
if (!plugin) {
// Init SSH default settings for old/empty jobs
const updatedPlugin = [
{
plugin: 'ssh',
parameters: {
jobssh: true,
},
];
const updatedExtras = cloneDeep(extras);
updatedExtras[PAI_PLUGIN] = updatedPlugin;
setExtras(updatedExtras);
}
},
];
const updatedExtras = cloneDeep(extras);
updatedExtras[PAI_PLUGIN] = updatedPlugin;
setExtras(updatedExtras);
}

setStorageConfigs(get(extras, PAI_STORAGE));
const storagePlugin = get(extras, [PAI_PLUGIN], []).find(
plugin => plugin.plugin === 'teamwise_storage',
);
const updatedStorageConfig = get(
storagePlugin,
'parameters.storageConfigNames',
);
if (
JSON.stringify(updatedStorageConfig) !== JSON.stringify(storageConfigs)
) {
setStorageConfigs(updatedStorageConfig);
}
}, [extras]);

Expand Down

0 comments on commit e5af896

Please sign in to comment.