Skip to content

jupyter: add ijavascript kernel#35290

Closed
schneefux wants to merge 6 commits intoNixOS:masterfrom
schneefux:pkg.jupyter-javascript
Closed

jupyter: add ijavascript kernel#35290
schneefux wants to merge 6 commits intoNixOS:masterfrom
schneefux:pkg.jupyter-javascript

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.
@schneefux schneefux requested a review from FRidh as a code owner February 21, 2018 19:49
@GrahamcOfBorg GrahamcOfBorg added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python Python is a high-level, general-purpose programming language. 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Feb 21, 2018
@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 schneefux force-pushed the pkg.jupyter-javascript branch from 3be5555 to c845453 Compare February 22, 2018 18:45
@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.

@schneefux schneefux force-pushed the pkg.jupyter-javascript branch from 41ba684 to 343b597 Compare March 11, 2018 15:16
@veprbl veprbl added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 28, 2018
@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

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python Python is a high-level, general-purpose programming language. 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants