-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add interrupt_mode & getSpec #3951
Conversation
@@ -34,6 +35,8 @@ export class JupyterKernelSpec implements IJupyterKernelSpec { | |||
this.metadata = specModel.metadata; | |||
// tslint:disable-next-line: no-any | |||
this.env = specModel.env as any; // JSONObject, but should match | |||
// tslint:disable-next-line: no-any | |||
this.interrupt_mode = specModel.interrupt_mode as any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of the spec. If interrupt_mode = 'message' we should send a message to the kernel to interrupt. Rust is one such kernel.
Not fixing this, just exposing this information so we can use it when fixing other realted issues
resources | ||
}; | ||
} | ||
traceError('Fetching kernel spec from raw kernel using JLab API'); | ||
return this.realKernel.getSpec(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API doesn't work, realKernel.getSpec
goes to Jupyter Lab API and that attempts to make a REST call to the base (dummy url).
This should not get executed hence added error logging.
public async getSpec(): Promise<Kernel.ISpecModel> { | ||
if (this.kernelProcess.kernelConnectionMetadata.kind === 'startUsingKernelSpec') { | ||
const kernelSpec = cloneDeep(this.kernelProcess.kernelConnectionMetadata.kernelSpec) as any; | ||
const resources = 'resources' in kernelSpec ? kernelSpec.resources : {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using raw kernels, we have the kernel spec, hence return that.
Not used today, but will be used in long running kernels, noop change.
b68e61d
to
d54c8b7
Compare
Part of #3927
This is something that came out of the long running kernels work.
It does'nt fix anything, but adds stuff we will need eventually.