Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Install the ZMQ prebuilt binaries and verify ZMQ works on startup #10551

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

Merged
merged 8 commits into from
Mar 13, 2020

Conversation

rchiodo
Copy link

@rchiodo rchiodo commented Mar 13, 2020

For #10483

@rchiodo rchiodo self-assigned this Mar 13, 2020
@@ -0,0 +1 @@
Add ZMQ library to extension
Copy link
Author

Choose a reason for hiding this comment

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

Tested on windows and linux (ubuntu 18)

new copyWebpackPlugin([{ from: './node_modules/zeromq/**/*.js' }]),
new copyWebpackPlugin([{ from: './node_modules/zeromq/**/*.node' }]),
new copyWebpackPlugin([{ from: './node_modules/zeromq/**/*.json' }]),
new copyWebpackPlugin([{ from: './node_modules/node-gyp-build/**/*' }])
Copy link

@DonJayamanne DonJayamanne Mar 13, 2020

Choose a reason for hiding this comment

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

Does this work? Will this be cross play?
I thought we'd be using the prebuilt binaries, instead of using npm install?

Copy link
Author

Choose a reason for hiding this comment

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

This is installing the prebuilt binaries into the node_modules directory. The '.node' files are the prebuilt binaries.

Copy link
Author

Choose a reason for hiding this comment

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

Then they end up in the vsix this way

Copy link
Author

Choose a reason for hiding this comment

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

Otherwise it wouldn't have worked on my linux machine

@codecov-io
Copy link

codecov-io commented Mar 13, 2020

Codecov Report

Merging #10551 into master will increase coverage by 0.01%.
The diff coverage is 82.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10551      +/-   ##
==========================================
+ Coverage   60.76%   60.77%   +0.01%     
==========================================
  Files         578      579       +1     
  Lines       31355    31403      +48     
  Branches     4464     4469       +5     
==========================================
+ Hits        19052    19085      +33     
- Misses      11335    11346      +11     
- Partials      968      972       +4     
Impacted Files Coverage Ξ”
src/client/telemetry/index.ts 87.38% <ΓΈ> (ΓΈ)
.../datascience/interactive-common/interactiveBase.ts 5.64% <25.00%> (+0.12%) ⬆️
src/client/datascience/jupyter/jupyterExecution.ts 51.68% <70.00%> (+2.31%) ⬆️
...rc/client/datascience/errorHandler/errorHandler.ts 90.62% <92.30%> (+0.62%) ⬆️
src/client/common/utils/localize.ts 95.19% <100.00%> (+0.05%) ⬆️
src/client/datascience/commands/serverSelector.ts 85.71% <100.00%> (+1.09%) ⬆️
src/client/datascience/constants.ts 99.71% <100.00%> (+<0.01%) ⬆️
...science/jupyter/jupyterZMQBinariesNotFoundError.ts 100.00% <100.00%> (ΓΈ)
src/client/datascience/jupyter/serverSelector.ts 91.17% <100.00%> (+0.40%) ⬆️
src/datascience-ui/react-common/arePathsSame.ts 75.00% <0.00%> (-12.50%) ⬇️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update ca776ab...1acba4f. Read the comment docs.

traceInfo(`ZMQ connection to port ${port} verified.`);
} catch (e) {
traceError(`Exception while attempting zmq :`, e);
// If this happens, disable datascience altogether. We can't talk to
Copy link
Member

Choose a reason for hiding this comment

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

Last time we discussed this I thought the plan was that in this situation they would be allowed to remote connect using the old path of specifying the URI

Copy link
Author

Choose a reason for hiding this comment

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

Hmm, yes that's true. Didn't even think of making just remote connections work. Not even sure how we'd do that. That would likely be rather complex (for what might be less then 1% of users). I think we could do this for now and think about how to do just remote in a future update.

Copy link
Author

Choose a reason for hiding this comment

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

I think what I could do is put this same check in a different spot (where we start a server). Then instead of disabling, I'd put up an error dialog that says the same thing, and a button that lets you pick the remote URI

Copy link
Member

Choose a reason for hiding this comment

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

I like that idea as long as it's not too crazy much work. Just feels safer.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication


export const nativeDependencyFail = localize(
'DataScience.nativeDependencyFail',
'{0}. We cannot launch a jupyter server for you because your OS is not supported. Select an already running server if you wish to continue.'
Copy link
Member

Choose a reason for hiding this comment

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

At first the wording here looked odd. Since we are not launching a jupyter server. But I think from the user's perspective this wording makes sense, given that we are launching essentially a "fake" jupyter server on their behalf.

} catch (e) {
traceError(`Exception while attempting zmq :`, e);
sendTelemetryEvent(Telemetry.ZMQNotSupported);
this.zmqError = new JupyterZMQBinariesNotFoundError(e.toString());

Choose a reason for hiding this comment

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

Why not pass in e.message, if we're going to display this, then i'd prefer we passed a meaningfule message.
e.tostring() will contain unstructured data.

this.zmqError = new JupyterZMQBinariesNotFoundError(e);

class JupyterZMQBinariesNotFoundError extends Error {
    constructor(originalException: Error) {
        super(originalException.message);
        this.stack = originalException.stack;
    }

Copy link
Author

Choose a reason for hiding this comment

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

The message is already meaningful. It says the platform binaries are missing.

private async startOrConnect(
options?: INotebookServerOptions,
cancelToken?: CancellationToken
): Promise<IConnection> {
// If our uri is undefined or if it's set to local launch we need to launch a server locally
if (!options || !options.uri) {
// First verify we have ZMQ installed correctly (this might change when we don't 'launch' servers anymore)
await this.verifyZMQ();

Choose a reason for hiding this comment

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

Shouldn't this be done only if the user belongs to the ZMQ experiment?
Also, I would have expected this to go into a separate PR (hooking up experiment... ) and separate class (depending on which path to go down..).

Copy link
Author

Choose a reason for hiding this comment

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

Sorry already merged.

Copy link
Author

Choose a reason for hiding this comment

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

The work for the ZMQ experiment can be picked up when we add the new experiment.

@rchiodo rchiodo merged commit dbf4d70 into master Mar 13, 2020
@rchiodo rchiodo deleted the rchiodo/zmq_install branch March 13, 2020 20:12
DonJayamanne added a commit that referenced this pull request Mar 17, 2020
* master:
  Move redux logging to a different file (#10605)
  Ensure local host only if connection not available (#10600)
  Fix a bunch of debugger issues (#10572)
  Bump acorn from 6.0.0 to 6.4.1 (#10570)
  Resize plot to fit within pdf page (#10547)
  Update dev build instructions to mention "python.insidersChannel"
  Install the ZMQ prebuilt binaries and verify ZMQ works on startup (#10551)
@lock lock bot locked as resolved and limited conversation to collaborators Mar 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants