Install Quarto from the Posit Open apt repo via quarto.install()#479
Install Quarto from the Posit Open apt repo via quarto.install()#479bschwedler merged 1 commit intomainfrom
Conversation
ianpittwood
left a comment
There was a problem hiding this comment.
Just a couple small changes, otherwise looks good so far
2ab4e11 to
83e1a2a
Compare
83e1a2a to
69cd79f
Compare
Switch `workbench-session` to install Quarto via `apt-get install
quarto={version}` from the Posit Open apt repository, using the updated
`quarto.install()` macro from `posit-dev/images-shared`.
Why:
- Avoids `${TARGETARCH}` URL construction. Posit publishes `quarto` as
a multi-arch deb (amd64 + arm64) on both `jammy` and `noble`.
- dpkg owns the install, so goss `package.quarto.versions` assertions
work directly without path-based proxies.
- No tarball extraction.
The `quarto` deb installs to a flat `/opt/quarto/` directory (the
binary at `/opt/quarto/bin/quarto`) and symlinks `/usr/local/bin/quarto`
via its postinst script. Consequences in this repo:
- Drop the redundant `quarto.symlink_binary(...)` call in
`workbench-session/template/Containerfile.ubuntu*.jinja2` — the
deb's postinst already creates the `/usr/local/bin/quarto` symlink.
- Install `xz-utils` explicitly in the TinyTeX RUN; it is needed to
unpack the TinyTeX `.tar.xz` archive and was previously pulled in
transitively by the tarball install.
- Update goss path check from `/opt/quarto/{version}` to the
`/opt/quarto/bin/quarto` binary and add a `package.quarto.versions`
check (now possible because the install is dpkg-tracked).
The `workbench` image (as distinct from `workbench-session`) bundles
Quarto with `rstudio-server` and uses
`quarto.install_tinytex_command(...)` against that bundled binary. That
flow is unchanged.
Requires `posit-dev/images-shared#479`.
Switch `workbench-session` to install Quarto via `apt-get install
quarto={version}` from the Posit Open apt repository, using the updated
`quarto.install()` macro from `posit-dev/images-shared`.
Why:
- Avoids `${TARGETARCH}` URL construction. Posit publishes `quarto` as
a multi-arch deb (amd64 + arm64) on both `jammy` and `noble`.
- dpkg owns the install, so goss `package.quarto.versions` assertions
work directly without path-based proxies.
- No tarball extraction.
The `quarto` deb installs to a flat `/opt/quarto/` directory (the
binary at `/opt/quarto/bin/quarto`) and symlinks `/usr/local/bin/quarto`
via its postinst script. Consequences in this repo:
- Drop the redundant `quarto.symlink_binary(...)` call in
`workbench-session/template/Containerfile.ubuntu*.jinja2` — the
deb's postinst already creates the `/usr/local/bin/quarto` symlink.
- Install `xz-utils` explicitly in the TinyTeX RUN; it is needed to
unpack the TinyTeX `.tar.xz` archive and was previously pulled in
transitively by the tarball install.
- Update goss path check from `/opt/quarto/{version}` to the
`/opt/quarto/bin/quarto` binary and add a `package.quarto.versions`
check (now possible because the install is dpkg-tracked).
The `workbench` image (as distinct from `workbench-session`) bundles
Quarto with `rstudio-server` and uses
`quarto.install_tinytex_command(...)` against that bundled binary. That
flow is unchanged.
Requires `posit-dev/images-shared#479`.
d6f597b to
97f7b4b
Compare
97f7b4b to
9b7003b
Compare
There was a problem hiding this comment.
Pull request overview
Migrates Quarto installation from GitHub tarballs to the Posit Open package repositories, unifies apt/dnf repo setup macros, and enforces a single-version constraint for Quarto dependencies to match the flat /opt/quarto install layout.
Changes:
- Replace Quarto tarball installs with
apt-get install quarto=...(anddnf install ...) from Posit Open, with version pinning/locking. - Unify Posit repo setup macros for both apt and dnf (
setup_posit_repo("pro"|"open")) and addpro_repo/open_repotoggles tosetup()/run_setup(). - Enforce “single Quarto version only” at config-parse time and update tests/resources/docs accordingly.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| posit-bakery/posit_bakery/config/templating/macros/quarto.j2 | Switch Quarto install to Posit Open repo; add single-version guard; adjust directory/symlink helpers. |
| posit-bakery/posit_bakery/config/templating/macros/apt.j2 | Unify repo setup into setup_posit_repo and add repo toggles to setup() / run_setup(). |
| posit-bakery/posit_bakery/config/templating/macros/dnf.j2 | Same unification/toggles as apt for rpm-based images. |
| posit-bakery/posit_bakery/config/dependencies/quarto.py | Add Pydantic validator rejecting multiple Quarto versions. |
| posit-bakery/docs/templating.qmd | Update docs for new repo macros and Quarto install behavior. |
| posit-bakery/test/config/templating/test_macros.py | Update/add macro rendering tests for new repo helpers and Quarto install behavior. |
| posit-bakery/test/config/test_config.py | Update expected rendered Containerfile content for new Quarto install commands. |
| posit-bakery/test/config/image/test_matrix.py | Adjust Quarto versions list to single-version expectation. |
| posit-bakery/test/config/dependencies/test_dependency.py | Add tests for Quarto single-version constraint. |
| posit-bakery/test/cli/test_common.py | Update CLI parsing test to reject multiple Quarto versions. |
| posit-bakery/test/resources/** | Update snapshots (Containerfiles/goss/bakery.yaml) for new Quarto install layout and version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| dnf install -yq \ | ||
| quarto-{{ version | trim }}{% if with_tinytex %} \ | ||
| xz{% endif %} && \ | ||
| dnf versionlock add quarto && \ |
There was a problem hiding this comment.
In the RHEL branch this uses dnf versionlock add quarto, but the versionlock subcommand typically comes from an optional plugin package (e.g., dnf-plugins-core / the versionlock plugin) and isn’t installed by dnf.setup() or this macro. As written, Quarto installs on RHEL are likely to fail at build time on minimal bases. Consider installing the required plugin before invoking dnf versionlock, or dropping the versionlock step and relying on installing the requested version explicitly.
| dnf versionlock add quarto && \ |
| :param codename: Override the OS codename used by the setup script. Useful when | ||
| Posit packages are not yet published for the current OS (e.g., using noble packages on | ||
| resolute). When set, the codename is passed as an environment variable to the script | ||
| per the Cloudsmith docs. |
There was a problem hiding this comment.
The codename parameter docs still reference “Cloudsmith docs/setup script”, but this macro is now the generic Posit repo setup helper (dl.posit.co/public/{pro,open}/setup.deb.sh). Please update the wording so it doesn’t imply Cloudsmith-specific behavior/requirements (and matches the new macro naming).
| :param codename: Override the OS codename used by the setup script. Useful when | |
| Posit packages are not yet published for the current OS (e.g., using noble packages on | |
| resolute). When set, the codename is passed as an environment variable to the script | |
| per the Cloudsmith docs. | |
| :param codename: Override the OS codename used by the Posit repository setup helper. | |
| Useful when Posit packages are not yet published for the current OS (e.g., using | |
| noble packages on resolute). When set, the codename is passed to the setup helper | |
| script as an environment variable. |
9b7003b to
9f56f2f
Compare
| {%- endmacro %} | ||
|
|
||
| {# Backward-compatible alias for get_directory(). #} | ||
| {% macro get_version_directory(version = None) -%} |
There was a problem hiding this comment.
I think we should add a deprecation warning here, but it may require something custom as I am unsure Jinja supports warnings in addition to errors.
Migrate Quarto installation from GitHub tarball downloads to the
Posit Open apt repository, unify apt/dnf repo setup macros, and
enforce a single-version contract for Quarto dependencies.
- Replace setup_posit_cloudsmith() and setup_posit_open() with a
single setup_posit_repo(repo) macro that takes "pro" or "open",
with allowlist validation. Same change in both apt.j2 and dnf.j2.
- Add pro_repo and open_repo boolean params to setup()/run_setup()
so a single call can configure one or both Posit repositories.
- Rewrite quarto.install() to use apt-get install quarto={version}
from the Open repo. Run apt-mark hold quarto to prevent upgrades.
- Rename get_version_directory() to get_directory() with a backward-
compatible alias, since the flat /opt/quarto/ path is no longer
version-scoped.
- Add validate_single_version field validator on
QuartoDependencyVersions that rejects multiple Quarto versions
at config parse time.
9f56f2f to
b7d0367
Compare
Switch Connect and Connect Content to install Quarto via `apt-get
install quarto={version}` from the Posit Open apt repository, using the
updated `quarto.install()` macro from `posit-dev/images-shared`.
Why:
- Avoids `${TARGETARCH}` URL construction. Posit publishes `quarto` as
a multi-arch deb (amd64 + arm64) on both `jammy` and `noble`.
- dpkg owns the install, so goss `package.quarto.versions` assertions
work directly without path-based proxies.
- No tarball extraction.
The `quarto` deb installs to a flat `/opt/quarto/` directory (the
binary at `/opt/quarto/bin/quarto`) and symlinks `/usr/local/bin/quarto`
via its postinst script. Consequences in this repo:
- Flatten the vestigial `{% for quarto_version in Dependencies.quarto %}`
loops in `connect/template/Containerfile.ubuntu*.jinja2`,
`scripts/install_connect.sh.jinja2`, and `test/goss.yaml.jinja2`.
Every Connect image has always shipped exactly one Quarto, so the
loop is unused in practice. (Apt also does not support installing
multiple versions into the same prefix.)
- Drop the redundant `quarto.symlink_binary(...)` call in
connect-content templates — the deb's postinst already creates the
`/usr/local/bin/quarto` symlink.
- Install `xz-utils` explicitly in the TinyTeX RUN; it is needed to
unpack the TinyTeX `.tar.xz` archive and was previously pulled in
transitively by the tarball install.
- Update path references in `install_connect.sh.jinja2` and the goss
templates from `/opt/quarto/{version}/bin/quarto` to
`/opt/quarto/bin/quarto`. Add a `package.quarto.versions` check in
`connect-content` goss (now possible because the install is dpkg-
tracked).
Only the quarto install blocks and their direct consumers (goss path
checks, `install_connect.sh` Rscript runner config) are touched in the
rendered Containerfiles. Rerendering would also pick up unrelated
drift; those drift hunks are intentionally out of scope for this PR.
Requires `posit-dev/images-shared#479`.
Switch `workbench-session` to install Quarto via `apt-get install
quarto={version}` from the Posit Open apt repository, using the updated
`quarto.install()` macro from `posit-dev/images-shared`.
Why:
- Avoids `${TARGETARCH}` URL construction. Posit publishes `quarto` as
a multi-arch deb (amd64 + arm64) on both `jammy` and `noble`.
- dpkg owns the install, so goss `package.quarto.versions` assertions
work directly without path-based proxies.
- No tarball extraction.
The `quarto` deb installs to a flat `/opt/quarto/` directory (the
binary at `/opt/quarto/bin/quarto`) and symlinks `/usr/local/bin/quarto`
via its postinst script. Consequences in this repo:
- Drop the redundant `quarto.symlink_binary(...)` call in
`workbench-session/template/Containerfile.ubuntu*.jinja2` — the
deb's postinst already creates the `/usr/local/bin/quarto` symlink.
- Install `xz-utils` explicitly in the TinyTeX RUN; it is needed to
unpack the TinyTeX `.tar.xz` archive and was previously pulled in
transitively by the tarball install.
- Update goss path check from `/opt/quarto/{version}` to the
`/opt/quarto/bin/quarto` binary and add a `package.quarto.versions`
check (now possible because the install is dpkg-tracked).
The `workbench` image (as distinct from `workbench-session`) bundles
Quarto with `rstudio-server` and uses
`quarto.install_tinytex_command(...)` against that bundled binary. That
flow is unchanged.
Requires `posit-dev/images-shared#479`.
Summary
Migrate Quarto installation from GitHub tarball to the Posit Open apt repository, unify apt/dnf repo setup macros, and enforce a single-version contract for Quarto dependencies.
Why
quartodeb is published as a multi-arch package (amd64 + arm64) on bothjammyandnoble, eliminating the${TARGETARCH}URL-construction logic that caused 404s inimages-examples#18.apt-get remove quartois a clean undo and gosspackage.quarto.versionsassertions work directly.xz-utilsis only installed whenwith_tinytex=True(to unpack the TinyTeX.tar.xz).Changes
apt.j2anddnf.j2— unified repo setupsetup_posit_cloudsmith()andsetup_posit_open()with a singlesetup_posit_repo(repo)macro that takes"pro"or"open". Same change in both apt and dnf.pro_repoandopen_repoboolean params tosetup()/run_setup()so a single call can configure one or both Posit repositories. Defaults (pro_repo=True,open_repo=False) maintain backward compatibility.quarto.j2install()to useapt-get install quarto={version}from the Open repo instead of downloading a tarball from GitHub. Runsapt-mark hold quartoto prevent unintended upgrades.get_version_directory()toget_directory()since the version param is no longer meaningful. The old name is retained as a backward-compatible alias.symlink_version()/symlink_binary()resolve against flat/opt/quarto/. The deb's postinst already symlinks/usr/local/bin/quarto, so explicitsymlink_binarycalls forquartoare typically unnecessary.Config validation
validate_single_versionfield validator onQuartoDependencyVersionsthat rejects multiple Quarto versions at config parse time. The apt package installs to a flat/opt/quarto/directory with no version scoping, so multi-version coexistence is not possible.Companion PRs
Test plan
pytest test/config/andpytest test/cli/— 533 tests passtest/resources/updateddocs/templating.qmdupdated