Skip to content
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

Merged
merged 4 commits into from
Nov 20, 2020
Merged

Add interrupt_mode & getSpec #3951

merged 4 commits into from
Nov 20, 2020

Conversation

DonJayamanne
Copy link
Contributor

@DonJayamanne DonJayamanne commented Nov 17, 2020

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.

@@ -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;
Copy link
Contributor Author

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();
Copy link
Contributor Author

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 : {};
Copy link
Contributor Author

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.

@DonJayamanne DonJayamanne marked this pull request as ready for review November 17, 2020 20:38
@DonJayamanne DonJayamanne requested a review from a team as a code owner November 17, 2020 20:38
@DonJayamanne DonJayamanne merged commit de438d6 into main Nov 20, 2020
@DonJayamanne DonJayamanne deleted the kernelApi branch November 20, 2020 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants