Skip to content
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.

Jupyter notebooks with non-Python kernels #329

Open
DaneWeber opened this issue Mar 11, 2023 · 3 comments
Open

Jupyter notebooks with non-Python kernels #329

DaneWeber opened this issue Mar 11, 2023 · 3 comments

Comments

@DaneWeber
Copy link
Contributor

I went to set up a devcontainer today to run Jupyter notebooks with non-Python kernels (Ruby in this case). I didn't find anything that seemed to be the straightforward way to do this and I ended up using a Python devcontainer with a postCreateCommand I pulled from the IRuby kernel page:

"postCreateCommand": "sudo apt update && sudo apt install -y libtool libffi-dev ruby ruby-dev make && gem install iruby && iruby register --force"

Before I create a PR for a Feature to install the IRuby Jupyter kernel, I wonder about the best approach to add additional Jupyter kernels (see the list).

Scenarios I'm considering:

  • Most Jupyter users probably just care about a single kernel for the language they want to work with.
  • Some users may want a single devcontainer with many kernels in order to work with many different languages.
  • Most Jupyter users are probably doing so in a dedicated devcontainer.
  • There may, however, be situations where the Jupyter notebooks coexist with other application code that also needs to run within the devcontainer.

Limitations:

  • Because we don't have a way to define dependencies, IRuby requires Python (for Jupyter), Ruby, and IRuby. There's a similar situation for other kernels.
  • I could put together a big Feature that is configurable to include any subset of the kernels, but actually adding any individual kernel would require setting that in the config.
  • If I create a separate Feature for each, that could be a lot of Features with something like one for every language Feature.
  • I could possibly add the kernel as a configurable option to the main language Features (so the Ruby feature for IRuby).
@danielbraun89
Copy link
Member

danielbraun89 commented Apr 4, 2023

@DaneWeber given the considerations you laid out eloquently I think its best to have a different feature for each of the language kernels? instead of one big jupyter kernel feature. Also this seems like a good candidate for the feature composition proposal.

For ruby as an example, the kernel feature can be just the gem install iruby && iruby register --force line, and declare the official ruby & python features as a dependencies

Adding the kernel into the language feature is always an option, but you can make the case as to why jupyter gets the special treatment over other third party packages/frameworks? (although python feature already do this)

@evilhamsterman
Copy link

This project is not associated with the devcontainer project and appears to have been abandoned #628 . The official project has removed all devcontainer-contrib features from their listing. devcontainers/devcontainers.github.io#451. There is a fork that is being worked on to update and maintain the features https://github.com/devcontainers-extra/features

@DaneWeber
Copy link
Contributor Author

@evilhamsterman -- thank you for the update and relevant links! This project has remained on my mind and I still want to resolve the Jupyter kernels issue every so often.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants