Configuring GlobalDcc
This page describes the configuration needed for developers to start. It relies on various defaults set within the files in this repository. Configuring GlobalDcc for deployment is a bit more complex, but the main ingredients and concepts are the same:
Dapr components
The dapr component for development are listed under /dev/dapr/components
. The
/dev/dapr/components/secretstore.yml
requires a local, untracked file
/dev/dapr/secrets.json
. This should contain all values that the dapr
components refer to via 'secretKeyRef'. See
Getting started for suggestions for this file.
All other components should be already set up for local development (else please correct and commit).
App settings
App settings are read from the usual config sources:
- appsettings.json
- appsettings.ENVIRONMENT.json
- environment variables
- user secrets
- command line args
It is recommended to use environment variables in
/dev/docker-compose/docker-compose.override.yml
for app settings.
When using multiple road nets, ensure that the dapr --app-id
is unique per
roadnet. The pubsub and state components can be shared across road nets (topics
and storage folder names are set by the apps and contain the road net id).
For an overview of all currently available settings, check the source code
(classes GlobalDccApiConfigOptions.cs
, GlobalDccBackendConfigOptions.cs
and
RoadNetManagerConfigOptions.cs
).
The /dev/docker-compose/docker-compose.yml
, appsettings.json
, and
appsettings.Development.json
files are in source control and define some
defaults you might wish to override with other config sources.
Data folder
Each backend expects to find a DccMulti.xml file within the folder
GlobalDccBackendConfig:DataFolderPath
on startup. This file contains dcc
specific configuration, i.p. the values
- bin_file: points to the road net data to load
- SPCMessageVersion
- RoadNetworkUpdatesFile
- GeoidUTMGeoLabel
For an explanation of these values, see the example file
/assets/default/DccMulti.xml
.
Note that /assets/
is a simple development example - it has subfolders for
three roadnet versions 'default', 'version_1', 'version_2', but the contained
DccMulti files actually point to the same roadnet data (in the parent folder).
For production, each version would use separate roadnet data.
Cache
Both api and backend require access to a shared cache database, which is
configured via Cache
.
The current cache is based on a sql database with two tables: the actual cache and a 'binary storage' table. You can choose whatever SQL server you have available (as long as it is accessible to both apps), but the standard way is using a SQL container.
SQL container
A SQL Server service is started by /dev/docker-compose/docker-compose.yml
. The
first time you use this, you need to initialize the database (see
Getting started or the
Initial table setup in this page).
Initial table setup
Build the /src/tools/DccCache.DbUp/
tool and run it, providing the connection
string as argument:
DccCache.DbUp.exe "--YOUR-CONNECTION-STRING--"