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

ocamlPackages.jupyter: init at f886e34 #82203

Closed
wants to merge 4 commits into from
Closed

Conversation

kwshi
Copy link

@kwshi kwshi commented Mar 10, 2020

Motivation for this change

The jupyter NixOS module allows creation of custom kernels. OCaml is a popular functional programming language and OCaml Jupyter is a popular OCaml kernel for the Jupyter notebook server. This PR adds the OCaml Jupyter kernel to ocamlPackages, making it possible to create custom OCaml kernels for NixOS-run Jupyter servers.

Things done

(This is my first attempt at contributing to nixpkgs, so please let me know what I can/should be doing better!)

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@kwshi kwshi changed the title OCaml Jupyter kernel ocamlPackages.jupyter: init at f886e34 Mar 10, 2020
@vbgl
Copy link
Contributor

vbgl commented Mar 10, 2020

Thanks for your contribution!

Can you please quickly explain how to try this out?

The program ocaml-jupyter-opam-genspec seems completely broken. I guess it is better not to install it.

Also, It would be nice if you could find a better version numbers (increasing numbers are preferred).

@kwshi
Copy link
Author

kwshi commented Mar 11, 2020

@vbgl AFAIK ocaml-jupyter-opam-genspec is meant for those who use OPAM to manage their OCaml install/packages. Its only role is, as a convenience, to auto-generate the Jupyter kernelspec files using OPAM variables to point to the correct paths where the kernel binary is installed.

For those who use Nix to manage their OCaml packages, that program is not relevant since (1) it tries to ask OPAM for its install path, and OPAM may very well not be installed; (2) whatever paths it generates are irrelevant, since the actual binary would be installed in the Nix store, not the OPAM store; (3) NixOS users won't use the kernelspec files produced by the genspec program anyway but rather configure it through the NixOS module system.

Following the example given in the NixOS module docs, here is a sample configuration (in configuration.nix) that would be used to setup an OCaml kernel:

{
  ocaml = {
    displayName = "OCaml";
    argv = [
      "${ocamlPackages.jupyter}/bin/ocaml-jupyter-kernel"
      "--connection_file"
      "{connection_file}"
    ];
    language = "ocaml";
  };
}

(I should note that I haven't tested whether this exactly works, or how to get additional packages loaded into the kernel--being somewhat new to NixOS, I still haven't quite figured out how to test my NixOS config using custom packages not in the main channel, etc. Any suggestions/help would be appreciated!)

Finally, regarding version numbers: previous versions of the OCaml Jupyter package were not build-able on NixOS without OPAM, so I had opened an issue and the author had recently fixed it to make it friendly to non-OPAM users. There has not been another actual "release" since then, so instead of a proper version I picked the latest commit ID to make it work. When the author of that package does make a release version, then I will update the version here to match.

@stale
Copy link

stale bot commented Sep 8, 2020

Hello, I'm a bot and I thank you in the name of the community for your contributions.

Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do:

If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list.

If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past.

If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments.

Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 8, 2020
@bcdarwin
Copy link
Member

Hi @kwshi, it looks like upstream has made a new release. Would you consider updating your PR?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 15, 2020
@stale
Copy link

stale bot commented Jun 4, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 4, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 10, 2023
@ulrikstrid
Copy link
Member

@kwshi If you're still interested in this I took the liberty to resolve the conflicts and made a updated version as a suggestion. I'm not a jupyter user so I don't think I should maintain it.

@Janik-Haag
Copy link
Member

Janik-Haag commented Jun 19, 2023

I will close the pr in a few weeks if @kwshi isn't interested anymore and no one else want's to maintain it.

Co-authored-by: Ulrik Strid <ulrik.strid@outlook.com>
@kwshi
Copy link
Author

kwshi commented Jun 20, 2023

I am still interested in this-- for the time being, I'm a bit busy, but I'll try to find a time to check/try this out in the next few weeks.

Copy link
Member

@Janik-Haag Janik-Haag left a comment

Choose a reason for hiding this comment

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

When trying to execute the build derivation it throws an error about opam, this might be fixed after version updates and a rebase.

./result/bin/ocaml-jupyter-opam-genspec: line 3: opam: command not found

Comment on lines +30 to +33
src = fetchurl {
url = "https://github.com/akabe/ocaml-jupyter/archive/refs/tags/v${version}.tar.gz";
sha256 = "sha256-npQcQyksrSknCHngqbORAqgwn2j3UFWFTVeixRiU+DQ=";
};
Copy link
Member

Choose a reason for hiding this comment

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

this should be changed to the fetchFromGitHub wrapper

Comment on lines +25 to +28
version = "2.8.2";

minimumOCamlVersion = "4.10";
duneVersion = "3";
Copy link
Member

Choose a reason for hiding this comment

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

You probably want to update those versions.

@Janik-Haag
Copy link
Member

I am still interested in this-- for the time being, I'm a bit busy, but I'll try to find a time to check/try this out in the next few weeks.

Take your time :D

@AndersonTorres
Copy link
Member

Closing as dead.

Feel free to reopen.

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

7 participants