Running the Tools
Configuration filesβ
Glean tools use some configuration files. Mostly these are optional, if you don't provide the file then a set of defaults will be assumed.
Config files are represented as JSON-encoded Thrift values. Each configuration file has a corresponding Thrift definition file, which we'll link to in the docs below.
The location of a config file is specified by a command line
option, e.g. Glean clients have a --client-config
option:
--client-config (file:PATH | config:PATH)
the alternatives are:
- Omit the flag: default values will be used.
--client-config file:PATH
means the config is read, once, fromPATH
.
--client-config config:PATH
means the config is read fromDIR/PATH
whereDIR
defaults to$HOME/.config/glean
but can be changed with the--config-dir DIR
flag. Additionally, changes in the file are picked up without restarting the tool. (this is particularly useful for the server)
The idea is that if you're running a fleet of Glean servers, you can
have a set of configuration files that you sync to all the hosts in
your fleet using whatever mechanism you want, and set --config-dir
to point to the location of the files. If this isn't sufficient, then
you can implement your own ConfigProvider
instance to support
whatever method you need for accessing config files.
Common optionsβ
All the Glean tools (glean
, glean-server
) accept
the following options.
--config-dir DIR
The base directory where configuration files are read from.
Connecting to a remote serverβ
--service HOST:PORT
Default: taken from--client-config
Specifies the Glean server to connect to.
--client-config (file:PATH | config:PATH)
Default:config:client
or use default values if missing
Thrift file: client-config.thrift
The location of the client configuration file, which specifies the default Glean server to connect to, amongst other things.
Using local databasesβ
--db-root DIR
The path where Glean databases are stored.--schema (file:FILE | dir:DIR | config:PATH | DIR)
Default:config:schema
The location of the schema definition. This can either be:dir:DIR
or justDIR
All the files with the extension.angle
underDIR
(or in subdirectories) will be read.file:FILE
orconfig:PATH
A single file, which can be created from the source files inDIR
by runninggen-schema --dir DIR --source FILE
If you are running a fleet of Glean servers, you would normally sync schema changes across the fleet by putting the schema inconfig:schema
.
--schema-version VERSION
--server-config (file:PATH | config:PATH)
Default:config:server
Thrift file: server-config.thrift--tier TIER
Equivalent to--server-config config:server/TIER
Can be handy when you have fleet-wide configuration files but you want certain servers to have different configs.--db-read-only
Disable writing to databases. This is useful if you have servers that only serve queries, and should not be creating or writing databases.
--enable-logging
Enable logging of all operations. (Note that there is currently no logging backend implemented for the open-source build of Glean, so this doesn't do anything yet).
Testing optionsβ
--db-schema-override
The current schema will override the schema in the database. Normally you don't want this, because the schema stored in the database is the one that was active at the time when the DB was created, so it is likely to be a correct description of the data in the database.--db-mock-writes
Allow write operations, but discard the data and don't write it to the DB.