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

Creating custom builds with alternative kernels #853

Open
psychemedia opened this issue Aug 5, 2024 · 10 comments
Open

Creating custom builds with alternative kernels #853

psychemedia opened this issue Aug 5, 2024 · 10 comments
Labels

Comments

@psychemedia
Copy link

Is there a recipe for building custom Jupyter Desktop installers that bundle alternative kernels?

I am looking to distribute JupyterLab-Desktop to users in a limited permissions secure environment who only require access to an R kernel, and was wondering easy that might be with a custom built installer?

@JasonWeill
Copy link

@psychemedia Thanks for opening this! Creating a custom environment, such as with Anaconda's conda tool, should let you deploy JupyterLab Desktop and other packages for custom kernels. This is not likely to be a feature in JupyterLab Desktop itself, though. Would using a package manager solve this problem for you?

@psychemedia
Copy link
Author

The issue is not so much installing a new kernel into an already downloaded JupyterLab distribution, it's more a case of building a distribution with a different kernel built in (and then most likely disabling the ability to install further packages).

I'm exploring solutions that can be used in secure environments (prison estates, essentially), so as you might imagine there are certain conditions attached with installing software depending on the prison category.

@JasonWeill
Copy link

Coincidentally, the previous issue (#852) asks about using JupyterLab Desktop in a completely offline/airgapped environment. On my macOS laptop, I tried using JupyterLab Desktop with no network connections at all, and it worked for me. I would expect that deploying a JupyterLab Desktop installation with additional kernels and configuration should be possible, but I'm not experienced with doing so.

See a Discourse thread, with a response by @minrk, here: https://discourse.jupyter.org/t/install-common-jupyterlab-extension-and-custom-kernel-in-jupyterhub/24442/2

@psychemedia
Copy link
Author

psychemedia commented Aug 7, 2024

Presumably we can install additional kernels via the server setup file? https://github.com/jupyterlab/jupyterlab-desktop/blob/master/env_installer/jlab_server.yaml

For example, for R: https://github.com/jupyter-xeus/xeus-r/ or https://anaconda.org/r/r-irkernel (do they include https://anaconda.org/r/r as a dependency?)

[UPDATE: simply adding xeus-r to the config file did not seem to result in an R kernel being registered within a custom JupyterLab-desktop build.]

What does https://github.com/jupyter-xeus/xeus-r/

Where we custom jupyter extensions be installed into the application? Into env_installer as pip dependencies? How could we then remove the pip installer?

@mbektas
Copy link
Member

mbektas commented Aug 8, 2024

@psychemedia You can customize the bundled Python environment by updating the jlab_server.yaml as you guessed. You can add / remove packages to that file.

It is also possible to make changes to the environment configuration by placing files into env_installer/extras/ directory. See this page_config.json which disables the announcements extension.

You can refer to developer documentation for creating an installer locally.

@psychemedia
Copy link
Author

psychemedia commented Aug 8, 2024

@mbektas thanks. I tried adding the xeus R kernel to the server yaml and rebuilt the app but didn't see the r kernel listed as an option in the app?

@mbektas
Copy link
Member

mbektas commented Aug 9, 2024

sorry I missed another command that needs to be called after updating the yaml. yarn update_conda_lock. I opened a test PR that adds xeus-r. Installers will be available here.

@psychemedia
Copy link
Author

@mbektas Testing on my Mac, (osx-arm64), the downloaded application reports as broken when I try to run it.
image

@mbektas
Copy link
Member

mbektas commented Aug 9, 2024

that alert is shown because the created installers are not code signed & notarized. We only sign & notarize installers that will be released. If you build locally, you shouldn't run into this issue.
If you plan to distribute a customized JupyterLab Desktop installer for macOS you will need to sign and notarize yourself.

@psychemedia
Copy link
Author

psychemedia commented Aug 10, 2024

Ah, of course... so this maybe is the temp workaround: % xattr -d com.apple.quarantine /Applications/JupyterLab.app

And for local build: yarn create_env_installer:osx-arm64 && yarn dist:osx-arm64-dev (-dev removes signing requirement).

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

No branches or pull requests

4 participants