Flows on the host
A flow with container: null (or an empty container: key) in a usage_scenario.yml → runs its commands directly on the host system instead of inside a container.
name: Host Execution
author: Jane Doe
description: Runs flow commands directly on the host instead of inside a container
flow:
- name: Host Echo
container: null
commands:
- type: console
command: echo "hello from the host"
note: Running echo on the host
- name: Compile on host
container: null
commands:
- type: console
command: make -j4
shell: bashIf you only want to measure a single command on the host you do not need a usage_scenario.yml at all. See Shell mode →.
Commands in host flows are not sandboxed. They run directly on the measurement machine with the permissions of the user that runs GMT. GMT adds a warning to every run that contains host flows, because the measurement data is not directly comparable to fully containerized runs.
Rules
- Host flows only support commands of type
console. - The user that runs the measurement needs the
measurement.orchestrators.hostcapability. Otherwise the run aborts with aPermissionErrorright after the usage scenario is parsed. On a fresh installation only the DEFAULT user (id 1) has this capability. See User Management →. - Without
shellthe command is split like a command line and executed directly without a shell. - With
shellthe command is executed in that shell with the strict shell options →. You can change them withshell-options. - Notes and logs of host flows are shown under the name
[HOST]. servicesis optional. If theusage_scenario.ymlhas no services, GMT disables all metric providers that need containers (the ones ending in_container, for examplecpu_utilization_cgroup_container) and adds a warning for each of them.
Host flows and container flows can be mixed in the same scenario.
Shell options on the host
On the host you can also use shells that do not follow the POSIX -c convention. The strict shell options → then depend on the shell.
powershellandpwshhave no such switches. GMT prepends$ErrorActionPreference = 'Stop'andSet-StrictMode -Version Latestas statements to the command instead. There is no equivalent forpipefail. If you setshell-optionsfor PowerShell, a string is prepended as one statement and a list as one statement per entry.cmdhas no way to express these options. GMT sets none and aborts the run if you configure non-emptyshell-options.- Every other shell is treated as a POSIX shell and gets
-o errexit -o nounset -o pipefaillike inside a container.