Add shared state mirror setup documentation
cover Add shared state mirror setup documentation
---
Antonin Godard (5):
dev-manual: add a shared state mirror setup document ref-manual/variables.rst: SSTATE_MIRRORS: remove uninative mapping note ref-manual/variables.rst: SSTATE_MIRRORS: remove directory structure note ref-manual/variables.rst: SSTATE_MIRRORS: move password note to shared state mirror document ref-manual/variables.rst: SSTATE_MIRRORS: link to the new sstate-mirrors-setup doc
documentation/dev-manual/index.rst | 1 + documentation/dev-manual/sstate-mirrors-setup.rst | 194 ++++++++++++++++++++++ documentation/ref-manual/variables.rst | 51 +----- 3 files changed, 199 insertions(+), 47 deletions(-)
---
base-commit: 358519ca6406a89fee42c45dcaf63a37a374f33c
change-id: 20260720-sstate-mirrors-doc-02f5047e9931
PATCH 1/5 dev-manual: add a shared state mirror setup document
The aim of this document is to provide an introduction on how to setup a shared state mirror on a server for use by clients with SSTATE_MIRRORS. Setting it up is relatively straightforward. The document gives some tips which is where the value of the document lies (e.g. by reminding to use a hash equivalence service alongside it).
[YOCTO #13589]
--- documentation/dev-manual/index.rst | 1 + documentation/dev-manual/sstate-mirrors-setup.rst | 166 ++++++++++++++++++++++ 2 files changed, 167 insertions(+)
documentation/dev-manual/index.rst +1 -0
@@ -49,6 +49,7 @@ Yocto Project Development Tasks Manual wayland qemu bblock + sstate-mirrors-setup hashequivserver .. include:: /boilerplate.rst
documentation/dev-manual/sstate-mirrors-setup.rst new file +166 -0
166 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH 2/5 ref-manual/variables.rst: SSTATE_MIRRORS: remove uninative mapping note
In reply to Antonin GodardSince 552e037bf598 ("uninative/utils: Drop workarounds for gcc 4.8/4.9") in OE-Core the uninative directory created in the shared state directory no longer has "-4.8" or "-4.9" appended to it, and the directory is always named "universal", so there's no need for this mapping anymore.
--- documentation/ref-manual/variables.rst | 10 ---------- 1 file changed, 10 deletions(-)
documentation/ref-manual/variables.rst +0 -10
@@ -10100,16 +10100,6 @@ system and gives an overview of their function and contents. cache (sstate-cache) results from previous builds. The sstate-cache you point to can also be from builds on other machines. - When pointing to sstate build artifacts on another machine that uses - a different GCC version for native builds, you must configure - :term:`SSTATE_MIRRORS` with a regular expression that maps local search - paths to server paths. The paths need to take into account - :term:`NATIVELSBSTRING` set by the :ref:`ref-classes-uninative` class. - For example, the following maps the local search path ``universal-4.9`` - to the server-provided path server_url_sstate_path:: - - SSTATE_MIRRORS ?= "file://universal-4.9/(.*) https://server_url_sstate_path/universal-4.8/\1" - If a mirror uses the same structure as :term:`SSTATE_DIR`, you need to add "PATH" at the end as shown in the examples below. The build system substitutes the
Signature · 1 line
2.55.0
PATCH 3/5 ref-manual/variables.rst: SSTATE_MIRRORS: remove directory structure note
In reply to Antonin GodardSetting up a shared state mirror would most likely always happen by sharing a shared state directory constructed by BitBake, which has a specific layout. Otherwise, the following definition:
SSTATE_MIRRORS = "file://.* https://someserver.tld"
would require the server to have all the sstate artifacts at the root of the server, in a flat layout, which is probably never the case.
--- documentation/ref-manual/variables.rst | 9 --------- 1 file changed, 9 deletions(-)
documentation/ref-manual/variables.rst +0 -9
@@ -10100,15 +10100,6 @@ system and gives an overview of their function and contents. cache (sstate-cache) results from previous builds. The sstate-cache you point to can also be from builds on other machines. - If a mirror uses the same structure as - :term:`SSTATE_DIR`, you need to add "PATH" at the - end as shown in the examples below. The build system substitutes the - correct path within the directory structure:: - - SSTATE_MIRRORS ?= "\ - file://.* https://someserver.tld/share/sstate/PATH;downloadfilename=PATH \ - file://.* file:///some-local-dir/sstate/PATH" - .. note:: If the mirror is protected behind a username and password, the
Signature · 1 line
2.55.0
PATCH 4/5 ref-manual/variables.rst: SSTATE_MIRRORS: move password note to shared state mirror document
In reply to Antonin GodardLet's gather the different tips on setting up a shared state mirror in the same document, so move the user/password note from the SSTATE_MIRRORS variable definition to the sstate-mirrors-setup.rst doc.
--- documentation/dev-manual/sstate-mirrors-setup.rst | 28 +++++++++++++++++++++++ documentation/ref-manual/variables.rst | 28 ----------------------- 2 files changed, 28 insertions(+), 28 deletions(-)
documentation/dev-manual/sstate-mirrors-setup.rst +28 -0
@@ -112,6 +112,34 @@ Going Further :doc:`/dev-manual/hashequivserver` section of the Yocto Project Development Tasks Manual for more information. +- If the mirror is protected behind a username and password, the + :term:`build host` needs to be configured so the :term:`build system + <OpenEmbedded Build System>` is able to download the shared state cache using + authentication. + + The recommended way to do that is by setting the following parameters + in ``$HOME/.netrc`` (``$HOME`` being the :term:`build host` home + directory):: + + machine someserver.tld + login <user> + password <password> + + This file requires permissions set to ``400`` or ``600`` to prevent + other users from reading the file: + + .. code-block:: console + + $ chmod 600 "$HOME/.netrc" + + Another method to configure the username and password is from the + URL in :term:`SSTATE_MIRRORS` directly, with the ``user`` and ``pswd`` + parameters:: + + SSTATE_MIRRORS ?= "\ + file://.* https://someserver.tld/share/sstate/PATH;user=<user>;pswd=<password>;downloadfilename=PATH \ + " + - If the :term:`BB_NO_NETWORK` variable is set to "1" on clients as a means to disable any accesses to the network, the :term:`SSTATE_MIRROR_ALLOW_NETWORK` variable may be used to allow the clients to fetch from the shared state
documentation/ref-manual/variables.rst +0 -28
@@ -10100,34 +10100,6 @@ system and gives an overview of their function and contents. cache (sstate-cache) results from previous builds. The sstate-cache you point to can also be from builds on other machines. - .. note:: - - If the mirror is protected behind a username and password, the - :term:`build host` needs to be configured so the :term:`build system - <OpenEmbedded Build System>` is able to download the sstate cache using - authentication. - - The recommended way to do that is by setting the following parameters - in ``$HOME/.netrc`` (``$HOME`` being the :term:`build host` home - directory):: - - machine someserver.tld - login <user> - password <password> - - This file requires permissions set to ``400`` or ``600`` to prevent - other users from reading the file:: - - chmod 600 "$HOME/.netrc" - - Another method to configure the username and password is from the - URL in :term:`SSTATE_MIRRORS` directly, with the ``user`` and ``pswd`` - parameters:: - - SSTATE_MIRRORS ?= "\ - file://.* https://someserver.tld/share/sstate/PATH;user=<user>;pswd=<password>;downloadfilename=PATH \ - " - The Yocto Project actually shares the cache data objects built by its autobuilder::
Signature · 1 line
2.55.0
PATCH 5/5 ref-manual/variables.rst: SSTATE_MIRRORS: link to the new sstate-mirrors-setup doc
In reply to Antonin GodardAdd a link from the SSTATE_MIRRORS variable definition to our new sstate-mirrors-setup document, which instructs how to set a basic server along with tips on hash equivalence, etc.
--- documentation/ref-manual/variables.rst | 4 ++++ 1 file changed, 4 insertions(+)
documentation/ref-manual/variables.rst +4 -0
@@ -10110,6 +10110,10 @@ system and gives an overview of their function and contents. reusable in real projects building binaries optimized for a specific CPU family. + See the :doc:`/dev-manual/sstate-mirrors-setup` section of the Yocto + Project Development Tasks Manual for details on how to setup a shared + state mirror. + :term:`SSTATE_SCAN_FILES` Controls the list of files the OpenEmbedded build system scans for hardcoded installation paths. The variable uses a space-separated
Signature · 1 line
2.55.0
Antonin Godard
AppliedApplied, thanks!
[1/5] dev-manual: add a shared state mirror setup document
commit: 15b08adf30ddbeb9f9911d4a6ae207e95f94ca87
[2/5] ref-manual/variables.rst: SSTATE_MIRRORS: remove uninative mapping note
commit: 8719aae97386f185b89c0fa1dcaa11d4fdac3969
[3/5] ref-manual/variables.rst: SSTATE_MIRRORS: remove directory structure note
commit: 3c319bbee89a9a57c1baebf90f79b04ffe9f003f
[4/5] ref-manual/variables.rst: SSTATE_MIRRORS: move password note to shared state mirror document
commit: 23e84fcd28cd0b4839fd1363b26a9f3791736f92
[5/5] ref-manual/variables.rst: SSTATE_MIRRORS: link to the new sstate-mirrors-setup doc
commit: 41dae3c3da3ada1745fc60228ff6269c64ee2361