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

feat: Adds support for Quarto Shiny files #77

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

andyquinterom
Copy link
Member

Closes #76

Example on how to use with router is here: https://github.com/ixpantia/faucet-router-example

CLI example:

~/p/e/qmd (main|✔) [2]$ faucet start --type quarto-shiny
[2024-07-04T04:36:08Z INFO  faucet] Building the faucet server...
[2024-07-04T04:36:08Z INFO  faucet] Using load balancing strategy: Some(RoundRobin)
[2024-07-04T04:36:08Z INFO  faucet] Will spawn 16 workers
[2024-07-04T04:36:08Z INFO  faucet] Using worker type: QuartoShiny
[2024-07-04T04:36:08Z INFO  faucet] Using IP extractor: ClientAddr
[2024-07-04T04:36:08Z INFO  faucet] Will bind to: 127.0.0.1:3838
[2024-07-04T04:36:08Z INFO  faucet] Using workdir: "."
[2024-07-04T04:36:08Z INFO  faucet] Using Rscript command: "Rscript"
[2024-07-04T04:36:08Z INFO  faucet] Using quarto command: "quarto"
[2024-07-04T04:36:08Z INFO  faucet] Round robin load balancing strategy specified for shiny, switching to IP hash.
[2024-07-04T04:36:08Z ERROR faucet] Failed to invoke R for Worker::1: Missing argument: qmd
[2024-07-04T04:36:08Z ERROR faucet] Exiting...
[2024-07-04T04:36:08Z ERROR faucet] Failed to invoke R for Worker::3: Missing argument: qmd
[2024-07-04T04:36:08Z ERROR faucet] Exiting...
[2024-07-04T04:36:08Z ERROR faucet] Failed to invoke R for Worker::2: Missing argument: qmd
~/p/e/qmd (main|✔) [1]$

If we don't specify the qmd argument then we get a very clear error message.

Once we include the path in the qmd argument it works!

~/p/e/qmd (main|✔) $ faucet start --type quarto-shiny --qmd old_faithful.qmd -w 1
[2024-07-04T04:37:21Z INFO  faucet] Building the faucet server...
[2024-07-04T04:37:21Z INFO  faucet] Using load balancing strategy: Some(RoundRobin)
[2024-07-04T04:37:21Z INFO  faucet] Will spawn 1 workers
[2024-07-04T04:37:21Z INFO  faucet] Using worker type: QuartoShiny
[2024-07-04T04:37:21Z INFO  faucet] Using IP extractor: ClientAddr
[2024-07-04T04:37:21Z INFO  faucet] Will bind to: 127.0.0.1:3838
[2024-07-04T04:37:21Z INFO  faucet] Using workdir: "."
[2024-07-04T04:37:21Z INFO  faucet] Using Rscript command: "Rscript"
[2024-07-04T04:37:21Z INFO  faucet] Using quarto command: "quarto"
[2024-07-04T04:37:21Z INFO  faucet] Round robin load balancing strategy specified for shiny, switching to IP hash.
[2024-07-04T04:37:21Z INFO  faucet] Listening on http://127.0.0.1:3838
[2024-07-04T04:37:21Z INFO  faucet] Starting process 1529415 for Worker::1 on port 44641
[2024-07-04T04:37:22Z WARN  Worker::1] Loading required namespace: shiny
[2024-07-04T04:37:22Z WARN  Worker::1]
[2024-07-04T04:37:22Z WARN  Worker::1]
[2024-07-04T04:37:22Z WARN  Worker::1] processing file: old_faithful.qmd
[2024-07-04T04:37:22Z WARN  Worker::1] 1/5
[2024-07-04T04:37:22Z WARN  Worker::1] 2/5 [unnamed-chunk-1]
[2024-07-04T04:37:22Z WARN  Worker::1] 3/5
[2024-07-04T04:37:22Z WARN  Worker::1] 4/5 [unnamed-chunk-2]
[2024-07-04T04:37:22Z WARN  Worker::1] 5/5
[2024-07-04T04:37:22Z WARN  Worker::1] output file: old_faithful.knit.md
[2024-07-04T04:37:22Z WARN  Worker::1]
[2024-07-04T04:37:22Z WARN  Worker::1] pandoc
[2024-07-04T04:37:22Z WARN  Worker::1]   to: html
[2024-07-04T04:37:22Z WARN  Worker::1]   output-file: old_faithful.html
[2024-07-04T04:37:22Z WARN  Worker::1]   standalone: true
[2024-07-04T04:37:22Z WARN  Worker::1]   section-divs: true
[2024-07-04T04:37:22Z WARN  Worker::1]   html-math-method: mathjax
[2024-07-04T04:37:22Z WARN  Worker::1]   wrap: none
[2024-07-04T04:37:22Z WARN  Worker::1]   default-image-extension: png
[2024-07-04T04:37:22Z WARN  Worker::1]
[2024-07-04T04:37:22Z WARN  Worker::1] metadata
[2024-07-04T04:37:22Z WARN  Worker::1]   document-css: false
[2024-07-04T04:37:22Z WARN  Worker::1]   link-citations: true
[2024-07-04T04:37:22Z WARN  Worker::1]   date-format: long
[2024-07-04T04:37:22Z WARN  Worker::1]   lang: en
[2024-07-04T04:37:22Z WARN  Worker::1]   title: Old Faithful
[2024-07-04T04:37:22Z WARN  Worker::1]   server:
[2024-07-04T04:37:22Z WARN  Worker::1]     type: shiny
[2024-07-04T04:37:22Z WARN  Worker::1]
[2024-07-04T04:37:23Z WARN  Worker::1] Loading required package: shiny
[2024-07-04T04:37:23Z WARN  Worker::1] Browse at http://localhost:44641/
[2024-07-04T04:37:23Z WARN  Worker::1]
[2024-07-04T04:37:23Z WARN  Worker::1]
[2024-07-04T04:37:23Z INFO  faucet] Worker::1 is online and ready to serve connections

@andyquinterom andyquinterom merged commit cf108d8 into ixpantia:main Jul 4, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for quarto markdown documents and shiny documents
2 participants