Julia native engine. Environment caching? #10364
-
DescriptionI am writing a small package which is supposed to extend Distributions.jl. The structure of my package is Project.toml
Manifest.toml
README.qmd
src/
|- NewDist.jl The content of my NewDist.jl
The Project.toml is unremarkable name = "NewDist"
uuid = "7682a1b4-220e-4e99-81b7-e147a8ccc904"
authors = ["MyNickName <[email protected]>"]
version = "0.1.1"
[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Manifest is auto-generated so I am not providing it.
Before I render, I activate my local environment and make sure that Distributions is installed, and my package is installed
I am ready to render my README.qmd. Everything goes well and I get an output as expected. Now, I feel excited and want to add another distribution. I modify the NewDist.jl to include another class. Modified NewDist.jl looks like this
I want to also include it in my vignette, so I modify README
Nothing has been changed in the YAML. I just added another Julia chunk. I try to render and I get an error
I start to panic. I try to install new version of the package in command line ( Now I modify only one option in YAML: I think what is happening is that QuartoNotebookRunner.jl is using a session, where it caches the local ( I dont know where QuartoNotebookRunner,jl keeps the cache, but I had a situation where the error kept referring me to non-existent line in the source code (which I know I deleted). Rebooting of Julia console in VSCode does not help. Only when I touched Sorry about lengthy description. I was trying to be very explicit in the steps I took. I understand that QuartoNotebookRunner,jl tries to reuse the existing session, but I think reproducibility of Quarto requires that the old session is dropped and the environment is compiled anew (even if that might cost a few extra seconds). Or perhaps there could be another flag which triggers the reuse of the old session to save compiling time (I guess my situation with active package development may be quite special). |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
@jkrumbiegel any insight on this ? And any thoughts on the use case here ?
@dmi3kno there is indeed a concept of worker that is started. You should be able to control the reuse of the worker, and even opt-out of it to always start fresh worker: https://quarto.org/docs/computations/julia.html#worker-process-reuse It should work to start a new worker each time (though I found issue recently on windows with it : #10353) I am thinking this worker restart could help your work case here.... Though @jkrumbiegel will tell us more on how QuartoNotebookRunner.jl is working. By the way, thanks a lot for testing Quarto julia's engine ! We need more feedback like this to improve it and document it correctly, so this is really valuable ! |
Beta Was this translation helpful? Give feedback.
-
I confirm that using execute:
daemon: false helps on my Ubuntu 22.04 machine. Thanks for the tip! Sorry about verbose example. I realized I could make my reprex smaller. |
Beta Was this translation helpful? Give feedback.
-
QuartoNotebookRunner only restarts workers forcefully if something fundamental like the Here's one of our test files that does this with a local env, but I don't think Revise has to be in a local env, as I said above https://github.com/PumasAI/QuartoNotebookRunner.jl/blob/56794a34b99f954d6fdd422fb0419d53322d709f/test/examples/revise_integration.qmd |
Beta Was this translation helpful? Give feedback.
QuartoNotebookRunner only restarts workers forcefully if something fundamental like the
exeflags
changes, which cannot be adjusted (for example you cannot change the number of threads in a running Julia process). For code changes in dev'ed packages that you're loading in there you're expected to useRevise
which is the canonical Julia solution to this problem. I think ifRevise
is on your load path (usually that means it's installed in your local env or in your global one), it should be loaded automatically. Could be that this is not documented, yet, in this case it should be added.Here's one of our test files that does this with a local env, but I don't think Revise has to be in a local…