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

Update environment.yml #400

Closed

Conversation

curtcorum
Copy link
Contributor

#399 (comment)

Adding https://github.com/yuvipanda/jupyter-pluto-proxy so that Pluto can be used from JupyterLab in binder instances.

Pluto should only get loaded in the docker instance, if I understand correctly.

Copy link

codecov bot commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.00%. Comparing base (7f4ecdf) to head (e591a37).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #400   +/-   ##
=======================================
  Coverage   89.00%   89.00%           
=======================================
  Files          44       44           
  Lines        2746     2746           
=======================================
  Hits         2444     2444           
  Misses        302      302           
Flag Coverage Δ
base 86.42% <ø> (ø)
core 83.46% <ø> (ø)
files 93.70% <ø> (ø)
komamri 93.98% <ø> (ø)
plots 89.64% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@cncastillo cncastillo self-requested a review June 4, 2024 02:16
Copy link
Member

@cncastillo cncastillo left a comment

Choose a reason for hiding this comment

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

Looks great! Fingers crossed this works 🤞.

@cncastillo
Copy link
Member

I will try to generate a docker image of this PR with MyBinder. If that is not possible I will just merge to test it.

@cncastillo
Copy link
Member

cncastillo commented Jun 4, 2024

I was able to create an image! https://mybinder.org/v2/gh/curtcorum/KomaMRI.jl/docker_jupyterlab_pluto

But I could not launch the Pluto server, probably we still need to add Pluto.jl in the Dockerfile, like in https://github.com/yuvipanda/jupyter-pluto-proxy/blob/main/Dockerfile#L10.

@curtcorum
Copy link
Contributor Author

curtcorum commented Jun 4, 2024 via email

@cncastillo
Copy link
Member

cncastillo commented Jun 4, 2024

It works! if I install Pluto, PlutoUI and PlutoPlotly using JupyterLab's Julia console, I can run Pluto notebooks!
image

To take advantage of Binder's prebuilt environment, I had to disable the reproducible aspect of the Pluto notebook using

begin
    import Pkg
    Pkg.activate("/home/jovyan/") # Use prebuilt environment (with Koma preinstalled)
end

I think it is worth sacrificing reproducibility (Pluto's internal Manifest.toml info), to make the experience better for the user (the code runs faster).

@curtcorum
Copy link
Contributor Author

curtcorum commented Jun 4, 2024 via email

@curtcorum
Copy link
Contributor Author

curtcorum commented Jun 4, 2024

@cncastillo

Update, we can launch a specific Jupyter notebook (python or julia) from a binder link, also can launch into an active Pluto start page session...still cannot go direct to a specific Pluto notebook...

see: #399 (comment)

@cncastillo
Copy link
Member

Amazing, when this is merged, we can point to the gh-pages branch with all the generated notebooks. Literate already offers a variable @__BINDER_ROOT_URL__ that could be useful for this (example: https://fredrikekre.github.io/Literate.jl/v2/generated/example/). I am testing it on #403.

@cncastillo
Copy link
Member

Ok, the links to the binder work properly with Literate, but the docker image fails to generate (https://mybinder.org/v2/gh/JuliaHealth/KomaMRI.jl/gh-pages). I will need to take a look later this week.

@cncastillo
Copy link
Member

cncastillo commented Jun 22, 2024

Hi! I managed to fix this in dev! No extra dependency was added to KomaMRI, and no postBuild script was needed (everything is in .binder/).

https://juliahealth.org/KomaMRI.jl/dev/
image

Sometimes, building the docker image times out, but that will be fixed when we tag v0.9, which removes CUDA as a strong dependency.

Also, I am not completely sure how to make Pluto notebooks use the compiled environment by default yet, but at least they work and open directly!

EDIT: modifying the package loading cell to

begin
	import Pkg
	Pkg.activate("/home/jovyan/.binder/")
	using KomaMRI, PlutoPlotly, PlutoUI
end

seems to work.

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.

None yet

2 participants