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

More progress indicator when starting a kernel #8584

Merged
merged 7 commits into from
Dec 20, 2021
Merged

Conversation

DonJayamanne
Copy link
Contributor

For #8583

@DonJayamanne DonJayamanne requested a review from a team as a code owner December 20, 2021 20:11
await Promise.race([cachedInfo, latestInfo]);
if (cachedInfo.completed && cachedInfo.value?.version) {
return (this._version = cachedInfo.value.version);
if (this._previousVersionCall) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure we make these calls only once

const title = DataScience.activatingPythonEnvironment().format(
interpreter.displayName || getDisplayPath(interpreter.path)
);
return KernelProgressReporter.wrapAndReportProgress(resource, title, () =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Display progress message

traceInfo(`Waiting for idle on (kernel): ${session.kernel.id} -> ${session.kernel.status}`);
const progress = isRestartSession
? undefined
: KernelProgressReporter.reportProgress(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Display progress messages

@@ -242,7 +243,7 @@ export class JupyterKernelService {
// Get the activated environment variables (as a work around for `conda run` and similar).
// This ensures the code runs within the context of an activated environment.
specModel.env = await this.activationHelper
.getActivatedEnvironmentVariables(undefined, interpreter, true)
.getActivatedEnvironmentVariables(resource, interpreter, true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass resource so we can display progress message

// It could look as though the same operation is being performed multiple times (when in fact its possible we have caching in place).
// Eg. we could be attempting to start a python process, which requires activation, thats cached, however calling it multiple times
// could result in multiple messages being displayed.
// Perhaps its the right thing to do and display the message multiple times, but for now, we'll just not display it.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change this if required, felt weird to display the messages a number of times.
E.g. we have messages displayed as follows:

  • Activating Python environment abc
  • Validating kernel dependencies
  • Activating Python environment abc (again)

This change ensures we display it just once.

@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2021

Codecov Report

Merging #8584 (db66dd9) into main (95a6a3a) will increase coverage by 0%.
The diff coverage is 81%.

❗ Current head db66dd9 differs from pull request most recent head 8703ca7. Consider uploading reports for the commit 8703ca7 to get more accurate results

@@          Coverage Diff          @@
##            main   #8584   +/-   ##
=====================================
  Coverage     71%     71%           
=====================================
  Files        381     381           
  Lines      24392   24424   +32     
  Branches    3745    3749    +4     
=====================================
+ Hits       17384   17424   +40     
+ Misses      5503    5491   -12     
- Partials    1505    1509    +4     
Impacted Files Coverage Δ
...ent/datascience/progress/kernelProgressReporter.ts 72% <60%> (+13%) ⬆️
src/client/common/process/condaService.ts 78% <73%> (-4%) ⬇️
...ent/common/process/environmentActivationService.ts 74% <76%> (+<1%) ⬆️
src/client/datascience/baseJupyterSession.ts 75% <94%> (-1%) ⬇️
src/client/common/utils/localize.ts 96% <100%> (+<1%) ⬆️
...atascience/jupyter/kernels/jupyterKernelService.ts 77% <100%> (ø)
...science/jupyter/kernels/kernelDependencyService.ts 79% <100%> (+<1%) ⬆️
...client/datascience/raw-kernel/rawJupyterSession.ts 71% <100%> (+<1%) ⬆️
...atascience/interactive-window/interactiveWindow.ts 65% <0%> (-2%) ⬇️
...lient/datascience/jupyter/kernels/cellExecution.ts 73% <0%> (-1%) ⬇️
... and 5 more

@DonJayamanne DonJayamanne merged commit 8273377 into main Dec 20, 2021
@DonJayamanne DonJayamanne deleted the addProgressIndicator branch December 20, 2021 22:33
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.

2 participants