diff --git a/docs/source/pre_application/cloud_node_management.rst b/docs/source/pre_application/cloud_node_management.rst index 63042899c..5170104de 100644 --- a/docs/source/pre_application/cloud_node_management.rst +++ b/docs/source/pre_application/cloud_node_management.rst @@ -11,7 +11,16 @@ PRE Node Deployment Automation via `nucypher-ops `_. -In this tutorial we're going to setup a Threshold PRE Node using a remote cloud provider (Digital Ocean, AWS, and more in the future). +In this tutorial we're going to setup a Threshold PRE node using a remote cloud provider (Digital Ocean, AWS, and more in the future). +The PRE node will run via a Docker container. + +.. note:: + + By default, ``nucypher-ops`` uses a Docker container restart policy of ``unless-stopped``. + This ensures that the Docker container will be automatically restarted if it exited, + except if the container was stopped via an appropriate command. See `Docker Restart Policies `_ + for more information. + This example will demonstrate how to deploy to Digital Ocean. There are a few pre-requisites before we can get started. First, we need to create accounts on `Digital Ocean `_ and `Infura `_. Also ensure that your local environment has python 3.8 or later installed. @@ -20,7 +29,7 @@ Also ensure that your local environment has python 3.8 or later installed. Launch Remote Node ------------------- -.. note:: +.. important:: nucypher-ops requires python 3.8 or later. diff --git a/docs/source/pre_application/running_a_node.rst b/docs/source/pre_application/running_a_node.rst index 91e92301e..7b69df737 100644 --- a/docs/source/pre_application/running_a_node.rst +++ b/docs/source/pre_application/running_a_node.rst @@ -222,6 +222,7 @@ This step starts the PRE node. $ docker run -d --rm \ --name ursula \ + --restart on-failure \ -v ~/.local/share/nucypher:/root/.local/share/nucypher \ -v ~/.ethereum/:/root/.ethereum \ -p 9151:9151 \ @@ -230,6 +231,14 @@ This step starts the PRE node. nucypher/nucypher:latest \ nucypher ursula run + +.. note:: + + Setting the ``--restart`` parameter to ``on-failure`` ensures that the Docker + container will be automatically restarted if the application exited unexpectedly (e.g. an application crash). + See `Docker Restart Policies `_ + for more information. + View Node Logs ++++++++++++++ @@ -307,6 +316,7 @@ Create a file named ``ursula.service`` in ``/etc/systemd/system``, and add this [Service] User= Type=simple + Restart=on-failure Environment="NUCYPHER_OPERATOR_ETH_PASSWORD=" Environment="NUCYPHER_KEYSTORE_PASSWORD=" ExecStart=/bin/nucypher ursula run @@ -324,6 +334,15 @@ Replace the following values with your own: Run ``pipenv –venv`` within the virtual environment to get the virtual environment path. +.. note:: + + Setting the ``Restart`` option to ``on-failure``, ensures that the systemd service + will be automatically restarted if it exited with a non-zero exit code, except if + the container was stopped using the ``systemctl stop`` command. See + `Systemd Restart `_ + for more information. + + Enable Node Service ~~~~~~~~~~~~~~~~~~~ diff --git a/newsfragments/2945.doc.rst b/newsfragments/2945.doc.rst new file mode 100644 index 000000000..2e2f35eb2 --- /dev/null +++ b/newsfragments/2945.doc.rst @@ -0,0 +1 @@ +Add recommendation/information about restart functionality when running a PRE node.