Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • willsalmon/buildstream
  • CumHoleZH/buildstream
  • tchaik/buildstream
  • DCotyPortfolio/buildstream
  • jesusoctavioas/buildstream
  • patrickmmartin/buildstream
  • franred/buildstream
  • tintou/buildstream
  • alatiera/buildstream
  • martinblanchard/buildstream
  • neverdie22042524/buildstream
  • Mattlk13/buildstream
  • PServers/buildstream
  • phamnghia610909/buildstream
  • chiaratolentino/buildstream
  • eysz7-x-x/buildstream
  • kerrick1/buildstream
  • matthew-yates/buildstream
  • twofeathers/buildstream
  • mhadjimichael/buildstream
  • pointswaves/buildstream
  • Mr.JackWilson/buildstream
  • Tw3akG33k/buildstream
  • AlexFazakas/buildstream
  • eruidfkiy/buildstream
  • clamotion2/buildstream
  • nanonyme/buildstream
  • wickyjaaa/buildstream
  • nmanchev/buildstream
  • bojorquez.ja/buildstream
  • mostynb/buildstream
  • highpit74/buildstream
  • Demo112/buildstream
  • ba2014sheer/buildstream
  • tonimadrino/buildstream
  • usuario2o/buildstream
  • Angelika123456/buildstream
  • neo355/buildstream
  • corentin-ferlay/buildstream
  • coldtom/buildstream
  • wifitvbox81/buildstream
  • 358253885/buildstream
  • seanborg/buildstream
  • SotK/buildstream
  • DouglasWinship/buildstream
  • karansthr97/buildstream
  • louib/buildstream
  • bwh-ct/buildstream
  • robjh/buildstream
  • we88c0de/buildstream
  • zhengxian5555/buildstream
51 results
Show changes
Commits on Source (4)
......@@ -335,16 +335,9 @@ def node_get_provenance(node, key=None, indices=None):
return provenance
# Helper to use utils.sentinel without unconditional utils import,
# which causes issues for completion.
#
# Local private, but defined here because sphinx appears to break if
# it's not defined before any functions calling it in default kwarg
# values.
#
def _get_sentinel():
from .utils import _sentinel
return _sentinel
# A sentinel to be used as a default argument for functions that need
# to distinguish between a kwarg set to None and an unset kwarg.
_sentinel = object()
# node_get()
......@@ -368,10 +361,10 @@ def _get_sentinel():
# Note:
# Returned strings are stripped of leading and trailing whitespace
#
def node_get(node, expected_type, key, indices=None, default_value=_get_sentinel()):
def node_get(node, expected_type, key, indices=None, default_value=_sentinel):
value = node.get(key, default_value)
provenance = node_get_provenance(node)
if value is _get_sentinel():
if value is _sentinel:
raise LoadError(LoadErrorReason.INVALID_DATA,
"{}: Dictionary did not contain expected key '{}'".format(provenance, key))
......
......@@ -451,7 +451,7 @@ class Element(Plugin):
return None
def node_subst_member(self, node, member_name, default=utils._sentinel):
def node_subst_member(self, node, member_name, default=_yaml._sentinel):
"""Fetch the value of a string node member, substituting any variables
in the loaded value with the element contextual variables.
......
......@@ -321,7 +321,7 @@ class Plugin():
provenance = _yaml.node_get_provenance(node, key=member_name)
return str(provenance)
def node_get_member(self, node, expected_type, member_name, default=utils._sentinel):
def node_get_member(self, node, expected_type, member_name, default=_yaml._sentinel):
"""Fetch the value of a node member, raising an error if the value is
missing or incorrectly typed.
......
......@@ -654,10 +654,6 @@ def _pretty_size(size, dec_places=0):
return "{size:g}{unit}".format(size=round(psize, dec_places), unit=unit)
# A sentinel to be used as a default argument for functions that need
# to distinguish between a kwarg set to None and an unset kwarg.
_sentinel = object()
# Main process pid
_main_pid = os.getpid()
......
......@@ -155,9 +155,15 @@ Instance with push and requiring client authentication:
Managing the cache with systemd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is better to run the cache as a systemd service, especially if it is running on a dedicated server, as this will allow systemd to manage the cache, incase the server ever encounters any issues.
We recommend running the cache as a systemd service, especially if it is running
on a dedicated server, as this will allow systemd to manage the cache, in case
the server encounters any issues.
Below are two examples of how to run the cache server as a systemd service, one is for pull only and the other is configured for push & pull.
Below are two examples of how to run the cache server as a systemd service. The
first, is for pull only and the other is configured for push & pull. Notice that
the two configurations use different ports.
``bst-artifact-serve.service``:
.. code:: ini
......@@ -176,6 +182,9 @@ Below are two examples of how to run the cache server as a systemd service, one
[Install]
WantedBy=multi-user.target
``bst-artifact-serve-receive.service``:
.. code:: ini
#
......@@ -193,7 +202,37 @@ Below are two examples of how to run the cache server as a systemd service, one
[Install]
WantedBy=multi-user.target
Here we define when systemd should start the service, which is after the networking stack has been started, we then define how to run the cache with the desired configuration, under the artifacts user. The {{ }} are there to denote where you should change these files to point to your desired locations.
Here we define when systemd should start the service, which is after the networking
stack has been started, we then define how to run the cache with the desired
configuration, under the artifacts user. The {{ }} are there to denote where you
should change these files to point to your desired locations.
.. note::
You may need to run some of the following commands as the superuser.
These files should be copied to ``/etc/systemd/system/``. We can then start these services
with:
.. code:: bash
systemctl enable bst-artifact-serve.service
systemctl enable bst-artifact-serve-receive.service
Then, to start these services:
.. code:: bash
systemctl start bst-artifact-serve.service
systemctl start bst-artifact-serve-receive.service
We can then check if the services are successfully running with:
.. code:: bash
journalctl -u bst-artifact-serve.service
journalctl -u bst-artifact-serve-receive.service
For more information on systemd services see:
`Creating Systemd Service Files <https://www.devdungeon.com/content/creating-systemd-service-files>`_.
......