-
Notifications
You must be signed in to change notification settings - Fork 4
Service Readme Template
A compact description of what service does.
Report Bug
·
Open PR
Short description that explains what this service does in high level:
- Which problem does it solve
- How does this service get triggered
- What does the service do
- ...
This service helps manage the consumer-producer flow. The following services are closely related to this one:
my_service:
image: lblod/my_service
volumes:
- ./some/config/path:/config
labels:
- "logging=true"
restart: always
logging: *default-logging
If other basic configuration is needed, specify here. Just the minimum to make it work. E.g. setup delta-notifier, auth rules. Leave advanced stuff for the advanced section below.
ENV | description | default | required |
---|---|---|---|
EXAMPLE_ENV | This env is just an example | true |
X |
ANOTHER_ENV | And another one | http://mu.semte.ch/application |
This section explains things you dont want to have missed. Common pitfals. E.g:
- You have to wait for the migrations to complete before you can make a request
- This service wait for X in service Y to complete. Make sure that one completes BEFORE you trigger this service or you have to restart the stack
The point of this section is to already give the user a headsup of certain issues/pitfals that you might have encountered while testing/developing this service and said to yourself: "whoever uses this service should know this or they will keep searching and searching..."
The advanced section is used to go a bit more in depth. It explains possible config files, how to setup stuff, how to test, API's and other topics. The paragraph you are currently reading can be removed.
You manage X and Y by creating a folder containing json files with config options. A basic option has been given above, here is a more advanced configuration to fit your needs.
/config/service-name/config/export.json
{
"export": [
{
"type": "http://data.vlaanderen.be/ns/besluit#Agendapunt",
"graphsFilter": [ "http://mu.semte.ch/graphs/public" ],
"properties": [
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
"http://mu.semte.ch/vocabularies/core/uuid",
"http://data.vlaanderen.be/ns/besluit#aangebrachtNa",
"http://purl.org/dc/terms/description",
"http://data.vlaanderen.be/ns/besluit#geplandOpenbaar",
"http://data.vlaanderen.be/ns/besluit#heeftOntwerpbesluit",
"http://purl.org/dc/terms/reference",
"http://purl.org/dc/terms/title",
"http://data.vlaanderen.be/ns/besluit#Agendapunt.type"
]
}
]
}
type: type should match the resource type graphsFilter: Graphs filter is a filter for graph or something. properties: properties control the output properties.
Be carefull when specifying graphsfilter as enterig the wrong one leaves might leak sensitive data
After setting up the service, you can following these steps to test if everthing works
- Add a config with you resource
- docker-compose up -d
- Create a new resource in the frontend
- check the logs
docker-compose logs --tail=100 -f my_service
. You should see a line in the logs saying:The service has succesfully exported ${service_key}
- Check the
data/files/export
folder and see if the new resource file has been created - Wait for the other service to get triggered
- open the frontend and see if it flowed through correctly
- Add a config with you resource
- break the data using the following query
DELETE {
GRAPH ?g {
?s some:predicate ?o
} WHERE {
GRAPH ?g {
?s a some:type;
?p ?o.
}
- trigger the healing job with
curl –location –request POST ‘127.0.0.1/heal’ –header ‘Content-Type: application/json’
- Check service logs and look for following line
Resource X succesfully healed
- Check in frontend if everything is still working
Information on how to setup development. Preferable with code examples
my_service:
image: lblod/my_service:0.0.1
ports:
- 8888:80
- 9229:9229
environment:
NODE_ENV: "development"
IMPORTANT_ENV: "true"
volumes:
- ./data/files:/share
logging: *default-logging
Make sure you set port X to 8890 and check if something something. Trigger the service manually by doing X Y Z
Triggers the whole export flow
N/A
201 Created
### Usefull QueriesSELECT ?exported WHERE {
?exported a some:type;
some:status "EXPORTED"
}
SELECT ?exported ?status WHERE {
?exported a some:type;
some:status ?status
}
DELETE WHERE{
?exported a some:type;
some:status "EXPORTED"
}