HUB
Sign inSign up

ghga/nos

Sponsored OSS

By German Human Genome-Phenome Archive

•Updated about 11 hours ago

The Notification Orchestration Service controls the creation of notification events.

Image
0

500K+

ghga/nos repository overview

⁠Notification Orchestration Service

The Notification Orchestration Service controls the creation of notification events.

The service ships as the container image ghga/nos and the Helm chart nos⁠.

⁠Description

The Notification Orchestration Service (NOS) uses data harvested from events published by various services to form Notification events, which are subsequently consumed by the Notification Service (NS) for dissemination.

⁠Usage

The executable nos takes one of these commands, and fails without one:

  • consume-events runs an event consumer listening to the configured topics
  • migrate-db runs the database migrations

Running a service⁠ shows how to start, build and deploy it.

⁠Configuration

The settings take the prefix nos: the environment variable NOS_HOST sets host, and the YAML file is .nos.yaml. example_config.yaml⁠ holds a complete set to adapt, and Configuration⁠ says where the service looks for them.

⁠Parameters

The service requires the following configuration parameters:

  • mongo_dsn (string, format: multi-host-uri, required): MongoDB connection string. Might include credentials. For more information see: https://naiveskill.com/mongodb-connection-string/⁠. Length must be at least 1.

    Examples:

    "mongodb://localhost:27017"
    
  • db_name (string, required): Name of the database located on the MongoDB server.

    Examples:

    "my-database"
    
  • mongo_timeout: Timeout in seconds for API calls to MongoDB. The timeout applies to all steps needed to complete the operation, including server selection, connection checkout, serialization, and server-side execution. When the timeout expires, PyMongo raises a timeout exception. If set to None, the operation will not time out (default MongoDB behavior). Default: null.

    • Any of
      • integer: Exclusive minimum: 0.
      • null

    Examples:

    300
    
    600
    
    null
    
  • db_version_collection (string, required): The name of the collection containing DB version information for this service.

    Examples:

    "ifrsDbVersions"
    
  • migration_wait_sec (integer, required): The number of seconds to wait before checking the DB version again.

    Examples:

    5
    
    30
    
    180
    
  • migration_max_wait_sec: The maximum number of seconds to wait for migrations to complete before raising an error. Default: null.

    • Any of
      • integer
      • null

    Examples:

    null
    
    300
    
    600
    
    3600
    
  • notification_topic (string, required): Name of the topic used for notification events.

    Examples:

    "notifications"
    
  • email_notification_type (string, required): The type used for email notification events.

    Examples:

    "email_notification"
    
  • sms_notification_type (string, required): The type used for SMS notification events.

    Examples:

    "sms_notification"
    
  • access_request_topic (string, required): Name of the event topic containing access request events.

    Examples:

    "access-requests"
    
  • user_topic (string): The name of the topic containing user events. Default: "users".

  • auth_topic (string, required): The name of the topic containing auth-related events.

    Examples:

    "auth-events"
    
  • second_factor_recreated_type (string, required): The event type for recreation of the second factor for authentication.

    Examples:

    "second_factor_recreated"
    
  • iva_state_changed_topic (string, required): The name of the topic containing IVA events.

    Examples:

    "ivas"
    
  • iva_state_changed_type (string, required): The type to use for IVA state changed events.

    Examples:

    "iva_state_changed"
    
  • iva_send_code_type (string, required): The type to use for IVA send code events.

    Examples:

    "iva_send_code"
    
  • service_name (string): The Notification Orchestration Service controls the creation of notification events. Default: "nos".

  • service_instance_id (string, required): A string that uniquely identifies this instance across all instances of this service. This is included in log messages.

    Examples:

    "germany-bw-instance-001"
    
  • kafka_servers (array, required): A list of connection strings to connect to Kafka bootstrap servers.

    • Items (string)

    Examples:

    [
        "localhost:9092"
    ]
    
  • kafka_security_protocol (string): Protocol used to communicate with brokers. Valid values are: PLAINTEXT, SSL. Must be one of: "PLAINTEXT" or "SSL". Default: "PLAINTEXT".

  • kafka_ssl_cafile (string): Certificate Authority file path containing certificates used to sign broker certificates. If a CA is not specified, the default system CA will be used if found by OpenSSL. Default: "".

  • kafka_ssl_certfile (string): Optional filename of client certificate, as well as any CA certificates needed to establish the certificate's authenticity. Default: "".

  • kafka_ssl_keyfile (string): Optional filename containing the client private key. Default: "".

  • kafka_ssl_password (string, format: password, write-only): Optional password to be used for the client private key. Default: "".

  • generate_correlation_id (boolean): A flag, which, if False, will result in an error when trying to publish an event without a valid correlation ID set for the context. If True, a new correlation ID will be generated and used in the event header. Default: true.

    Examples:

    true
    
    false
    
  • kafka_max_message_size (integer): The largest message size that can be transmitted, in bytes, before compression. Only services that have a need to send/receive larger messages should set this. When used alongside compression, this value can be set to something greater than the broker's message.max.bytes field, which effectively concerns the compressed message size. Exclusive minimum: 0. Default: 1048576.

    Examples:

    1048576
    
    16777216
    
  • kafka_compression_type: The compression type used for messages. Valid values are: None, gzip, snappy, lz4, and zstd. If None, no compression is applied. This setting is only relevant for the producer and has no effect on the consumer. If set to a value, the producer will compress messages before sending them to the Kafka broker. If unsure, zstd provides a good balance between speed and compression ratio. Default: null.

    • Any of
      • string: Must be one of: "gzip", "snappy", "lz4", or "zstd".
      • null

    Examples:

    null
    
    "gzip"
    
    "snappy"
    
    "lz4"
    
    "zstd"
    
  • kafka_max_retries (integer): The maximum number of times to immediately retry consuming an event upon failure. Works independently of the dead letter queue. Minimum: 0. Default: 0.

    Examples:

    0
    
    1
    
    2
    
    3
    
    5
    
  • kafka_enable_dlq (boolean): A flag to toggle the dead letter queue. If set to False, the service will crash upon exhausting retries instead of publishing events to the DLQ. If set to True, the service will publish events to the DLQ topic after exhausting all retries. Default: false.

    Examples:

    true
    
    false
    
  • kafka_dlq_topic (string): The name of the topic used to resolve error-causing events. Default: "dlq".

    Examples:

    "dlq"
    
  • kafka_retry_backoff (integer): The number of seconds to wait before retrying a failed event. The backoff time is doubled for each retry attempt. Minimum: 0. Default: 0.

    Examples:

    0
    
    1
    
    2
    
    3
    
    5
    
  • log_level (string): The minimum log level to capture. Must be one of: "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", or "TRACE". Default: "INFO".

  • log_format: If set, will replace JSON formatting with the specified string format. If not set, has no effect. In addition to the standard attributes, the following can also be specified: timestamp, service, instance, level, correlation_id, and details. Default: null.

    • Any of
      • string
      • null

    Examples:

    "%(timestamp)s - %(service)s - %(level)s - %(message)s"
    
    "%(asctime)s - Severity: %(levelno)s - %(msg)s"
    
  • log_traceback (boolean): Whether to include exception tracebacks in log messages. Default: true.

  • enable_opentelemetry (boolean): If set to true, this will run necessary setup code.If set to false, no setup code is run, which leaves tracing disabled. Default: false.

  • otel_trace_sampling_rate (number): Determines which proportion of spans should be sampled. A value of 1.0 means all and is equivalent to the previous behaviour. Setting this to 0 will result in no spans being sampled, but this does not automatically set enable_opentelemetry to False. Minimum: 0. Maximum: 1. Default: 1.0.

  • enable_otel_metrics (boolean): Also export metrics via OTLP. Requires enable_opentelemetry and a collector with a metrics pipeline. Default: false.

  • central_data_stewardship_email (string, required): The email address of the central data steward.

  • helpdesk_email (string, required): The email address of the GHGA Helpdesk.

  • portal_url (string, format: uri): The URL of the GHGA data portal. Length must be between 1 and 2083 (inclusive). Default: "https://data.ghga.de/".

⁠Architecture and Design

This is a Python-based service following the Triple Hexagonal Architecture pattern. It uses protocol/provider pairs and dependency injection mechanisms provided by the hexkit⁠ library.

⁠License

This repository is free to use and modify according to the Apache 2.0 License⁠.

Tag summary
Recent tags
Content type
Image
Digest
sha256:84a362e09…
Size
46.8 MB
Last updated
about 11 hours ago
docker pull ghga/nos:16.1.0
This week's pulls