Skip to content

Commit 25bd17e

Browse files
committed
refactor
1 parent b40d3c8 commit 25bd17e

File tree

3 files changed

+75
-10
lines changed

3 files changed

+75
-10
lines changed

lookup-service-client/README.md

+70-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,70 @@
1-
# ls-registration-daemon-v2
2-
Client daemon that registers records in the lookup service
1+
# Lookup Service Client
2+
Client daemon that registers records in the lookup service
3+
4+
# Settings and Configs
5+
**For The debian and rpm installations**
6+
7+
systemd service is enabled upon installation and the pslookup client starts with default configurations.
8+
9+
1. [Defaults](pslookup/perfsonar-pslookup/pslookup-config/pslookup-registration.conf) to using the localhost node exporter and perfsonar host exporter
10+
2. Client configuration - Modify the config file registration frequency and default paths for record configurations
11+
```
12+
[/etc/perfsonar/pslookup/pslookup-registration.conf](pslookup/perfsonar-pslookup/pslookup-config/pslookup-registration.conf)
13+
```
14+
3. Record configuration files - To provide data to overwrite or to add to the record. Replace nulls with the values to be placed in the record.
15+
```
16+
Defaults
17+
[/etc/perfsonar/pslookup/pslookup-record-conf/interfaces.json](pslookup/perfsonar-pslookup/pslookup-config/pslookup-record-conf/interfaces.json)
18+
[/etc/perfsonar/pslookup/pslookup-record-conf/host.json](pslookup/perfsonar-pslookup/pslookup-config/pslookup-record-conf/host.json)
19+
```
20+
21+
# Validation Tool
22+
pslookup tool can be used to validate a record.
23+
```
24+
pslookup validate
25+
```
26+
***Customizing
27+
The validation tool allows to validate a record built by the pslookup service using the client config. This will utilize the service to build the record that will be registered and validate it against the schema.
28+
To validate a record built manually, use the record option to point to the json record. If this option is provided, config is ignored.
29+
30+
| Option | Type | Description |
31+
| :----: | :--: | :---------: |
32+
| config | String | Path to the client config file. Defaults to /etc/perfsonar/pslookup/pslookup-registration.conf |
33+
| record | String | Path to the json record |
34+
35+
36+
# Developer Settings:
37+
38+
1. To modify Schema for record validation
39+
```
40+
[pslookup/perfsonar-pslookup/schema/schema.json](pslookup/perfsonar-pslookup/schema/schema.json)
41+
```
42+
2. The python pslookup package utilizes symlink to the [schema.json](pslookup/perfsonar-pslookup/pslookup/schema/schema.json). Any modification to the schema will be reflected in both the client [package]((pslookup/perfsonar-pslookup/pslookup/schema/schema.json)) and [server](../lookup-service-server/schema/schema.json).
43+
3. Changes in the schema should be complimented with updates to the database mappings and vice versa.
44+
```
45+
[lookup-service-server/app/mapping](../lookup-service-server/app/mapping/)
46+
```
47+
4. Changes to the schema should also be implemented in the default [record configurations](pslookup/perfsonar-pslookup/pslookup-config/pslookup-record-conf/).
48+
49+
**Installing the client locally on Docker**
50+
Using [unibuild](https://github.com/perfsonar/unibuild)
51+
```
52+
git clone https://github.com/perfsonar/pslookup-service.git
53+
cd pslookup-service
54+
wget https://raw.githubusercontent.com/perfsonar/unibuild/main/docker-envs/docker-compose.yml
55+
download the [docker-envs](https://github.com/perfsonar/unibuild/tree/main/docker-envs)
56+
docker compose run el9 bash
57+
cd lookup-service-client
58+
unibuild build
59+
```
60+
The above will install the service but will fail to start the systemd service. The installation can be tested by running the [pslookup Client Agent](pslookup/perfsonar-pslookup/bin/pslookup_client_agent).
61+
```
62+
/usr/lib/perfsonar/pslookup/bin/pslookup_client_agent --config=/etc/perfsonar/pslookup/pslookup-registration.conf --logger=/etc/perfsonar/pslookup/pslookup-client-agent-logger.conf
63+
```
64+
65+
**Note:**
66+
The record generation process persists a client UUID at the following path. It appends hostnames to UUID to compare changes to the hostname. If any changes are found, the service logs the change in the log files and proceeds to register the record with the new UUID.
67+
```
68+
/var/lib/perfsonar/pslookup/client-uuid.txt
69+
```
70+
The validation tool does not persist the UUID.

lookup-service-client/pslookup/perfsonar-pslookup/pslookup-config/pslookup-registration.conf

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ register_interval = 3600
66
# How often to check for changes in config files
77
# Registers record if changes found
88
check_interval = 600
9-
#Set this off to only register the supplied records
9+
#Set this off to only register the supplied records (Not setup)
1010
allow_auto_discover = 1
1111

12-
# Contains the information to overwrite/ add if auto_discover is True
13-
# Otherwise registers only the information found here
12+
# Contains the information to overwrite/ add to the record
1413
[record_data]
1514
interface_overwite_conf_path = /etc/perfsonar/pslookup/pslookup-record-conf/interfaces.json
1615
host_overwite_conf_path = /etc/perfsonar/pslookup/pslookup-record-conf/host.json
1716

1817
[server_config]
1918
server = http://ls.perfsonar.net:80
20-
21-
#activehosts.json for adding API

lookup-service-server/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ The following environment variables are needed for the database connection.
2828

2929
# Note for Developers:
3030

31-
1. Schema for record validation
31+
1. To modify Schema for record validation
3232
```
3333
lookup-service-client/pslookup/perfsonar-pslookup/schema/schema.json
3434
```
35-
2. Any modification to the schema will be reflected in the client package and server.
36-
3. Changes in the mapping should be complimented with updates to the database mappings.
35+
2. Any modification to the schema will be reflected in both the client package and server.
36+
3. Changes in the schema should be complimented with updates to the database mappings and vice versa.
3737
```
3838
lookup-service-server/app/mapping
3939
```

0 commit comments

Comments
 (0)