One image for building the site and previewing components #65

Open
opened 2026-10-22 15:07:01 +00:00 by hricky · 7 comments
Owner

Problem

Contributors preview a component with docsbuilder.sh. It runs registry.gitlab.com/fedora/docs/docs-website/docs-fp-o:latest, which nothing has rebuilt since September 2025. It builds the component with a reduced site.yml from the component repository, without the site's extensions, so the preview differs from the real site. It also cannot check links into other components, and this gets more important with docs/tickets#66. The site itself is built by build-scripts/rebuild-site.py in a different image.

Proposal

Use the builder image from site-builder (build-scripts/) for everything, that is the site build in OpenShift and CI, and local previews. Publish it as quay.io/fedora-docs/builder, signed, and rebuild it every week (we can change the build schedule later). Add a preview command to rebuild-site.py with two modes.

  • Fast mode (default) builds only your component, but with the real site design and extensions. It takes about 3 seconds for Quick Docs.
  • Full mode (--full) builds your component inside the whole site, so links into other components are checked. It takes about 20 to 35 seconds once the sources are cached. The first run takes several minutes.

The preview would be started like this in the component repository:

podman container run --rm --interactive --tty --pull=newer \
    --security-opt label=type:unconfined_t \
    --volume "${PWD}:/component:ro" \
    --volume fedora-docs-cache:/antora/cache \
    --publish 127.0.0.1:8080:8080 \
    quay.io/fedora-docs/builder preview

It writes nothing into the repository and needs only Podman.

Measurements

A full English build takes about 14 minutes today. Antora itself needs 35 seconds of that, and the rest is downloading the sources. Downloading council/docs alone took 9.5 minutes, because of a 243 MB PDF.

Note

All times were measured on one machine with 16 CPU cores. They will be different on other machines. The download times also depend on the internet connection, the location, and how fast the forge answers at that moment. The times in the "Proposal" and "Measurements" sections above come from the same machine.

Plan

Small pull requests in site-builder, each checked so that the site output stays the same:

  1. Make two builds comparable (fixed footer date).
  2. Split rebuild-site.py into functions.
  3. Update the image to Fedora 45 and pin exact package versions (another option would be to always install the newest Antora version when the image is built).
  4. Add a source cache, the fast mode, publishing of the image, a web server (Apache httpd, as in production) and the full mode.

Previews for pull requests can come later. docsbuilder.sh and docs-template stay unchanged for now.

Questions for the team

  • Is it fine to require Podman for local previews (on macOS and Windows with podman machine)?
  • How important is AArch64 support, for example for Apple Silicon or AArch64 laptops? The image is built only for x86_64 for now, so AArch64 machines would need emulation to run it. I am exploring the options for an AArch64 self-hosted runner, so that we can build the image for both architectures.
  • After trying the command, should docsbuilder.sh become a small wrapper around it, or should it be retired?
  • The root package.json and package-lock.json were added in docs/docs-fp-o!25 to build the site with npm without containers. Should we keep, update or remove them?
  • docs/tickets#2 asks for technical improvements of the local authoring system, for example AArch64 support and one container for building and serving the preview.
  • docs/tickets#19 reports that docsbuilder.sh pulls outdated images.
  • docs/tickets#49 asks for a shared CI that checks a change in one component by building the whole site.
  • docs/tickets#66 is about module inclusion, where a preview of one repository alone is not enough.
  • docs/docs-fp-o#10 reports that build.sh fails locally.
  • docs/docs-fp-o#23 is about the two SHA-256 repositories, which Antora cannot fetch itself.
  • docs/docs-fp-o#61 proposed building the site in CI.
  • docs/docs-template#7 asks for a test of docsbuilder.sh on macOS.

Assisted-by: Coding Agents and LLMs

### Problem Contributors preview a component with `docsbuilder.sh`. It runs `registry.gitlab.com/fedora/docs/docs-website/docs-fp-o:latest`, which nothing has rebuilt since September 2025. It builds the component with a reduced `site.yml` from the component repository, without the site's extensions, so the preview differs from the real site. It also cannot check links into other components, and this gets more important with docs/tickets#66. The site itself is built by `build-scripts/rebuild-site.py` in a different image. ### Proposal Use the builder image from [site-builder](https://forge.stg.fedoraproject.org/docs/site-builder) (`build-scripts/`) for everything, that is the site build in OpenShift and CI, and local previews. Publish it as `quay.io/fedora-docs/builder`, signed, and rebuild it every week (we can change the build schedule later). Add a `preview` command to `rebuild-site.py` with two modes. - Fast mode (default) builds only your component, but with the real site design and extensions. It takes about 3 seconds for Quick Docs. - Full mode (`--full`) builds your component inside the whole site, so links into other components are checked. It takes about 20 to 35 seconds once the sources are cached. The first run takes several minutes. The preview would be started like this in the component repository: ``` podman container run --rm --interactive --tty --pull=newer \ --security-opt label=type:unconfined_t \ --volume "${PWD}:/component:ro" \ --volume fedora-docs-cache:/antora/cache \ --publish 127.0.0.1:8080:8080 \ quay.io/fedora-docs/builder preview ``` It writes nothing into the repository and needs only Podman. ### Measurements A full English build takes about 14 minutes today. Antora itself needs 35 seconds of that, and the rest is downloading the sources. Downloading `council/docs` alone took 9.5 minutes, because of a 243 MB PDF. > [!NOTE] > All times were measured on one machine with 16 CPU cores. They will be different on other machines. The download times also depend on the internet connection, the location, and how fast the forge answers at that moment. The times in the "Proposal" and "Measurements" sections above come from the same machine. ### Plan Small pull requests in site-builder, each checked so that the site output stays the same: 1. Make two builds comparable (fixed footer date). 2. Split `rebuild-site.py` into functions. 3. Update the image to Fedora 45 and pin exact package versions (another option would be to always install the newest Antora version when the image is built). 4. Add a source cache, the fast mode, publishing of the image, a web server (Apache httpd, as in production) and the full mode. Previews for pull requests can come later. `docsbuilder.sh` and docs-template stay unchanged for now. ### Questions for the team - Is it fine to require Podman for local previews (on macOS and Windows with `podman machine`)? - How important is AArch64 support, for example for Apple Silicon or AArch64 laptops? The image is built only for x86_64 for now, so AArch64 machines would need emulation to run it. I am exploring the options for an AArch64 self-hosted runner, so that we can build the image for both architectures. - After trying the command, should `docsbuilder.sh` become a small wrapper around it, or should it be retired? - The root `package.json` and `package-lock.json` were added in docs/docs-fp-o!25 to build the site with npm without containers. Should we keep, update or remove them? ### Related issues - docs/tickets#2 asks for technical improvements of the local authoring system, for example AArch64 support and one container for building and serving the preview. - docs/tickets#19 reports that `docsbuilder.sh` pulls outdated images. - docs/tickets#49 asks for a shared CI that checks a change in one component by building the whole site. - docs/tickets#66 is about module inclusion, where a preview of one repository alone is not enough. - docs/docs-fp-o#10 reports that `build.sh` fails locally. - docs/docs-fp-o#23 is about the two SHA-256 repositories, which Antora cannot fetch itself. - docs/docs-fp-o#61 proposed building the site in CI. - docs/docs-template#7 asks for a test of `docsbuilder.sh` on macOS. <sub>_Assisted-by: Coding Agents and LLMs_</sub>
hricky self-assigned this 2026-10-22 15:07:01 +00:00
Member

Hey Hristo!

I like your idea very much. Here are my comments to your questions to the team:

  • It's fine to require podman.
  • I'd definitely include aarch64 support. I work with aarch64 regularly and most standard images work just fine on the platform. Running natively on aarch64 is a good thing.
  • For the sake of "backwards compatibility" docsbuilder.sh being a wrapper is a good idea. It'll also flatten the learning curve for existing docs contributers.
  • npm sucks. Ditch it. ;)
Hey Hristo! I like your idea very much. Here are my comments to your questions to the team: - It's fine to require podman. - I'd definitely include aarch64 support. I work with aarch64 regularly and most standard images work just fine on the platform. Running natively on aarch64 is a good thing. - For the sake of "backwards compatibility" docsbuilder.sh being a wrapper is a good idea. It'll also flatten the learning curve for existing docs contributers. - npm sucks. Ditch it. ;)
Member

Tested https://forge.stg.fedoraproject.org/docs/site-builder/src/branch/main/preview-container on macOS on an Apple silicon machine with the following findings:

  • Need to install podman from https://podman.io/
  • Since pre-built images are built for amd64 platform podman will use Rosetta2 on M2 to run amd64. Preferably, arm64 images should be provided because Rosetta2 will probably disappear at some point.
  • The manual building process does not work (this might be an issue that's not specific to arm64 / aarch64).
  • preview-container/check-site.sh needs to be adjusted to be able to run on macOS (it assumes GNU sed for example).
Tested https://forge.stg.fedoraproject.org/docs/site-builder/src/branch/main/preview-container on macOS on an Apple silicon machine with the following findings: - Need to install podman from https://podman.io/ - Since pre-built images are built for amd64 platform podman will use Rosetta2 on M2 to run amd64. Preferably, arm64 images should be provided because Rosetta2 will probably disappear at some point. - The manual building process does not work (this might be an issue that's not specific to arm64 / aarch64). - `preview-container/check-site.sh` needs to be adjusted to be able to run on macOS (it assumes GNU sed for example).
Owner

If we could set up the staging site to always use the latest version of Antora, and pin the production site to a specific version of Antora, that might be a useful way for us to catch early any upstream breaking changes introduced in Antora.

@hricky wrote in docs/docs-fp-o#65 (comment):

Questions for the team

* Is it fine to require Podman for local previews (on macOS and Windows with `podman machine`)?

Yes, I think we should standardize on an open source, multi-platform tool. It seems sensible to me.

* How important is AArch64 support, for example for Apple Silicon or AArch64 laptops? The image is built only for x86_64 for now, so AArch64 machines would need emulation to run it. I am exploring the options for an AArch64 self-hosted runner, so that we can build the image for both architectures.

I think this only matters for local builds. As we know, at least a few people in the team work from Apple hardware, so it is reasonable that we need to find a way to make sure those folks can build and test docs sites locally. However, for the production deployment, I don't think it matters.

* After trying the command, should `docsbuilder.sh` become a small wrapper around it, or should it be retired?

I think it is worthwhile to preserve a workflow where someone can quickly test their component locally. Whether it is with a script or something else, this is besides the point. I don't think we want to force someone to build the entire site if they don't want to.

* The root `package.json` and `package-lock.json` were added in docs/docs-fp-o!25 to build the site with npm without containers. Should we keep, update or remove them?

I am not sure if I understand the technical ramifications of building the site with or without npm. If we are using it, then we should probably be updating lockfiles and dependencies too.

If we could set up the staging site to always use the latest version of Antora, and pin the production site to a specific version of Antora, that might be a useful way for us to catch early any upstream breaking changes introduced in Antora. @hricky wrote in https://forge.fedoraproject.org/docs/docs-fp-o/issues/65#issue-341023: > ### [](#questions-for-the-team)Questions for the team > > * Is it fine to require Podman for local previews (on macOS and Windows with `podman machine`)? Yes, I think we should standardize on an open source, multi-platform tool. It seems sensible to me. > * How important is AArch64 support, for example for Apple Silicon or AArch64 laptops? The image is built only for x86_64 for now, so AArch64 machines would need emulation to run it. I am exploring the options for an AArch64 self-hosted runner, so that we can build the image for both architectures. I think this only matters for local builds. As we know, at least a few people in the team work from Apple hardware, so it is reasonable that we need to find a way to make sure those folks can build and test docs sites locally. However, for the production deployment, I don't think it matters. > * After trying the command, should `docsbuilder.sh` become a small wrapper around it, or should it be retired? I think it is worthwhile to preserve a workflow where someone can quickly test their component locally. Whether it is with a script or something else, this is besides the point. I don't think we want to force someone to build the entire site if they don't want to. > * The root `package.json` and `package-lock.json` were added in docs/docs-fp-o!25 to build the site with npm without containers. Should we keep, update or remove them? I am not sure if I understand the technical ramifications of building the site with or without `npm`. If we are using it, then we should probably be updating lockfiles and dependencies too.
Author
Owner

Newest Antora for staging. I like the idea, and it needs no change in infra/ansible. OpenShift builds the staging image from build-scripts/Dockerfile in site-builder on forge.stg, and the production image from the prod branch of docs-fp-o. So the two Dockerfiles can install different Antora versions. The CI workflow in site-builder also builds the image again on every run, at least four times a day, so it would show a breaking Antora change early. Today both Dockerfiles install @antora/cli@3.1, so every image build gets the newest 3.1 release. The newest Antora release is 3.2.1. I tested a build with Antora 3.2, and rebuild-site.py failed. This is not urgent, so I will look at it later. After that fix, staging can use the newest version while production stays pinned.

npm files. The site build does not use the root package.json and package-lock.json. The images install Antora with their own npm install command. The two files are only for someone who builds the site on their own computer with npm and without containers. If the preview needs only Podman, we do not need that. Nobody has updated the files since they were added in March. The lock file has Antora 3.1.14, but 3.1.15 came out in May. To use them, we would have to update them regularly. So I agree with Christian and would remove them. The pinned Antora version for production would go into the Dockerfile.

For AArch64, I am still looking at the options for an AArch64 self-hosted runner. My test results and the plan for AArch64 images are in docs/docs-fp-o#66. For a quick preview of one component, the fast mode is the default and builds only that component, so nobody has to build the whole site. Christian suggested keeping docsbuilder.sh as a small wrapper around the new command. We can decide this after trying the command.

**Newest Antora for staging.** I like the idea, and it needs no change in infra/ansible. OpenShift builds the staging image from `build-scripts/Dockerfile` in site-builder on forge.stg, and the production image from the `prod` branch of docs-fp-o. So the two Dockerfiles can install different Antora versions. The CI workflow in site-builder also builds the image again on every run, at least four times a day, so it would show a breaking Antora change early. Today both Dockerfiles install `@antora/cli@3.1`, so every image build gets the newest 3.1 release. The newest Antora release is 3.2.1. I tested a build with Antora 3.2, and `rebuild-site.py` failed. This is not urgent, so I will look at it later. After that fix, staging can use the newest version while production stays pinned. **npm files.** The site build does not use the root `package.json` and `package-lock.json`. The images install Antora with their own `npm install` command. The two files are only for someone who builds the site on their own computer with npm and without containers. If the preview needs only Podman, we do not need that. Nobody has updated the files since they were added in March. The lock file has Antora 3.1.14, but 3.1.15 came out in May. To use them, we would have to update them regularly. So I agree with Christian and would remove them. The pinned Antora version for production would go into the Dockerfile. For AArch64, I am still looking at the options for an AArch64 self-hosted runner. My test results and the plan for AArch64 images are in docs/docs-fp-o#66. For a quick preview of one component, the fast mode is the default and builds only that component, so nobody has to build the whole site. Christian suggested keeping `docsbuilder.sh` as a small wrapper around the new command. We can decide this after trying the command.
Owner

@hricky wrote in docs/docs-fp-o#65 (comment):

Newest Antora for staging. […]

Awesome! The fact that Antora 3.2 breaks our site today is exactly why this "canary in the coal mine" for staging will be handy.

@hricky wrote in docs/docs-fp-o#65 (comment):

npm files. […]

I see. So, it only seems to matter for local development? In this case, I would tend to agree with deleting and gitignore-ing them.

@hricky wrote in docs/docs-fp-o#65 (comment):

For AArch64, I am still looking at the options for an AArch64 self-hosted runner. […] Christian suggested keeping docsbuilder.sh as a small wrapper around the new command. We can decide this after trying the command.

Maybe you already know this, but if I recall correctly, the Fedora Forge Team can provide aarch64 runners but only for special purposes which actually require aarch64. A quick look at the issue template for new runners seems to indicate that they can be requested.

Not sure if that changes your interest in self-hosting an aarch64 runner or not.

Also, I think @cstrauf could have a point about docsbuilder.sh. For people who do not edit or work on Fedora Docs all the time, it might be convenient if we use the same wrapper script we have used for 8-9 years already. The people who do write docs might be trained on using this script. It could make migrating easier.

@hricky wrote in https://forge.fedoraproject.org/docs/docs-fp-o/issues/65#issuecomment-1369002: > **Newest Antora for staging.** […] Awesome! The fact that Antora 3.2 breaks our site today is exactly why this "canary in the coal mine" for staging will be handy. @hricky wrote in https://forge.fedoraproject.org/docs/docs-fp-o/issues/65#issuecomment-1369002: > **npm files.** […] I see. So, it only seems to matter for local development? In this case, I would tend to agree with deleting and `gitignore`-ing them. @hricky wrote in https://forge.fedoraproject.org/docs/docs-fp-o/issues/65#issuecomment-1369002: > For AArch64, I am still looking at the options for an AArch64 self-hosted runner. […] Christian suggested keeping `docsbuilder.sh` as a small wrapper around the new command. We can decide this after trying the command. Maybe you already know this, but if I recall correctly, the Fedora Forge Team _can_ provide `aarch64` runners but only for special purposes which actually require `aarch64`. A quick look at the [issue template for new runners](https://forge.fedoraproject.org/forge/forge/src/branch/main/.forgejo/issue_template/new_runner.yml#L52) seems to indicate that they can be requested. Not sure if that changes your interest in self-hosting an `aarch64` runner or not. Also, I think @cstrauf could have a point about `docsbuilder.sh`. For people who do not edit or work on Fedora Docs all the time, it might be convenient if we use the same wrapper script we have used for 8-9 years already. The people who do write docs might be trained on using this script. It could make migrating easier.
Author
Owner

Thanks for the link to the runner request template. It says that aarch64 runners are not generally available. Selecting aarch64 in the form only expresses interest, and the Forge team follows up on availability. The template also says that the runners on Fedora Forge are not intended for heavy CI workloads, and building the image on every run may count as heavy. This does not change my interest in self-hosting an AArch64 runner.

About docsbuilder.sh, I also lean toward keeping it as a small wrapper around the new command. Then people can keep using the script they already know.

I will remove the npm files and add them to .gitignore.

Thanks for the link to the runner request template. It says that aarch64 runners are not generally available. Selecting aarch64 in the form only expresses interest, and the Forge team follows up on availability. The template also says that the runners on Fedora Forge are not intended for heavy CI workloads, and building the image on every run may count as heavy. This does not change my interest in self-hosting an AArch64 runner. About `docsbuilder.sh`, I also lean toward keeping it as a small wrapper around the new command. Then people can keep using the script they already know. I will remove the npm files and add them to `.gitignore`.
Owner

Discussed at the 2026-11-03 team meeting: https://discussion.fedoraproject.org/t/fedora-docs-team-meeting-2026-11-03/206179/2

Generally we all agreed with @jflory7's and @cstrauf's comments above.

Discussed at the 2026-11-03 team meeting: https://discussion.fedoraproject.org/t/fedora-docs-team-meeting-2026-11-03/206179/2 Generally we all agreed with @jflory7's and @cstrauf's comments above.
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
docs/site-builder#65
No description provided.