Using Flock with Bedrock

Bedrock is Mochi’s service bootstrapping framework. It provides a unified way to configure and deploy Flock providers using JSON configuration files.

Bedrock configuration examples are provided throughout all the tutorials in this section, hence this page only provides a couple of examples for reference.

Prerequisites

Install Flock with Bedrock support:

spack install mochi-flock +bedrock

Basic configuration

A minimal Bedrock configuration for Flock with the static backend:

{
    "libraries": [
        "libflock-bedrock-module.so"
    ],
    "providers": [
        {
            "type": "flock",
            "name": "my_flock_provider",
            "provider_id": 42,
            "config": {
                "bootstrap": "self",
                "group": {
                    "type": "static",
                    "config": {}
                },
                "file": "mygroup.flock"
            }
        }
    ]
}

Configuration with the centralized backend:

{
    "libraries": [
        "libflock-bedrock-module.so"
    ],
    "providers": [
        {
            "type": "flock",
            "name": "my_flock_provider",
            "provider_id": 42,
            "config": {
                "bootstrap": "self",
                "group": {
                    "type": "centralized",
                    "config": {
                        "ping_timeout_ms": 2000,
                        "ping_interval_ms": 1000,
                        "ping_max_num_timeouts": 3
                    }
                },
                "file": "mygroup.flock"
            }
        }
    ]
}

Configuration with the SWIM backend:

{
    "libraries": [
        "libflock-bedrock-module.so"
    ],
    "providers": [
        {
            "type": "flock",
            "name": "my_flock_provider",
            "provider_id": 42,
            "config": {
                "bootstrap": "self",
                "group": {
                    "type": "swim",
                    "config": {
                        "protocol_period_ms": 1000,
                        "ping_timeout_ms": 200,
                        "ping_req_timeout_ms": 500,
                        "ping_req_members": 3,
                        "suspicion_timeout_ms": 5000
                    }
                },
                "file": "mygroup.flock"
            }
        }
    ]
}