summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jones <adam.jones@codethink.co.uk>2018-06-29 17:46:38 +0100
committerAdam Jones <adam.jones@codethink.co.uk>2018-06-29 17:46:38 +0100
commit46286fbbb9f49f26a876a8cbf2e8a0677ef71a6d (patch)
tree5b96c69f148920a22208fef5c29693b31fc943f0
parentcc83bd6fc02311428135b3a2679563bc1fe0e742 (diff)
downloadbuildstream-adamjones/systemd-cas.tar.gz
Add systemd service file examples to artifacts documentationadamjones/systemd-cas
-rw-r--r--doc/source/artifacts.rst44
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/source/artifacts.rst b/doc/source/artifacts.rst
index e96ca972c..b7ce94d3d 100644
--- a/doc/source/artifacts.rst
+++ b/doc/source/artifacts.rst
@@ -143,6 +143,50 @@ Instance with push and requiring client authentication:
bst-artifact-server --port 11002 --server-key server.key --server-cert server.crt --client-certs authorized.crt --enable-push /home/artifacts/artifacts
+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.
+
+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.
+
+.. code:: yaml
+
+ #
+ # Pull
+ #
+ [Unit]
+ Description=Buildstream Artifact pull server
+ After=remote-fs.target network-online.target
+
+ [Service]
+ Environment="LC_ALL=C.UTF-8"
+ ExecStart=/usr/local/bin/bst-artifact-server --port 11001 --server-key {{certs_path}}/privkey.pem --
+ server-cert {{certs_path}}/fullchain.pem {{artifacts_path}}
+ User=artifacts
+
+ [Install]
+ WantedBy=multi-user.target
+
+
+ #
+ # Pull/Push
+ #
+ [Unit]
+ Description=Buildstream Artifact pull/push server
+ After=remote-fs.target network-online.target
+
+ [Service]
+ Environment="LC_ALL=C.UTF-8"
+ ExecStart=/usr/local/bin/bst-artifact-server --port 11002 --server-key {{certs_path}}/privkey.pem --
+ server-cert {{certs_path}}/fullchain.pem --client-certs /home/artifacts/authorized.crt --enable-push /
+ {{artifacts_path}}
+ User=artifacts
+
+ [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.
User configuration
~~~~~~~~~~~~~~~~~~