Promise is a key element to make sure your service is running as expected. This HowTo will explain how to add a new promise in the context of html5as-base software release.
Here is the commit introducing this functionality to html5as Software release: commit diff.
Add a section for a monitoring promise in instance instance_html5as.cfg.in
. We choose to add a [port-listening-promise]
to check that the nginx service is listening port. It doesn't check if the service return an error or not.
# Port Listening checking promise
[port-listening-promise]
<= monitor-promise-base
promise = check_socket_listening
name = nginx-port-listening.py
config-host = ${html5as:ip}
config-port = ${html5as:port}
Add port-listening-promise
section to the list of processed parts in instance_html5as.cfg.in
as no other processed parts depend on it.
[buildout]
parts =
...
port-listening-promise
...
Refer How To Move to md5sum automatic update to update md5sum
:
$ cd ~/srv/project/slapos/software/html5as-base $ ../../update-hash
To inspect the output of slapos node software
:
$ slapos node software --all
To inspect the output of slapos node instance
:
$ slapos node instance --all
Observe the log of slapos node Instance
. It now contains the promise info at the end:
2021-10-27 03:01:23 slapos[86186] INFO Checking slappart0 promises... 2021-10-27 03:01:23 slapos[86186] INFO Checking promise nginx-port-listening.py... 2021-10-27 03:01:23 nginx-port-listening.py[86186] INFO socket connection OK ('2001:67c:1254:f1::7692', 8086, 0, 0)
If you face issues, please update your local branch first:
$ git stash
$ git fetch
$ git reset --hard origin/master
$ git stash pop
Then rerun the past commands
For more information, please contact Jean-Paul, CEO of Rapid.Space (+33 629 02 44 25).