Discovery

Resources described in consumes section are immediately available for consumption in services. Orhestrator populates a directory structure, which contains discovery details for cloud provided services like SQL, storage bucket, queues and other services.

Configuration is saved in both YAML and JSON formats under /etc/berlioz/consumes top level directory. This path can also be identified by BERLIOZ_CONSUMES_PATH environment variable.

/etc/berlioz/consumes/
    all.json
    all.yaml
    database/
        db1.json
        db1.yaml
        db2.json
        db2.yaml
    queue/
        queue1.json
        queue1.yaml

For each entry in consumes section of the service a YAML and a JSON config files would be created under database/ or queue/ directories. For convenience purposes all.json and all.yaml files contain contents of all configs under database/ or queue/ directories.

Contents

Configuration file contain name of cloud resources. It also contains config object which is meant to be passed to the underlying SDK for connection.

SQL Example

{
    "id": "database://addr-main-book",
    "kind": "database",
    "class": "sql",
    "subClass": "sql",
    "config": {
        "host": "10.10.10.10"
    },
    "name": "prod-addr-uswest1c-main-book-wfrxwfyawn"
}

Storage Bucket Example

{
    "id": "database://addr-main-bucket",
    "kind": "database",
    "class": "storage",
    "subClass": "storage",
    "name": "12345-prod-addr-uswest1c-main-bucket-wfrxwfyawn"
}

Local Deployment

During active development berlioz CLI tool mocks cloud environemnt and injects projectId and credentials into configuration files. The config objects should be passed to underlying client SDKs.

This is achieved internally using berlioz local build-run command.

{
    "id": "database://addr-main-bucket",
    "kind": "database",
    "class": "storage",
    "subClass": "storage",
    "config": {
        "projectId": "my-sample-project-1",
        "credentials": {
            "some": "stuff"
        }
    },
    "name": "12345-prod-addr-uswest1c-main-bucket-wfrxwfyawn"
}