Skip to content

Commit d155955

Browse files
authored
Add docs for the new quarto call engine julia commands (#1591)
* Add docs for the new `quarto call engine julia` commands * remove "a couple" * "for example" * rework sentence
1 parent 82b07ef commit d155955

File tree

1 file changed

+144
-4
lines changed

1 file changed

+144
-4
lines changed

docs/computations/julia.qmd

Lines changed: 144 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,150 @@ The currently available options are:
333333
- `exeflags`: An array of strings which are appended to the `julia` command that starts the worker process. For example, a notebook is run with `--project=@.` by default (the environment in the directory where the notebook is stored) but this could be overridden by setting `exeflags: ["--project=/some/directory/"]`.
334334
- `env`: An array of strings where each string specifies one environment variable that is passed to the worker process. For example, `env: ["SOMEVAR=SOMEVALUE"]`.
335335

336+
### `quarto call engine julia` commands
337+
338+
Starting with Quarto 1.7, The julia engine offers CLI commands for configuration and monitoring via the `quarto call engine julia` entrypoint.
339+
340+
#### `status`
341+
342+
The `status` command prints out information about the currently running server process as well as potential worker processes. For example:
343+
344+
```
345+
$ quarto call engine julia status
346+
QuartoNotebookRunner server status:
347+
started at: 9:44:31 (47 seconds ago)
348+
runner version: 0.15.0
349+
environment: /Users/username/Library/Caches/quarto/julia/
350+
pid: 42008
351+
port: 8000
352+
julia version: 1.11.4
353+
timeout: 5 minutes
354+
workers active: 1
355+
worker 1:
356+
path: /Users/username/notebook.qmd
357+
run started: 9:44:38 (40 seconds ago)
358+
run finished: -
359+
timeout: 5 minutes
360+
pid: 42026
361+
exe: `julia`
362+
exeflags: ["--color=yes"]
363+
env: ["JULIA_PROJECT=@."]
364+
```
365+
366+
#### `close`
367+
368+
The `close` command allows shutting down notebook worker processes.
369+
By default, only closing of idle worker processes is allowed.
370+
A worker process is idle when its `run finished` status is populated. In this case, we can call `close` on it:
371+
372+
```
373+
$ quarto call engine julia status
374+
QuartoNotebookRunner server status:
375+
started at: 9:44:31 (5 minutes 41 seconds ago)
376+
runner version: 0.15.0
377+
environment: /Users/username/Library/Caches/quarto/julia/
378+
pid: 42008
379+
port: 8000
380+
julia version: 1.11.4
381+
timeout: 5 minutes
382+
workers active: 1
383+
worker 1:
384+
path: /Users/username/notebook.qmd
385+
run started: 9:44:38 (5 minutes 34 seconds ago)
386+
run finished: 9:46:21 (took 1 minute 43 seconds)
387+
timeout: 5 minutes (1 minute 9 seconds left)
388+
pid: 42026
389+
exe: `julia`
390+
exeflags: ["--color=yes"]
391+
env: ["JULIA_PROJECT=@."]
392+
393+
$ quarto call engine julia close /Users/username/notebook.qmd
394+
Worker closed successfully.
395+
```
396+
397+
To force a busy worker to close, for example if it's stuck in an endless loop or because a computation is taking too long, the `--force` flag can be added.
398+
Using this flag means losing all the work that the worker process has done so far.
399+
At the next run, the worker process will have to be started from scratch and all packages loaded again:
400+
401+
```
402+
$ quarto call engine julia status
403+
QuartoNotebookRunner server status:
404+
started at: 11:2:40 (16 seconds ago)
405+
runner version: 0.15.0
406+
environment: /Users/username/Library/Caches/quarto/julia/
407+
pid: 50642
408+
port: 8000
409+
julia version: 1.11.4
410+
timeout: 5 minutes
411+
workers active: 1
412+
worker 1:
413+
path: /Users/username/notebook.qmd
414+
run started: 11:2:47 (9 seconds ago)
415+
run finished: -
416+
timeout: 5 minutes
417+
pid: 50650
418+
exe: `julia`
419+
exeflags: ["--color=yes"]
420+
env: ["JULIA_PROJECT=@."]
421+
422+
$ quarto call engine julia close /Users/username/notebook.qmd
423+
ERROR: Julia server returned error after receiving "close" command:
424+
425+
Failed to close notebook: /Users/username/notebook.qmd
426+
427+
The underlying Julia error was:
428+
429+
Tried to close file "/Users/username/notebook.qmd" but the corresponding worker is busy.
430+
431+
Stack trace:
432+
[omitted for brevity]
433+
434+
$ quarto call engine julia close --force /Users/username/notebook.qmd
435+
Worker force-closed successfully.
436+
437+
$ quarto call engine julia status
438+
QuartoNotebookRunner server status:
439+
started at: 11:2:40 (46 seconds ago)
440+
runner version: 0.15.0
441+
environment: /Users/username/Library/Caches/quarto/julia/
442+
pid: 50642
443+
port: 8000
444+
julia version: 1.11.4
445+
timeout: 5 minutes (4 minutes 56 seconds left)
446+
workers active: 0
447+
```
448+
449+
#### `stop`
450+
451+
The `stop` command shuts down the server process gracefully. Note that you will get an error if any workers are currently busy:
452+
453+
```
454+
$ quarto call engine julia status
455+
QuartoNotebookRunner server status:
456+
started at: 11:2:40 (3 minutes 43 seconds ago)
457+
runner version: 0.15.0
458+
environment: /Users/username/Library/Caches/quarto/julia/
459+
pid: 50642
460+
port: 8000
461+
julia version: 1.11.4
462+
timeout: 5 minutes (1 minute 59 seconds left)
463+
workers active: 0
464+
465+
$ quarto call engine julia stop
466+
Server stopped.
467+
468+
$ quarto call engine julia status
469+
Julia control server is not running.
470+
```
471+
472+
#### `kill`
473+
474+
The `kill` command shuts the server process down forcefully. This command is intended as a last resort when the server is in a bad state and unresponsive. Note that all worker processes will be killed as well, so you will lose all progress.
475+
476+
#### `log`
477+
478+
The `log` command prints the output of the internal log file of the server process. If the server process fails to start or unexpectedly quits, this log file might contain useful information.
479+
336480
### `juliaup` integration
337481

338482
[`juliaup`](https://github.com/JuliaLang/juliaup) is the recommended way to
@@ -474,7 +618,3 @@ packages that wish to extend the functionality of notebooks in other ways.
474618
Please direct questions and requests regarding this functionality to the
475619
[QuartoNotebookRunner](https://github.com/PumasAI/QuartoNotebookRunner.jl)
476620
repository.
477-
478-
### Limitations
479-
480-
Currently, the `engine: julia` option must be specified in each `.qmd` file. Setting the engine project-wide via `_quarto.yml` [is not yet supported](https://github.com/quarto-dev/quarto-cli/issues/3157).

0 commit comments

Comments
 (0)