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

Snap support #778

Merged
merged 7 commits into from
Mar 9, 2024
Merged

Snap support #778

merged 7 commits into from
Mar 9, 2024

Conversation

mbektas
Copy link
Member

@mbektas mbektas commented Feb 24, 2024

No description provided.

dmitry-lyfar and others added 5 commits January 24, 2024 07:42
Contains additional properties to make the shell commands work from
within the strict confinement. JP Desktop uses the SHELL environment
variable to launch a shell command and if SHELL is different from what
is available in the snap's core (e.g. /usr/bin/zsh), the command would
fail. Thus, bash is ensured as the SHELL option
* The snap's confinement mode is switched to classic. Mostly because JL
Server creates hidden and temp files in a jupyter notebook directory it
has open (e.g. for checkpoints or when it saves the file). Thus, if a
user has a notebook stored in $HOME, JLD fails to save it with a
permission denied error. It cannot be resolved with the snap's
personal-files interface as the interface allows to specify existing
paths only.
@mbektas
Copy link
Member Author

mbektas commented Feb 24, 2024

moving the discussion from original PR.

from @dmitry-lyfar

Hi @mbektas,

  1. double clicking the snap file didn't install. this seems to be related to classic confinement. I had to run this command on CLI to install: sudo snap install ./JupyterLab.snap --classic --dangerous

Yes, this is because snaps are not distributed as standalone archives. When we publish, a user would be able to do snap install jupyterlab-desktop --classic from the CLI or just click a button if they use a GUI Snap Store desktop app. No need to download anything.

  1. The userData and home directories used by the app changed to subfolders in ~/snap/jupyterlab-desktop/x1/. this causes issues with restoring settings from previous debian installation. but more concerning issue is in #3 below
  2. Uninstalling the app also removed the settings and Python environment installation by the app because they got installed into paths in #2 and those got deleted.
    Do you mean the bundled Python environment that is created and installed into ~/snap/jupyterlab-desktop/current/.config/?

By default, the data created within snap user directories is snapshotted and stored for, I believe, 30 days (see snap saved et al) if the snap is removed. The data is removed as well but can be recovered if snap is re-installed or via snap restore. If you prefer the bundled environment to be preserved even if JLD snap is removed, I can have a look into. But I suppose that the bundled environment is something that has a life-time of the application. If needed for longer, a user should point the application to the pre-existing environment?

@mbektas
Copy link
Member Author

mbektas commented Feb 24, 2024

@dmitry-lyfar I think it would be fine if environments can be restored within 30 days and not affected by app updates.

now the snap uploads are failing because of classic confinement. is it something you can resolve on your end?

@dmitry-lyfar
Copy link
Contributor

@dmitry-lyfar I think it would be fine if environments can be restored within 30 days and not affected by app updates.

now the snap uploads are failing because of classic confinement. is it something you can resolve on your end?

Yes, I’m awaiting the resolution here:
https://forum.snapcraft.io/t/request-for-confinement-classic-for-jupyterlab-desktop/39047/4

Once approved, the upload will start to be working.

@dmitry-lyfar
Copy link
Contributor

@mbektas the snap's classic confinement has been approved: https://forum.snapcraft.io/t/request-for-confinement-classic-for-jupyterlab-desktop/39047/5

Could you try if that works for you, please?

@mbektas
Copy link
Member Author

mbektas commented Mar 5, 2024

thanks @dmitry-lyfar . I will trigger a publish now.

@mbektas
Copy link
Member Author

mbektas commented Mar 6, 2024

@dmitry-lyfar build is succeeding now and snap is uploaded properly. I would like to test the cycle of install -> uninstall -> reinstall -> update.

@mbektas
Copy link
Member Author

mbektas commented Mar 9, 2024

@dmitry-lyfar I will go ahead and merge your changes. thanks for your contribution. jlab CLI is not working with the snap but there might be a way to solve using snap hooks support with electron builder. we can follow up on that on another PR. we need to add CLI support before we can publicly announce snap support.

@mbektas
Copy link
Member Author

mbektas commented Mar 9, 2024

Also, I plan to manually promote from candidate to stable for now.

@mbektas mbektas merged commit 660dd58 into master Mar 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants