sync-api
The sync-api service is used in the Bigpicture project.
Service Description
The sync service facilitates replication of data and metadata between the nodes in the consortium.
When enabled the service will perform the following tasks:
- Upon receiving a POST request with JSON data to the
/datasetroute. - Parse the JSON blob and validate it against the
file-syncschema. - Build and send messages to start ingestion of files.
- Build and send messages to assign stableIDs to files.
- Build and send messages to map files to a dataset.
Configuration
There are a number of options that can be set for the sync service.
These settings can be set by mounting a yaml-file at /config.yaml with settings.
ex.
log:
level: "debug"
format: "json"
They may also be set using environment variables like:
export LOG_LEVEL="debug"
export LOG_FORMAT="json"
Service settings
SYNC_API_PASSWORD: password for the API userSYNC_API_USER: User that will be allowed to send POST requests to the API
RabbitMQ broker settings
These settings control how sync connects to the RabbitMQ message broker.
BROKER_HOST: hostname of the rabbitmq serverBROKER_PORT: rabbitmq broker port (commonly5671with TLS and5672without)BROKER_EXCHANGE: exchange to send messages toBROKER_USER: username to connect to rabbitmqBROKER_PASSWORD: password to connect to rabbitmqBROKER_PREFETCHCOUNT: Number of messages to pull from the message server at the time (default to 2)
The default routing keys for sending ingestion, accession and mapping messages can be overridden by setting the following values:
SYNC_API_ACCESSIONROUTINGSYNC_API_INGESTROUTINGSYNC_API_MAPPINGROUTING
Logging settings
LOG_FORMATcan be set to “json” to get logs in json format. All other values result in text loggingLOG_LEVELcan be set to one of the following, in increasing order of severity:tracedebuginfowarn(orwarning)errorfatalpanic