Skip to content

Add call engine julia commands #11803

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

Merged
merged 52 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
51843df
initial stubs
jkrumbiegel Dec 11, 2024
8e73d55
use dynamically added cliffy subcommands instead
jkrumbiegel Dec 11, 2024
02ed456
factor out juliaCmd()
jkrumbiegel Dec 12, 2024
2951830
remove unused supervisor_pid
jkrumbiegel Dec 12, 2024
7b10d05
refactor json printing and fix race condition in file reading
jkrumbiegel Dec 12, 2024
8c5c6ad
add kill command and print julia version
jkrumbiegel Dec 12, 2024
b52c902
print env and runner version
jkrumbiegel Dec 12, 2024
903f02a
check readiness of server connection for status
jkrumbiegel Dec 12, 2024
dc355f9
use info instead of console.log
jkrumbiegel Dec 12, 2024
e1d9b3c
reorder log statement
jkrumbiegel Dec 12, 2024
ede0ede
fix transportFile for case where QNR is used from project
jkrumbiegel Dec 12, 2024
10106be
refactor server commands
jkrumbiegel Dec 13, 2024
a20aaba
add workers command and per-worker status info
jkrumbiegel Dec 13, 2024
3d0a469
redirect julia server output to logfile
jkrumbiegel Jan 6, 2025
f264765
add log to file logic to server process and log command
jkrumbiegel Jan 6, 2025
0e12d26
print seconds since started worker
jkrumbiegel Jan 6, 2025
1d2d7a1
don't print BEGIN END markers for `log` command itself
jkrumbiegel Jan 6, 2025
99fb153
Merge branch 'main' into jk/engine-commands
jkrumbiegel Jan 6, 2025
ed9068f
add logfile arg to windows branch
jkrumbiegel Jan 6, 2025
30be04f
Merge branch 'main' into jk/engine-commands
jkrumbiegel Jan 29, 2025
e6efc6f
Merge branch 'main' into jk/engine-commands
jkrumbiegel Mar 7, 2025
f4dde36
switch to `quarto call engine julia ...` pattern
jkrumbiegel Mar 7, 2025
361ed02
simplify status command by letting QNR do all the work
jkrumbiegel Mar 7, 2025
84d8de0
add first basic call julia engine tests
jkrumbiegel Mar 10, 2025
6a1fd91
try different dir for qnr
jkrumbiegel Mar 10, 2025
aa9a5e4
has to be under workspace it seems
jkrumbiegel Mar 10, 2025
41a7bed
use update instead of instantiate
jkrumbiegel Mar 10, 2025
fb3834a
fix env interpolation
jkrumbiegel Mar 10, 2025
da15709
debug windows issue
jkrumbiegel Mar 10, 2025
77ada8f
use bash to set env var on windows also
jkrumbiegel Mar 10, 2025
f79eb4c
one more bash shell
jkrumbiegel Mar 10, 2025
d6edb64
assert success with debug info in failure case
jkrumbiegel Mar 11, 2025
a712663
add second logfile test and factor out stderr/stdout asserts
jkrumbiegel Mar 11, 2025
b9abf6b
type `writeJuliaCommand` better
jkrumbiegel Mar 11, 2025
545f763
add close command to close a worker
jkrumbiegel Mar 11, 2025
c29036a
add test for closing running worker
jkrumbiegel Mar 11, 2025
d350699
add command to stop (not kill) the server
jkrumbiegel Mar 11, 2025
f6acba3
period
jkrumbiegel Mar 11, 2025
4fcbd85
add log message when server shuts down
jkrumbiegel Mar 11, 2025
49c3653
use `--force` option for `close` instead of separate command
jkrumbiegel Mar 12, 2025
d109025
add test for force-closing a worker
jkrumbiegel Mar 12, 2025
f4eaf50
Merge branch 'main' into jk/engine-commands
jkrumbiegel Mar 12, 2025
1bbb65a
Merge branch 'main' into jk/engine-commands
jkrumbiegel Mar 14, 2025
431f2ab
remove stale comments
jkrumbiegel Mar 14, 2025
9e94e8d
throw only one error and don't triple-print ERROR
jkrumbiegel Mar 14, 2025
0e27d3d
remove status info code that is now printed by server on julia side
jkrumbiegel Mar 14, 2025
650e89d
move julia cache step forward
jkrumbiegel Mar 14, 2025
dc6da59
add changelog entries
jkrumbiegel Mar 14, 2025
e77dc76
switch to qnr 0.15 and remove custom branch from CI workflow
jkrumbiegel Mar 14, 2025
41526a7
add description for `call`
jkrumbiegel Mar 14, 2025
983c60b
slightly reword julia command help strings
jkrumbiegel Mar 14, 2025
39ae1c4
Merge branch 'main' into jk/engine-commands
jkrumbiegel Mar 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/changelog-1.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ All changes included in 1.7:

- ([#12121](https://github.com/quarto-dev/quarto-cli/pull/12121)): Update QuartoNotebookRunner to 0.14.0. Support for evaluating Python cells via [PythonCall.jl](https://github.com/JuliaPy/PythonCall.jl) added. Support for notebook caching via `execute.cache` added.
- ([#12151](https://github.com/quarto-dev/quarto-cli/pull/12151)): Basic YAML validation is now active for document using Julia engine.
- ([#11803](https://github.com/quarto-dev/quarto-cli/pull/11803)): Added subcommands `status`, `kill`, `close [--force]` and `log` under the new CLI command `quarto call engine julia`.

### `jupyter`

Expand All @@ -105,3 +106,4 @@ All changes included in 1.7:
- ([#11951](https://github.com/quarto-dev/quarto-cli/issues/11951)): Raw LaTeX table without `tbl-` prefix label for using Quarto crossref are now correctly passed through unmodified.
- ([#12117](https://github.com/quarto-dev/quarto-cli/issues/12117)): Color output to stdout and stderr is now correctly rendered for `html` format in the Jupyter and Julia engines.
- ([#12264](https://github.com/quarto-dev/quarto-cli/issues/12264)): Upgrade `dart-sass` to 1.85.1.
- ([#11803](https://github.com/quarto-dev/quarto-cli/pull/11803)): Added a new CLI command `quarto call`. First users of this interface are the new `quarto call engine julia ...` subcommands.
10 changes: 10 additions & 0 deletions src/command/call/cmd.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Command } from "cliffy/command/mod.ts";
import { engineCommand } from "../../execute/engine.ts";

export const callCommand = new Command()
.name("call")
.description("Access functions of Quarto subsystems such as its rendering engines.")
.action(() => {
callCommand.showHelp();
Deno.exit(1);
}).command("engine", engineCommand);
2 changes: 2 additions & 0 deletions src/command/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { addCommand } from "./add/cmd.ts";
import { uninstallCommand } from "./uninstall/cmd.ts";
import { createCommand } from "./create/cmd.ts";
import { editorSupportCommand } from "./editor-support/cmd.ts";
import { callCommand } from "./call/cmd.ts";

// deno-lint-ignore no-explicit-any
export function commands(): Command<any>[] {
Expand Down Expand Up @@ -57,5 +58,6 @@ export function commands(): Command<any>[] {
checkCommand,
buildJsCommand,
editorSupportCommand,
callCommand,
];
}
28 changes: 28 additions & 0 deletions src/execute/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { pandocBuiltInFormats } from "../core/pandoc/pandoc-formats.ts";
import { gitignoreEntries } from "../project/project-gitignore.ts";
import { juliaEngine } from "./julia.ts";
import { ensureFileInformationCache } from "../project/project-shared.ts";
import { Command } from "cliffy/command/mod.ts";

const kEngines: Map<string, ExecutionEngine> = new Map();

Expand Down Expand Up @@ -276,3 +277,30 @@ export function projectIgnoreGlobs(dir: string) {
gitignoreEntries(dir).map((ignore) => `**/${ignore}**`),
);
}

export const engineCommand = new Command()
.name("engine")
.description(
`Access functionality specific to quarto's different rendering engines.`,
)
.action(() => {
engineCommand.showHelp();
Deno.exit(1);
});

kEngines.forEach((engine, name) => {
if (engine.populateCommand) {
const engineSubcommand = new Command();
// fill in some default behavior for each engine command
engineSubcommand
.description(
`Access functionality specific to the ${name} rendering engine.`,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like this. I think that we should let engines have a method to build a response, but that can happen in a different PR.

.action(() => {
engineSubcommand.showHelp();
Deno.exit(1);
});
engine.populateCommand(engineSubcommand);
engineCommand.command(name, engineSubcommand);
}
});
Loading
Loading