Once you have implemented your buildtest configuration, you can query the configuration details using buildtest config
command. Shown below is the command usage.
buildtest config --help
buildtest config --help
Note
buildtest cg
is an alias for buildtest config
command.
First thing you should do once you implement your configuration file is to make sure your configuration is valid with the schema. This can be achieved by running buildtest config validate
. When you invoke this command, buildtest will load the configuration and attempt to validate the file with schema settings.schema.json. If validation is successful you will get the following message:
buildtest config validate
Note
If you defined a user setting (~/.buildtest/config.yml
) buildtest will validate this file instead of default one.
If there is an error during validation, the output from jsonschema.exceptions.ValidationError will be displayed in terminal. For example the error below indicates that moduletool
property was expecting one of the values [environment-modules
, lmod
, N/A
] but it received a value of none
:
Invalid buildtest configuration
$ buildtest config validate
Traceback (most recent call last):
File "/Users/siddiq90/Documents/buildtest/bin/buildtest", line 17, in <module>
buildtest.main.main()
File "/Users/siddiq90/Documents/buildtest/buildtest/main.py", line 39, in main
buildtest_configuration = check_settings(settings_file, retrieve_settings=True)
File "/Users/siddiq90/Documents/buildtest/buildtest/config.py", line 41, in check_settings
validate(instance=user_schema, schema=config_schema)
File "/Users/siddiq90/.local/share/virtualenvs/buildtest-1gHVG2Pd/lib/python3.7/site-packages/jsonschema/validators.py", line 934, in validate
raise error
jsonschema.exceptions.ValidationError: 'none' is not one of ['environment-modules', 'lmod', 'N/A']
Failed validating 'enum' in schema['properties']['moduletool']:
{'description': 'Specify modules tool used for interacting with '
'``module`` command. ',
'enum': ['environment-modules', 'lmod', 'N/A'],
'type': 'string'}
On instance['moduletool']:
'none'
If you want to view buildtest configuration you can run buildtest config view
which will print content of buildtest configuration.
buildtest config view
buildtest config view
The --theme
option can be used to change the color theme of the output. The default theme is monokai
and list of available themes can be retrieved with tab completion for option buildtest config view --theme
.
If you want to check path to buildtest configuration file you can run buildtest config path
which will print path of buildtest configuration file.
buildtest config path
The buildtest config edit
command is used to open buildtest configuration file in your preferred editor. buildtest will use the environment EDITOR to get the preffered editor; however, one can override the environment variable via command line option buildtest --editor
.
You can use the command buildtest config executors list
to view executors from buildtest configuration file. Shown below is the command usage
buildtest config executors list --help
buildtest config executors list --help
You can run buildtest config executors list
without any options and it will report a list of named executors that you would reference in buildspec using the executor
property.
buildtest config executors list
If you want to see the executor details, you may want to use --json
or --yaml
option which will show the executor settings in YAML or JSON format. Shown below is an example output
buildtest config executors list --yaml
buildtest config executors list --yaml
buildtest config executors list --json
buildtest config executors list --json
Note
The command options for buildtest config executors list
are mutually exclusive, so if you specify multiple options you will get the following error.
buildtest config executors list --json --yaml
The buildtest config executors remove
command will remove an executor from buildtest configuration file. The positional arguments are the name of the executor you want to remove. Tab completion is available to retrieve all available executors (buildtest config executors list --all
).
Shown below we see tab completion on available executors that can be removed.
buildtest config executors remove
generic.local.bash generic.local.csh generic.local.sh generic.local.zsh
Let's try listing all executors and remove generic.local.zsh
executor, you will notice after deletion, the configuration file is updated and the executor is no longer present.
Removing executor 'generic.local.zsh'
buildtest --config $BUILDTEST_CI_DIR/config.yml config executors list --all
buildtest --config $BUILDTEST_CI_DIR/config.yml config executors remove generic.local.zsh
Upon deletion, buildtest will validate the configuration before writing the changes back to disk, to ensure the configuration is valid. Shown below we demonstrate an example where we attempt to remove all executors from the configuration file. Buildtest expects there is atleast 1 executor definition for local executor.
buildtest config executors remove generic.local.bash generic.local.sh generic.local.csh generic.local.zsh
buildtest config executors remove generic.local.bash generic.local.sh generic.local.csh generic.local.zsh
Your buildtest configuration may compose of one or more systems since you can define multiple systems in a single configuration file to run buildtest for different HPC clusters. You can use buildtest config systems
to report all system details defined in your configuration file. In this example below we should the generic
system. If you have multiple entries, you will see one entry per system record.
buildtest config systems