/Historian

Primary LanguageC#MIT LicenseMIT

Time Series Historian

Build Status

Cloning

This repository has sub modules, clone it with:

$ git clone --recursive <repository url>

If you've already cloned it, you can get the submodules by doing the following:

$ git submodule update --init --recursive

Building

All the build things are from a submodule. To build, run one of the following:

Windows:

$ Build\build.cmd

Linux / macOS

$ Build\build.sh

Getting started

This solution is built on top of Azure IoT Edge, and to be able to work locally and run it locally, you will need the development environment - read more about that here. It mentions the use of the iotedgedev tool.

VSCode

If you are using VSCode or similar text editor, just open up the folder from the root. This solution uses a sub-module (as described above). It comes with a few things that makes development a little bit easier, a set of VSCode tasks as described here.

In addition to this there is a couple of Debug launch settings set up as well to enable debugging directly.

Visual Studio 201x

Open up the .sln file at the root of the project.

Deploying

Module

In your deployment.json file, you will need to add the module. For more details on modules in IoT Edge, go here.

"modules": {
    "Dolittle.TimeSeries.Historian": {
    "version": "1.0",
    "type": "docker",
    "status": "running",
    "restartPolicy": "always",
    "settings": {
        "image": "dolittle/timeseries-historian",
        "createOptions": {
        "HostConfig": {}
    }
}

State

The module depends has persistent state and it is assuming that this is in the data folder relative to where the binary is running. Since this is running in a containerized environment, the state is not persistent between runs. To get this state persistent, you'll need to configure the deployment to mount a folder on the host into the data folder.

In your deployment.json file where you added the module, inside the HostConfig property, you should add the volume binding.

"Binds": [
    "/etc/dolittle.timeseries/Historian:/app/data"
]

This should result in something like:

"modules": {
    "Dolittle.TimeSeries.Historian": {
    "version": "1.0",
    "type": "docker",
    "status": "running",
    "restartPolicy": "always",
    "settings": {
        "image": "dolittle/timeseries-historian",
        "createOptions": {
        "HostConfig": {
            "Binds": [
                "/etc/dolittle.timeseries/Historian:/app/data"
            ]
        }
    }
}