What is the global ZenML config
The information about the global settings of ZenML on a machine is kept in a folder commonly referred to as the ZenML Global Config Directory or the ZenML Config Path. The location of this folder depends on the operating system type and the current system user, but is usually located in the following locations:
The default location may be overridden by setting the
ZENML_CONFIG_PATHenvironment variable to a custom value. The current location of the Global Config Directory used on a system can be retrieved by running the following command:
python -c 'from zenml.utils.io_utils import get_global_config_directory; print(get_global_config_directory())'
Manually altering or deleting the files and folders stored under the ZenML Global Config Directory is not recommended, as this can break the internal consistency of the ZenML configuration. As an alternative, ZenML provides CLI commands that can be used to manage the information stored there:
zenml analytics- manage the analytics settings
zenml config- manage the global configuration
zenml clean- to be used only in case of emergency, to bring the ZenML configuration back to its default factory state
The first time that ZenML is run on a machine, it creates the Global Config Directory and initializes the default configuration in it, along with a default Stack:
Initializing the ZenML global configuration version to 0.13.2
Creating default workspace 'default' ...
Creating default user 'default' ...
Creating default stack for user 'default' in workspace default...
Active workspace not set. Setting it to the default.
The active stack is not set. Setting the active stack to the default workspace stack.
Using the default store for the global config.
Unable to find ZenML repository in your current working directory (/tmp/folder) or any parent directories. If you want to use an existing repository which is in a different location, set the environment variable 'ZENML_REPOSITORY_PATH'. If you want to create a new repository, run zenml init.
Running without an active repository root.
Using the default local database.
Running with active workspace: 'default' (global)
┃ ACTIVE │ STACK NAME │ SHARED │ OWNER │ ARTIFACT_STORE │ ORCHESTRATOR ┃
┃ 👉 │ default │ ❌ │ default │ default │ default ┃
The following is an example of the layout of the Global Config Directory immediately after initialization:
/home/stefan/.config/zenml <- Global Config Directory
├── config.yaml <- Global Configuration Settings
└── local_stores <- Every Stack component that stores information
| locally will have its own subdirectory here.
├── a1a0d3d0-d552-4a80-be09-67e5e29be8ee <- e.g. Local Store path for the
| `default` local Artifact Store
└── zenml.db <- SQLite database where ZenML data (stacks,
components, etc) are stored by default.
As shown above, the Global Config Directory stores the following information:
global.yamlfile stores the global configuration settings: the unique ZenML user ID, the active database configuration, the analytics related options the active Stack and active Workspace. This is an example of the
global.yamlfile contents immediately after initialization:active_workspace_name: defaultactive_stack_id: ...analytics_opt_in: truestore:database: ...url: ...username: ......user_id: d980f13e-05d1-4765-92d2-1dc7eb7addb7user_metadata: nullversion: 0.13.2
local_storesdirectory is where some "local" flavors of Stack Components, such as the
localArtifact Store, or a local MLFlow Experiment Tracker, persists data locally. Every local Stack Component will have its own subdirectory here named after the Stack Component's unique UUID. One notable example is the
localArtifact Store flavor that, when part of the active Stack, stores all the artifacts generated by Pipeline runs in the designated local directory.
zenml.dbfile is the default SQLite database where ZenML stores all information about the Stacks, Stack Components, custom Stack Component flavors etc.
In addition to the above, you may also find the following files and folders under the Global Config Directory, depending on what you do with ZenML:
zenml_examples- used as a local cache by the
zenml examplecommand, where the pulled ZenML examples are stored.
kubeflow- this is where the Kubeflow orchestrators that are part of a Stack store some of their configuration and logs.
You can access the global ZenML configuration from within Python using the
from zenml.config.global_config import GlobalConfiguration
config = GlobalConfiguration()
This can be used to manage your global settings from within Python.
To explore all possible operations that can be performed via the
GlobalConfiguration, please consult the API docs sections on GlobalConfiguration.