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

jupyter: add ijavascript kernel #35290

Closed
wants to merge 6 commits into from

Conversation

schneefux
Copy link
Contributor

Motivation for this change

Added the IJavascript Jupyter Notebook kernel to the (so far unmerged) pull request #33673 by @aborsu

I added a javascript kernel to pkgs/development/misc/jupyterKernels/default.nix which requires the package nodePackages.ijavascript.

Following the steps of the npm packaging documentation, I added the ijavascript package to pkgs/development/node-packages/node-packages-v6.json and added build input overrides in pkgs/development/node-packages/default-v6.nix because the package depends on node-gyp and zeromq.
Then I ran the generate.sh script. Unfortunately it generated a huge diff of the node-packages-v?.nix files.

I tested the updated module with this configuration:

  services.jupyter = {
    enable = true;
    port = 8465;
    notebookDir = "/var/www/jupyter";
    password = "'sha1:1b961dc713fb:88483270a63e57d18d43cf337e629539de1436ba'"; # test
  };

  services.nginx = {
    enable = true;
    virtualHosts = {
        "jupyter.mydomain.org" = {
                locations = {
                        "/" = {
                                proxyPass = "http://localhost:8465";
                                proxyWebsockets = true;
                        };
                };
        };
   };
};

Both python3 and javascript notebooks run fine.

Note that proxyWebsockets = true is required else the browser will fail to connect to the notebook. I discovered it by enabling debug logging in the nixos jupyter service.
NPM dependencies for the notebook need to be installed into the notebookDir.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Augustin Borsu added 4 commits February 15, 2018 21:42
This change enables us to call toPythonModules in package definitions.
Cfr following commit: 'jupyter: init standalone package'
This is a meta package for creating a jupyter notebook
kernel definition folder. It must be used in conjunction
with jupyter or jupyterhub to make different environements
availables.
@Mic92
Copy link
Member

Mic92 commented Feb 21, 2018

The diff is fine, there is no sane way to handle the complexity of npm modules.

@aborsu
Copy link
Contributor

aborsu commented Feb 22, 2018

I'm glad to see it works with another language.
Just got me thinking, if we start adding a lot of different kernels, we might want to make them disabled by default and add an override flag to make them enabled?

@schneefux
Copy link
Contributor Author

I upgraded it to a Node 8 package because a user probably wants the latest feature in the REPL.

Just got me thinking, if we start adding a lot of different kernels, we might want to make them disabled by default and add an override flag to make them enabled?

Agreed, but I lack the Nix knowledge to know how.

@FRidh
Copy link
Member

FRidh commented Jan 6, 2019

This needs to be rebased. If you still want to get this in, please open a new PR.

@FRidh FRidh closed this Jan 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants