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 | --db-tmp | --db-memory
Default:--db-tmp
Where Glean databases are stored. When--db-tmp
is used, Glean creates a temporary directory for storage, and deletes it on exit.--db-memory
stores databases in memory.--schema (file:FILE | dir:DIR | config:PATH | DIR)
Default:dir:$datadir/glean/schema/source
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
.index:FILE
orindexconfig:PATH
A schema index, which contains multiple versions of the schema. When using a schema index, the server uses the version of the schema requested by the client. A schema index can be produced bygen-schema --update-index
. The purpose of a schema index is so that in a production environment, when you deploy a new version of the schema, existing deployed clients and indexing jobs can continue to use the version of the schema they were compiled against.
--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-mock-writes
Allow write operations, but discard the data and don't write it to the DB.--debug-tc
Enable debugging output for the Angle typechecker.--debug-query
Enable debugging output for the Angle query compiler.