YAML

The NOS-T Tools library requires a Yet Another Markup Language (YAML) configuration file. This file adopts a format similar to AsyncAPI to define the connection configuration for the RabbitMQ broker and Keycloak authentication servers.

Configuration Overview

The YAML files is composed of the following sections:

  1. Info: Contains metadata about the YAML configuration file.

  2. Servers: Contains the connection configuration for the RabbitMQ broker and Keycloak authentication servers.

  3. Execution: Contains the execution configuration for the NOS-T Tools library.

  4. Channels: Contains the channel configuration for the NOS-T Tools library.

Each section is explained in detail below.

Info Section

Contains metadata about the configuration file. This does not influence the operation of the NOS-T Tools library, it is merely for documentation and informational purposes.

Example:

info:
  title: Novel Observing Strategies Testbed (NOS-T) YAML Configuration
  version: '1.0.0'
  description: Version-controlled configuration file for Snow Observing Systems (SOS) project

Servers Section

Defines connection parameters for the RabbitMQ message broker and Keycloak authentication server.

RabbitMQ Configuration

pydantic model RabbitMQConfig

Show JSON schema
{
   "title": "RabbitMQConfig",
   "type": "object",
   "properties": {
      "keycloak_authentication": {
         "default": false,
         "description": "Keycloak authentication for RabbitMQ.",
         "title": "Keycloak Authentication",
         "type": "boolean"
      },
      "tls": {
         "default": false,
         "description": "RabbitMQ TLS/SSL.",
         "title": "Tls",
         "type": "boolean"
      },
      "reconnect_delay": {
         "default": 10,
         "description": "Reconnection delay, in seconds.",
         "title": "Reconnect Delay",
         "type": "integer"
      },
      "queue_max_size": {
         "default": 5000,
         "description": "Maximum size of the RabbitMQ queue.",
         "title": "Queue Max Size",
         "type": "integer"
      },
      "content_type": {
         "default": null,
         "description": "RabbitMQ MIME content type (application/json, text/plain, etc.).",
         "title": "Content Type",
         "type": "string"
      },
      "content_encoding": {
         "default": null,
         "description": "RabbitMQ MIME content encoding (gzip, deflate, etc.).",
         "title": "Content Encoding",
         "type": "string"
      },
      "headers": {
         "additionalProperties": {
            "type": "string"
         },
         "default": null,
         "description": "RabbitMQ message headers (key-value pairs).",
         "title": "Headers",
         "type": "object"
      },
      "delivery_mode": {
         "default": null,
         "description": "RabbitMQ delivery mode (1: non-persistent, 2: durable).",
         "title": "Delivery Mode",
         "type": "integer"
      },
      "priority": {
         "default": null,
         "description": "RabbitMQ message priority (0-255).",
         "title": "Priority",
         "type": "integer"
      },
      "correlation_id": {
         "default": null,
         "description": "RabbitMQ correlation ID for message tracking.",
         "title": "Correlation Id",
         "type": "string"
      },
      "reply_to": {
         "default": null,
         "description": "RabbitMQ reply-to queue for response messages.",
         "title": "Reply To",
         "type": "string"
      },
      "message_expiration": {
         "default": null,
         "description": "RabbitMQ expiration, in milliseconds.",
         "title": "Message Expiration",
         "type": "string"
      },
      "message_id": {
         "default": null,
         "description": "RabbitMQ message ID for tracking.",
         "title": "Message Id",
         "type": "string"
      },
      "timestamp": {
         "default": null,
         "description": "RabbitMQ message timestamp.",
         "format": "date-time",
         "title": "Timestamp",
         "type": "string"
      },
      "type": {
         "default": null,
         "description": "RabbitMQ message type (e.g., 'text', 'json').",
         "title": "Type",
         "type": "string"
      },
      "user_id": {
         "default": null,
         "description": "RabbitMQ user ID for authentication.",
         "title": "User Id",
         "type": "string"
      },
      "app_id": {
         "default": null,
         "description": "RabbitMQ application ID for tracking.",
         "title": "App Id",
         "type": "string"
      },
      "cluster_id": {
         "default": null,
         "description": "RabbitMQ cluster ID for tracking.",
         "title": "Cluster Id",
         "type": "string"
      },
      "host": {
         "default": "localhost",
         "description": "RabbitMQ host.",
         "title": "Host",
         "type": "string"
      },
      "port": {
         "default": 5672,
         "description": "RabbitMQ port.",
         "title": "Port",
         "type": "integer"
      },
      "virtual_host": {
         "default": "/",
         "description": "RabbitMQ virtual host.",
         "title": "Virtual Host",
         "type": "string"
      },
      "channel_max": {
         "default": 65535,
         "description": "RabbitMQ maximum number of channels per connection.",
         "title": "Channel Max",
         "type": "integer"
      },
      "frame_max": {
         "default": 131072,
         "description": "RabbitMQ maximum frame size in bytes.",
         "title": "Frame Max",
         "type": "integer"
      },
      "heartbeat": {
         "default": null,
         "description": "RabbitMQ heartbeat interval, in seconds.",
         "title": "Heartbeat",
         "type": "integer"
      },
      "connection_attempts": {
         "default": 1,
         "description": "RabbitMQ connection attempts before giving up.",
         "title": "Connection Attempts",
         "type": "integer"
      },
      "retry_delay": {
         "default": 2,
         "description": "RabbitMQ retry delay, in seconds.",
         "title": "Retry Delay",
         "type": "integer"
      },
      "socket_timeout": {
         "default": 10,
         "description": "RabbitMQ socket timeout, in seconds.",
         "title": "Socket Timeout",
         "type": "integer"
      },
      "stack_timeout": {
         "default": 15,
         "description": "RabbitMQ stack timeout, in seconds.",
         "title": "Stack Timeout",
         "type": "integer"
      },
      "locale": {
         "default": "en_US",
         "description": "RabbitMQ locale.",
         "title": "Locale",
         "type": "string"
      },
      "blocked_connection_timeout": {
         "default": null,
         "description": "Timeout for blocked connections.",
         "title": "Blocked Connection Timeout",
         "type": "integer"
      }
   }
}

Fields:
  • app_id (str)

  • blocked_connection_timeout (int)

  • channel_max (int)

  • cluster_id (str)

  • connection_attempts (int)

  • content_encoding (str)

  • content_type (str)

  • correlation_id (str)

  • delivery_mode (int)

  • frame_max (int)

  • headers (Dict[str, str])

  • heartbeat (int)

  • host (str)

  • keycloak_authentication (bool)

  • locale (str)

  • message_expiration (str)

  • message_id (str)

  • port (int)

  • priority (int)

  • queue_max_size (int)

  • reconnect_delay (int)

  • reply_to (str)

  • retry_delay (int)

  • socket_timeout (int)

  • stack_timeout (int)

  • timestamp (datetime.datetime)

  • tls (bool)

  • type (str)

  • user_id (str)

  • virtual_host (str)

field app_id: str = None

RabbitMQ application ID for tracking.

field blocked_connection_timeout: int = None

Timeout for blocked connections.

field channel_max: int = 65535

RabbitMQ maximum number of channels per connection.

field cluster_id: str = None

RabbitMQ cluster ID for tracking.

field connection_attempts: int = 1

RabbitMQ connection attempts before giving up.

field content_encoding: str = None

RabbitMQ MIME content encoding (gzip, deflate, etc.).

field content_type: str = None

RabbitMQ MIME content type (application/json, text/plain, etc.).

field correlation_id: str = None

RabbitMQ correlation ID for message tracking.

field delivery_mode: int = None

RabbitMQ delivery mode (1: non-persistent, 2: durable).

field frame_max: int = 131072

RabbitMQ maximum frame size in bytes.

field headers: Dict[str, str] = None

RabbitMQ message headers (key-value pairs).

field heartbeat: int = None

RabbitMQ heartbeat interval, in seconds.

field host: str = 'localhost'

RabbitMQ host.

field keycloak_authentication: bool = False

Keycloak authentication for RabbitMQ.

field locale: str = 'en_US'

RabbitMQ locale.

field message_expiration: str = None

RabbitMQ expiration, in milliseconds.

field message_id: str = None

RabbitMQ message ID for tracking.

field port: int = 5672

RabbitMQ port.

field priority: int = None

RabbitMQ message priority (0-255).

field queue_max_size: int = 5000

Maximum size of the RabbitMQ queue.

field reconnect_delay: int = 10

Reconnection delay, in seconds.

field reply_to: str = None

RabbitMQ reply-to queue for response messages.

field retry_delay: int = 2

RabbitMQ retry delay, in seconds.

field socket_timeout: int = 10

RabbitMQ socket timeout, in seconds.

field stack_timeout: int = 15

RabbitMQ stack timeout, in seconds.

field timestamp: datetime = None

RabbitMQ message timestamp.

field tls: bool = False

RabbitMQ TLS/SSL.

field type: str = None

RabbitMQ message type (e.g., ‘text’, ‘json’).

field user_id: str = None

RabbitMQ user ID for authentication.

field virtual_host: str = '/'

RabbitMQ virtual host.

Example:

servers:
  rabbitmq:
    keycloak_authentication: False
    host: "localhost"
    port: 5672
    tls: False
    virtual_host: "/"
    message_expiration: "60000"
    delivery_mode: 2
    content_type: "text/plain"
    heartbeat: 30
    connection_attempts: 3
    retry_delay: 5

Keycloak Configuration

pydantic model KeycloakConfig

Show JSON schema
{
   "title": "KeycloakConfig",
   "type": "object",
   "properties": {
      "host": {
         "default": "localhost",
         "description": "Keycloak host.",
         "title": "Host",
         "type": "string"
      },
      "port": {
         "default": 8080,
         "description": "Keycloak port.",
         "title": "Port",
         "type": "integer"
      },
      "realm": {
         "default": "master",
         "description": "Keycloak realm.",
         "title": "Realm",
         "type": "string"
      },
      "tls": {
         "default": false,
         "description": "Keycloak TLS/SSL.",
         "title": "Tls",
         "type": "boolean"
      },
      "token_refresh_interval": {
         "default": 60,
         "description": "Keycloak token refresh interval, in seconds.",
         "title": "Token Refresh Interval",
         "type": "integer"
      }
   }
}

Fields:
  • host (str)

  • port (int)

  • realm (str)

  • tls (bool)

  • token_refresh_interval (int)

field host: str = 'localhost'

Keycloak host.

field port: int = 8080

Keycloak port.

field realm: str = 'master'

Keycloak realm.

field tls: bool = False

Keycloak TLS/SSL.

field token_refresh_interval: int = 60

Keycloak token refresh interval, in seconds.

Example:

  keycloak:
    host: "nost.smce.nasa.gov"
    port: 8443
    tls: True
    token_refresh_interval: 10
    realm: "NOS-T"

Execution Section

Defines parameters controlling simulation execution and time management.

General Configuration

Example:

execution:
  general:
    prefix: sos

Manager Configuration

Example:

  manager:
    sim_start_time: "2019-03-01T23:59:59+00:00"
    sim_stop_time: "2019-03-10T23:59:59+00:00"
    start_time:
    time_step: "0:00:01"
    time_scale_factor: 288
    time_scale_updates: []
    time_status_step: "0:00:01" # 1 second * time scale factor
    time_status_init: "2019-03-01T23:59:59+00:00"
    command_lead: "0:00:05"
    required_apps:
      - manager
      - planner
      - appender
      - simulator
    init_retry_delay_s: 5
    init_max_retry: 5
    set_offset: True
    shut_down_when_terminated: False

Managed Application Configuration

Example:

  managed_application:
    time_scale_factor: 288
    time_step: "0:00:01" # 1 second * time scale factor 
    set_offset: True
    time_status_step: "0:00:10" # 10 seconds * time scale factor
    time_status_init: "2019-03-01T00:00:00+00:00"
    shut_down_when_terminated: False
    manager_app_name: "manager"

Channels Section

Defines the messaging channels used for communication between components. This entire section is optional. If a user wants to define each channel and queue for organizational purposes, they can do so here. Otherwise, the NOS-T Tools library will create default channels and queues.

Channels follow this structure:

channels:
  <component>:
    <message_type>:
      address: '<prefix>.<component>.<message_type>'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: <prefix>
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0

Example:

channels:
  satellite: 
    location:
      address: 'sos.constellation.location'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    status.mode:
      address: 'sos.constellation.status.mode'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    status.ready:
      address: 'sos.constellation.status.ready'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    status.time:
      address: 'sos.constellation.status.time'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
  manager:
    init:
      address: 'sos.manager.init'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    start:
      address: 'sos.manager.start'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    stop:
      address: 'sos.manager.stop'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0             
    status.mode:
      address: 'sos.manager.status.mode'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    status.time:
      address: 'sos.manager.status.time'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0

In this example YAML file, the configuration includes predefined channels for:

  1. Satellite components (location, status.mode, status.ready, status.time)

  2. Manager components (init, start, stop, status.mode, status.time)

Each channel specifies:

  • An address pattern used as the routing key

  • AMQP binding configuration including exchange properties

Using the Configuration File

Applications using the NOS-T Tools library specify the path to the YAML configuration file when initializing. The library reads this file to establish connections to the RabbitMQ broker and Keycloak authentication server and to configure the execution parameters. Refer to Creating a NOS-T Publisher-Consumer Example for an example of how the configuration file is used within the NOS-T Tools library.

Complete Configuration Example

Below is a complete example of a YAML configuration file that can be used with NOS-T Tools:

info:
  title: Novel Observing Strategies Testbed (NOS-T) YAML Configuration
  version: '1.0.0'
  description: Version-controlled configuration file for Snow Observing Systems (SOS) project
servers:
  rabbitmq:
    keycloak_authentication: False
    host: "localhost"
    port: 5672
    tls: False
    virtual_host: "/"
    message_expiration: "60000"
    delivery_mode: 2
    content_type: "text/plain"
    heartbeat: 30
    connection_attempts: 3
    retry_delay: 5
  keycloak:
    host: "nost.smce.nasa.gov"
    port: 8443
    tls: True
    token_refresh_interval: 10
    realm: "NOS-T"
execution:
  general:
    prefix: sos
  manager:
    sim_start_time: "2019-03-01T23:59:59+00:00"
    sim_stop_time: "2019-03-10T23:59:59+00:00"
    start_time:
    time_step: "0:00:01"
    time_scale_factor: 288
    time_scale_updates: []
    time_status_step: "0:00:01" # 1 second * time scale factor
    time_status_init: "2019-03-01T23:59:59+00:00"
    command_lead: "0:00:05"
    required_apps:
      - manager
      - planner
      - appender
      - simulator
    init_retry_delay_s: 5
    init_max_retry: 5
    set_offset: True
    shut_down_when_terminated: False
  managed_application:
    time_scale_factor: 288
    time_step: "0:00:01" # 1 second * time scale factor 
    set_offset: True
    time_status_step: "0:00:10" # 10 seconds * time scale factor
    time_status_init: "2019-03-01T00:00:00+00:00"
    shut_down_when_terminated: False
    manager_app_name: "manager"
channels:
  satellite: 
    location:
      address: 'sos.constellation.location'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    status.mode:
      address: 'sos.constellation.status.mode'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    status.ready:
      address: 'sos.constellation.status.ready'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    status.time:
      address: 'sos.constellation.status.time'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
  manager:
    init:
      address: 'sos.manager.init'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    start:
      address: 'sos.manager.start'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    stop:
      address: 'sos.manager.stop'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0             
    status.mode:
      address: 'sos.manager.status.mode'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0
    status.time:
      address: 'sos.manager.status.time'
      bindings:
        amqp:
          is: routingKey
          exchange:
            name: sos
            type: topic
            durable: false
            autoDelete: true
            vhost: /
          bindingVersion: 0.3.0