Skip to content

Commit 3dc1d75

Browse files
authored
Add documentation regaring Consul service discovery (#403)
1 parent d025e9d commit 3dc1d75

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

doc/DevelopersTips.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ here. It is not sanitized or organized. Just a brain dump.
55

66
### Release procedure / check list
77
1. Update the version number in [CMakeLists.txt](../CMakeLists.txt), commit and push
8-
2. Prepare the release notes using the commits since the last release in github (see [this template](ReleaseNotesTemplate.md)).
8+
2. Prepare the release notes using the commits since the last release in github (see [this template](ReleaseNotesTemplate.md)).
99
3. Release in github, paste the release notes
1010
4. A PR is automatically created in alidist
11-
5. Once merged, send an email to alice-o2-wp7@cern.ch, alice-o2-qc-contact@cern.ch and alice-dpg-qa-tools@cern.ch to announce the new release. Use the email for the previous release as a template.
11+
5. Once merged, send an email to alice-o2-wp7@cern.ch, alice-o2-qc-contact@cern.ch and alice-dpg-qa-tools@cern.ch to announce the new release. Use the email for the previous release as a template.
1212

13-
### Where and how to configure the repo_cleaner of the ccdb-test
13+
### Where and how to configure the repo_cleaner of the ccdb-test
1414

1515
The config file is stored in git in the branch `repo_cleaner` (careful not to update in master instead !). Check out the branch, update the file Framework/script/RepoCleaner/config.yaml and commit it. A PR is necessary but in case of emergency, force-merge it. As soon as it is merged, it will be used by the script.
1616

@@ -81,3 +81,22 @@ We use the infologger. There is a utility class, `QcInfoLogger`, that can be use
8181

8282
Related issues : https://alice.its.cern.ch/jira/browse/QC-224
8383

84+
### Service Discovery (Online mode)
85+
86+
Service discovery (Online mode) is used to list currently published objects by running QC tasks. It uses Consul to store:
87+
- List of running QC tasks that respond to health check, known as "services" in Consul
88+
- List of published object by each QC task ("service"), knows as "tags" of a "service" in Consul
89+
90+
Both lists are updated from within QC task using [Service Discovery C++ API](#Service-Discovery-C++-API-and-Consul-HTTP-API):
91+
- `register` - when a tasks starts
92+
- `deregister` - when tasks ends
93+
94+
#### Register (and health check)
95+
When a QC task starts, it register its presence in Consul by calling [register endpoit of Consul HTTP API](https://www.consul.io/api/agent/service.html#register-service). The request needs the following fields:
96+
- `Id` - Task ID (must be unique)
97+
- `Name` - Task name, tasks can have same name when they run on mutiple machines
98+
- `Tags` - List of published objects
99+
- `Checks` - Array of health check details for Consul, each should contain `Name`, `Interval`, type of check with endpoint to be check by Consul (eg. `"TCP": "localhost:1234"`) and `DeregisterCriticalServiceAfter` that defines timeout to automatically deregister service when fails health checks (minimum value `1m`).
100+
101+
#### Deregister
102+
In order to deregister a service [`deregister/:Id` endpoint of Consul HTTP API](https://www.consul.io/api/agent/service.html#deregister-service) needs to be called. It does not need any additional parameters.

0 commit comments

Comments
 (0)