Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 5 additions & 21 deletions labextension/src/lib/Commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { NotebookPanel } from '@jupyterlab/notebook';
import {
_legacy_executeRpc,
_legacy_executeRpcAndShowRPCError,
RPCError,
} from './RPCUtils';

import { DeployProgressState, RunPipeline } from '../widgets/deploys-progress/DeploysProgress';
Expand Down Expand Up @@ -88,28 +87,10 @@ export default class Commands {
const cmd: string =
'from kale.rpc.nb import unmarshal_data as __kale_rpc_unmarshal_data\n' +
`locals().update(__kale_rpc_unmarshal_data("${nbFileName}"))`;
console.log('Executing command: ' + cmd);
console.debug('Executing command: ' + cmd);
await NotebookUtils.sendKernelRequestFromNotebook(this._notebook, cmd, {});
};

getBaseImage = async () => {
let baseImage: string | null = null;
try {
baseImage = await _legacy_executeRpc(
this._notebook,
this._kernel,
'nb.get_base_image',
);
} catch (error) {
if (error instanceof RPCError) {
console.warn('Kale is not running in a Notebook Server', error.error);
} else {
throw error;
}
}
return baseImage;
};

getDefaultBaseImage = async (): Promise<string> => {
try {
return await _legacy_executeRpc(
Expand Down Expand Up @@ -435,7 +416,10 @@ export default class Commands {
'nb.get_namespace',
);
} catch (error) {
console.error("Failed to retrieve notebook's namespace");
console.warn(
"Could not detect the notebook's namespace. " +
'Pipeline and run links may not include the correct namespace parameter.'
);
return '';
}
};
Expand Down
2 changes: 1 addition & 1 deletion labextension/src/lib/RPCUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const executeRpc = async (
`__kale_rpc_result = __kale_rpc_run("${func}", '${serialize(
kwargs
)}', '${serialize(ctx)}')`;
console.log('Executing command: ' + cmd);
console.debug('Executing command: ' + cmd);
const expressions = { result: '__kale_rpc_result' };
let output: any = null;
try {
Expand Down
8 changes: 0 additions & 8 deletions labextension/src/widgets/LeftPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,6 @@ export class KubeflowKaleLeftPanel extends React.Component<IProps, IState> {
if (nbFilePath) {
await commands.resumeStateIfExploreNotebook(nbFilePath);
}
// Detect the base image of the current Notebook Server
const baseImage = await commands.getBaseImage();
if (baseImage) {
DefaultState.metadata.base_image = baseImage;
} else {
DefaultState.metadata.base_image = '';
}

// Get experiment information last because it may take more time to respond
this.setState({ gettingExperiments: true });
const { experiments, experiment, experiment_name } =
Expand Down
Loading