Share with Profiles
Centralized ZenML Stack Management with Profiles.
ZenML implicitly stores all the information about the configured Stacks, Stack Components, and Stack Component Flavors in a central location on the filesystem of the machine where it is installed. The details of how ZenML stores this persistent data, where it is located and how it is accessed can be controlled through the ZenML Profile configuration.
Profiles are global ZenML management contexts that form the foundation of ZenML's collaboration features. This guide walks you through the various ways in which Profiles allow you to manage ZenML in multi-user and multi-host use-cases of increasing complexity. Continue reading to learn more about ZenML Profiles and how they can be configured to match your organizational needs:

The default Profile

A default Profile is created automatically and set as the active Profile the first time ZenML runs on a machine:
1
$ zenml profile list
2
Creating default profile...
3
Initializing profile `default`...
4
Initializing store...
5
Registered stack component with type 'orchestrator' and name 'default'.
6
Registered stack component with type 'metadata_store' and name 'default'.
7
Registered stack component with type 'artifact_store' and name 'default'.
8
Registered stack with name 'default'.
9
Created and activated default profile.
10
Running without an active repository root.
11
Running with active profile: 'default' (global)
12
┏━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
13
┃ ACTIVE │ PROFILE NAME │ STORE TYPE │ URL │ ACTIVE STACK ┃
14
┠────────┼──────────────┼────────────┼─────────────────────────┼──────────────┨
15
┃ 👉 │ default │ local │ file:///home/stefan/.c… │ default ┃
16
┗━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
Copied!
Unless otherwise configured, this is the factory default ZenML setting in which all Stacks and associated configurations are visible and shared by all ZenML users and projects present on a machine. Configuring additional Profiles or replacing the default Profile can unlock more possibilities for collaboration in the context of the same host or even across multiple hosts.

Multi-Instance ZenML

Multiple Profiles can be created on the same machine to simulate the experience of using several independent ZenML instances completely isolated from each other. The same or even different users can then manage their projects in the context of different Profiles on the same host without having to worry about overwriting each other's configuration.
To create a new local Profile, simply run zenml profile create:
1
$ zenml profile create zenml
2
Running without an active repository root.
3
Running with active profile: 'default' (global)
4
Initializing profile `zenml`...
5
Initializing store...
6
Registered stack component with type 'orchestrator' and name 'default'.
7
Registered stack component with type 'metadata_store' and name 'default'.
8
Registered stack component with type 'artifact_store' and name 'default'.
9
Registered stack with name 'default'.
10
Profile 'zenml' successfully created.
11
12
$ zenml profile list
13
Running without an active repository root.
14
Running with active profile: 'default' (global)
15
┏━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
16
┃ ACTIVE │ PROFILE NAME │ STORE TYPE │ URL │ ACTIVE STACK ┃
17
┠────────┼──────────────┼────────────┼─────────────────────────┼──────────────┨
18
┃ 👉 │ default │ local │ file:///home/stefan/.c… │ default ┃
19
┃ │ zenml │ local │ file:///home/stefan/.c… │ default ┃
20
┗━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
Copied!
A Profile can be set as the active Profile by running zenml profile set. The active Profile determines the Stacks and Stack Components that are available for use by ZenML pipelines. New Stacks and Stack Components registered via the CLI are only added to the active Profile and are available only as long as that Profile is active.
The following example creates a new Profile named zenml, sets it as active and then shows how the default Profile is unaffected by the operations performed while the zenml Profile is active:
1
$ zenml profile set zenml
2
Running without an active repository root.
3
Running with active profile: 'default' (global)
4
Active profile changed to: 'zenml'
5
6
$ zenml profile list
7
Running without an active repository root.
8
Running with active profile: 'zenml' (global)
9
┏━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
10
┃ ACTIVE │ PROFILE NAME │ STORE TYPE │ URL │ ACTIVE STACK ┃
11
┠────────┼──────────────┼────────────┼─────────────────────────┼──────────────┨
12
┃ │ default │ local │ file:///home/stefan/.c… │ default ┃
13
┃ 👉 │ zenml │ local │ file:///home/stefan/.c… │ default ┃
14
┗━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
15
16
$ zenml stack register custom -m default -a default -o default
17
Running without an active repository root.
18
Running with active profile: 'zenml' (global)
19
Registered stack with name 'custom'.
20
Stack 'custom' successfully registered!
21
22
$ zenml stack set custom
23
Running without an active repository root.
24
Running with active profile: 'zenml' (global)
25
Active stack set to: 'custom'
26
27
$ zenml stack list
28
Running without an active repository root.
29
Running with active profile: 'zenml' (global)
30
┏━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
31
┃ ACTIVE │ STACK NAME │ ARTIFACT_STORE │ METADATA_STORE │ ORCHESTRATOR ┃
32
┠────────┼────────────┼────────────────┼────────────────┼──────────────┨
33
┃ 👉 │ custom │ default │ default │ default ┃
34
┃ │ default │ default │ default │ default ┃
35
┗━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
36
37
$ zenml profile list
38
Running without an active repository root.
39
Running with active profile: 'zenml' (global)
40
┏━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
41
┃ ACTIVE │ PROFILE NAME │ STORE TYPE │ URL │ ACTIVE STACK ┃
42
┠────────┼──────────────┼────────────┼─────────────────────────┼──────────────┨
43
┃ │ default │ local │ file:///home/stefan/.c… │ default ┃
44
┃ 👉 │ zenml │ local │ file:///home/stefan/.c… │ custom ┃
45
┗━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
46
47
$ zenml profile set default
48
Running without an active repository root.
49
Running with active profile: 'zenml' (global)
50
Active profile changed to: 'default'
51
52
$ zenml stack list
53
Running without an active repository root.
54
Running with active profile: 'default' (global)
55
┏━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
56
┃ ACTIVE │ STACK NAME │ ARTIFACT_STORE │ METADATA_STORE │ ORCHESTRATOR ┃
57
┠────────┼────────────┼────────────────┼────────────────┼──────────────┨
58
┃ 👉 │ default │ default │ default │ default ┃
59
┗━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
Copied!
From the above example, you may have also noticed that the active Profile and the active Stack are global settings that affect all other user sessions open on the same machine. It is however possible to set the active Profile and active Stack individually for each user session or project. Keep reading to learn more.

Session Level Settings with Environment Variables

The global active Profile and global active Stack can be overridden by using the environment variables ZENML_ACTIVATED_PROFILE and ZENML_ACTIVATED_STACK, as shown in the following example:
1
$ zenml profile list
2
Running without an active repository root.
3
Running with active profile: 'default' (global)
4
┏━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
5
┃ ACTIVE │ PROFILE NAME │ STORE TYPE │ URL │ ACTIVE STACK ┃
6
┠────────┼──────────────┼────────────┼─────────────────────────┼──────────────┨
7
┃ 👉 │ default │ local │ file:///home/stefan/.c… │ default ┃
8
┃ │ zenml │ local │ file:///home/stefan/.c… │ custom ┃
9
┗━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
10
11
$ export ZENML_ACTIVATED_PROFILE=zenml
12
$ export ZENML_ACTIVATED_STACK=default
13
14
$ zenml profile list
15
Running without an active repository root.
16
Running with active profile: 'zenml' (global)
17
┏━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
18
┃ ACTIVE │ PROFILE NAME │ STORE TYPE │ URL │ ACTIVE STACK ┃
19
┠────────┼──────────────┼────────────┼─────────────────────────┼──────────────┨
20
┃ │ default │ local │ file:///home/stefan/.c… │ default ┃
21
┃ 👉 │ zenml │ local │ file:///home/stefan/.c… │ default ┃
22
┗━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
23
24
$ zenml stack list
25
Running without an active repository root.
26
Running with active profile: 'zenml' (global)
27
┏━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
28
┃ ACTIVE │ STACK NAME │ ARTIFACT_STORE │ METADATA_STORE │ ORCHESTRATOR ┃
29
┠────────┼────────────┼────────────────┼────────────────┼──────────────┨
30
┃ 👉 │ default │ default │ default │ default ┃
31
┃ │ custom │ default │ default │ default ┃
32
┗━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
Copied!

Project Level Settings with ZenML Repositories

When running inside an initialized ZenML Repository, the active Profile and active Stack can also be configured locally, independently of the global settings, just for that particular Repository. The following example shows how the active Profile and active Stack can be configured locally for a project without impacting the global settings:
1
/tmp/zenml$ zenml profile list
2
Running without an active repository root.
3
Running with active profile: 'default' (global)
4
┏━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
5
┃ ACTIVE │ PROFILE NAME │ STORE TYPE │ URL │ ACTIVE STACK ┃
6
┠────────┼──────────────┼────────────┼─────────────────────────┼──────────────┨
7
┃ 👉 │ default │ local │ file:///home/stefan/.c… │ default ┃
8
┃ │ zenml │ local │ file:///home/stefan/.c… │ custom ┃
9
┗━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
10
11
/tmp/zenml$ zenml init
12
ZenML repository initialized at /tmp/zenml.
13
The local active profile was initialized to 'default' and the local active stack
14
to 'default'. This local configuration will only take effect when you're running
15
ZenML from the initialized repository root, or from a subdirectory. For more
16
information on profile and stack configuration, please visit https://docs.zenml.io.
17
18
/tmp/zenml$ zenml profile list
19
Running with active profile: 'default' (local)
20
┏━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
21
┃ ACTIVE │ PROFILE NAME │ STORE TYPE │ URL │ ACTIVE STACK ┃
22
┠────────┼──────────────┼────────────┼─────────────────────────┼──────────────┨
23
┃ 👉 │ default │ local │ file:///home/stefan/.c… │ default ┃
24
┃ │ zenml │ local │ file:///home/stefan/.c… │ custom ┃
25
┗━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
26
27
/tmp/zenml$ zenml profile set zenml
28
Running with active profile: 'default' (local)
29
Active profile changed to: 'zenml'
30
31
/tmp/zenml$ zenml stack list
32
Running with active profile: 'zenml' (local)
33
┏━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
34
┃ ACTIVE │ STACK NAME │ ARTIFACT_STORE │ METADATA_STORE │ ORCHESTRATOR ┃
35
┠────────┼────────────┼────────────────┼────────────────┼──────────────┨
36
┃ │ default │ default │ default │ default ┃
37
┃ 👉 │ custom │ default │ default │ default ┃
38
┗━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
39
40
/tmp/zenml$ zenml stack set default
41
Running with active profile: 'zenml' (local)
42
Active stack set to: 'default'
43
44
/tmp/zenml$ zenml stack list
45
Running with active profile: 'zenml' (local)
46
┏━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
47
┃ ACTIVE │ STACK NAME │ ARTIFACT_STORE │ METADATA_STORE │ ORCHESTRATOR ┃
48
┠────────┼────────────┼────────────────┼────────────────┼──────────────┨
49
┃ 👉 │ default │ default │ default │ default ┃
50
┃ │ custom │ default │ default │ default ┃
51
┗━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
52
53
/tmp/zenml$ cd ..
54
/tmp$ zenml profile list
55
Running without an active repository root.
56
Running with active profile: 'default' (global)
57
┏━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
58
┃ ACTIVE │ PROFILE NAME │ STORE TYPE │ URL │ ACTIVE STACK ┃
59
┠────────┼──────────────┼────────────┼─────────────────────────┼──────────────┨
60
┃ 👉 │ default │ local │ file:///home/stefan/.c… │ default ┃
61
┃ │ zenml │ local │ file:///home/stefan/.c… │ custom ┃
62
┗━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
Copied!
Note that the Stacks and Stack Components are still stored globally, even when running from inside a ZenML Repository. It is only the active Profile and active Stack settings that can be configured locally.

Shared ZenML Stores

The ZenML Store (or ZenStore) is a low-level concept used to represent the particular driver used to store and retrieve the data that is managed through a ZenML Profile. The ZenStore concept is not directly represented in the CLI commands, but it is reflected in the Profile configuration and can be manipulated by passing advanced parameters to the zenml profile create CLI command. The particular ZenStore driver type and configuration used for a Profile can be viewed by bringing up the detailed Profile description (note the store type and URL):
1
$ zenml profile describe
2
Running without an active repository root.
3
Running with active profile: 'default' (global)
4
'default' Profile Configuration (ACTIVE)
5
┏━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
6
┃ PROPERTY │ VALUE ┃
7
┠──────────────┼─────────────────────────────────────────────┨
8
┃ NAME │ default ┃
9
┠──────────────┼─────────────────────────────────────────────┨
10
┃ STORE_URL │ file:///home/zenml/.config/profiles/default ┃
11
┠──────────────┼─────────────────────────────────────────────┨
12
┃ STORE_TYPE │ local ┃
13
┠──────────────┼─────────────────────────────────────────────┨
14
┃ ACTIVE_STACK │ default ┃
15
┠──────────────┼─────────────────────────────────────────────┨
16
┃ ACTIVE_USER │ default ┃
17
┗━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Copied!
Different ZenStore types can be used to implement different deployment use-cases with regards to where the ZenML managed data is stored and how and where it can be accessed:
  • the local ZenStore stores Profile data in YAML files on your local filesystem. This is the default ZenStore type and is suitable for local development and testing. Local Profiles can also be shared between multiple users even hosts by using some form of source version control or shared filesystem.
  • the sql ZenStore driver is based on SQLAlchemy and can interface with any SQL database service, local or remote, to store the Profile data in a SQL database. The SQL driver is an easy way to extend ZenML to accommodate multiple users working from multiple hosts.
  • the rest ZenStore is a special type of store that connects via a REST API to a remote ZenServer instance. This use-case is applicable to larger teams and organizations that need to deploy ZenML as a dedicated service providing centralized management of Stacks, Pipelines and other ZenML concepts. Please consult the ZenServer documentation dedicated to this deployment model.

Local ZenML Store

By default, newly created Profiles use the local ZenStore driver that stores the Profile data on the local filesystem, in the global configuration directory, as a collection of YAML files.
The YAML representation makes it suitable to commit Stack configurations and all other information stored in the Profile into a version control system such as Git, where they can be versioned and shared with other users.
To use a custom location for a Profile, point the ZenStore URL to a directory on your local filesystem. For example:
1
$ zenml profile create git_store --url /tmp/zenml/.zenprofile
2
Running with active profile: 'default' (local)
3
Initializing profile git...
4
Registering default stack...
5
Registered stack component with type 'orchestrator' and name 'default'.
6
Registered stack component with type 'metadata_store' and name 'default'.
7
Registered stack component with type 'artifact_store' and name 'default'.
8
Registered stack with name 'default'.
9
Profile 'git_store' successfully created.
10
11
$ zenml profile set git_store
12
Running with active profile: 'default' (local)
13
Active profile changed to: 'git_store'
14
15
$ zenml profile describe
16
Running with active profile: 'git_store' (local)
17
'git_store' Profile Configuration (ACTIVE)
18
┏━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━┓
19
┃ PROPERTY │ VALUE ┃
20
┠──────────────┼────────────────────────┨
21
┃ NAME │ git_store ┃
22
┠──────────────┼────────────────────────┨
23
┃ STORE_URL │ /tmp/zenml/.zenprofile ┃
24
┠──────────────┼────────────────────────┨
25
┃ STORE_TYPE │ local ┃
26
┠──────────────┼────────────────────────┨
27
┃ ACTIVE_STACK │ default ┃
28
┠──────────────┼────────────────────────┨
29
┃ ACTIVE_USER │ default ┃
30
┗━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━┛
Copied!
Assuming the /tmp/zenml location used above is part of a local git clone that is regularly synchronized with a remote server, replicating the same Profile on another machine is straightforward: if the URL points to a location where a Profile already exists, the Profile information is simply loaded from the existing YAML files:
1
[email protected]_machine:/tmp$ git clone <git-repo-location> zenml
2
[email protected]_machine:/tmp$ cd zenml
3
[email protected]_machine:/tmp/zenml$
4
5
[email protected]_machine:/tmp$ zenml profile create git-clone --url ./.zenprofile
6
Running with active profile: 'git' (local)
7
Initializing profile git-clone...
8
Profile 'git-clone' successfully created.
Copied!
As alternatives to version control, a Profile could be shared by using a distributed filesystem (e.g. NFS) or by regularly syncing the folder with a remote central repository using some other means. However, a better solution of sharing Profiles across multiple machines is be to use the SQL ZenStore driver to store the Profile data in a SQL database, or to manage ZenML data through a centralized ZenServer instance.

SQL ZenML Store

The SQL ZenStore type uses SQLAlchemy to store Profile data in a local SQLite database file, on a remote MySQL server or any SQL compatible database system for that matter. The URL value passed during the Profile creation controls the type, location and other parameters for the SQL database connection. To explore the full range of configuration options, consult the SQLAlchemy documentation.

Local SQLite Profile

The simplest form of SQL-based Profile uses a SQLite file located in the global configuration directory:
1
$ zenml profile create sqlite_profile -t sql
2
Running without an active repository root.
3
Running with active profile: 'default' (global)
4
Initializing profile sqlite_profile...
5
Registering default stack...
6
Registered stack with name 'default'.
7
Profile 'sqlite_profile' successfully created.
8
9
$ zenml profile set sqlite_profile
10
Running without an active repository root.
11
Running with active profile: 'zenml' (global)
12
Active profile changed to: 'sqlite_profile'
13
14
$ zenml profile describe
15
Running without an active repository root.
16
Running with active profile: 'sqlite_profile' (global)
17
'sqlite_profile' Profile Configuration (ACTIVE)
18
┏━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
19
┃ PROPERTY │ VALUE ┃
20
┠──────────────┼───────────────────────────────────────────────────────────────────────┨
21
┃ NAME │ sqlite_profile ┃
22
┠──────────────┼───────────────────────────────────────────────────────────────────────┨
23
┃ STORE_URL │ sqlite:////home/stefan/.config/zenml/profiles/sqlite_profile/zenml.db ┃
24
┠──────────────┼───────────────────────────────────────────────────────────────────────┨
25
┃ STORE_TYPE │ sql ┃
26
┠──────────────┼───────────────────────────────────────────────────────────────────────┨
27
┃ ACTIVE_STACK │ default ┃
28
┠──────────────┼───────────────────────────────────────────────────────────────────────┨
29
┃ ACTIVE_USER │ default ┃
30
┗━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Copied!
The location of the SQLite database can be customized during profile creation:
1
$ zenml profile create custom_sqlite -t sql --url=sqlite:////tmp/zenml/zenml_profile.db
2
Running without an active repository root.
3
Running with active profile: 'sqlite_profile' (global)
4
Initializing profile custom_sqlite...
5
Registering default stack...
6
Registered stack with name 'default'.
7
Profile 'custom_sqlite' successfully created.
8
9
$ zenml profile set custom_sqlite
10
Running without an active repository root.
11
Running with active profile: 'sqlite_profile' (global)
12
Active profile changed to: 'custom_sqlite'
13
14
$ zenml profile describe
15
Running without an active repository root.
16
Running with active profile: 'custom_sqlite' (global)
17
'custom_sqlite' Profile Configuration (ACTIVE)
18
┏━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
19
┃ PROPERTY │ VALUE ┃
20
┠──────────────┼───────────────────────────────────────┨
21
┃ NAME │ custom_sqlite ┃
22
┠──────────────┼───────────────────────────────────────┨
23
┃ STORE_URL │ sqlite:////tmp/zenml/zenml_profile.db ┃
24
┠──────────────┼───────────────────────────────────────┨
25
┃ STORE_TYPE │ sql ┃
26
┠──────────────┼───────────────────────────────────────┨
27
┃ ACTIVE_STACK │ default ┃
28
┠──────────────┼───────────────────────────────────────┨
29
┃ ACTIVE_USER │ default ┃
30
┗━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Copied!

MySQL Profile

To connect the ZenML Profile to an existing MySQL database, some additional configuration is required on the MySQL server to create a user and database:
1
mysql -u root
2
GRANT ALL PRIVILEGES ON *.* TO 'zenml'@'%' IDENTIFIED BY 'password';
3
4
mysql -u zenml -p
5
CREATE DATABASE zenml;
Copied!
Then, on the client machine, some additional packages need to be installed. Check the SQLAlchemy documentation for the various MySQL drivers that are supported and how to install and use them. The following is an example of using the mysqlclient driver for SQLAlchemy on an Ubuntu OS. Depending on your choice of driver and host OS, your experience may vary:
1
sudo apt install libmysqlclient-dev
2
pip install mysqlclient
Copied!
Finally, the command to create a new Profile would look like this:
1
$ zenml profile create --store-type sql --url "mysql://zenml:[email protected]/zenml" mysql_profile
Copied!

Migrating Stacks from Legacy Repositories to ZenML Profiles

Traditionally, Stack configurations were stored locally in the Repository root directory - i.e. the local .zen folder that is created by the zenml init command. The ZenML 0.7.0 release moves Stacks outside of Repository root folders into the global configuration directory. The Profile concept was also introduced to replace the Repository as the concept that manages and stores the Stack configurations.
To ensure a seamless transition from the traditional Repository root storage to Profiles, ZenML automatically detects and migrates the Stacks from an already initialized Repository root to a newly created Profile. This happens automatically the first time ZenML is launched from within a legacy initialized Repository, as demonstrated below:
1
/tmp/zenml$ zenml profile list
2
A legacy ZenML repository with locally configured stacks was found at
3
'/tmp/zenml/.zen'.
4
Beginning with ZenML 0.7.0, stacks are no longer stored inside the ZenML
5
repository root, they are stored globally using the newly introduced concept of
6
Profiles.
7
8
The stacks configured in this repository will be automatically migrated to a
9
newly created profile: 'legacy-repository-b8133fe0'.
10
11
If you no longer need to use the stacks configured in this repository, please
12
delete the profile using the following command:
13
14
'zenml profile delete legacy-repository-b8133fe0'
15
16
More information about Profiles can be found at https://docs.zenml.io.
17
This warning will not be shown again for this Repository.
18
Initializing profile legacy-repository-b8133fe0...
19
Running with active profile: 'legacy-repository-b8133fe0' (local)
20
┏━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
21
┃ ACTIVE │ PROFILE NAME │ STORE TYPE │ URL │ ACTIVE STACK ┃
22
┠────────┼────────────────────┼────────────┼───────────────────┼──────────────┨
23
┃ │ default │ local │ file:///home/ste… │ default ┃
24
┃ │ zenml │ local │ file:///home/ste… │ custom ┃
25
┃ 👉 │ legacy-repository… │ local │ file:///tmp/zenm… │ local_stack ┃
26
┗━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
27
28
/tmp/zenml$ zenml profile describe
29
Running with active profile: 'legacy-repository-b8133fe0' (local)
30
'legacy-repository-b8133fe0' Profile
31
Configuration (ACTIVE)
32
┏━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
33
┃ PROPERTY │ VALUE ┃
34
┠──────────────┼────────────────────────────┨
35
┃ NAME │ legacy-repository-b8133fe0 ┃
36
┠──────────────┼────────────────────────────┨
37
┃ STORE_URL │ file:///tmp/zenml/.zen ┃
38
┠──────────────┼────────────────────────────┨
39
┃ STORE_TYPE │ local ┃
40
┠──────────────┼────────────────────────────┨
41
┃ ACTIVE_STACK │ local_stack ┃
42
┠──────────────┼────────────────────────────┨
43
┃ ACTIVE_USER │ default ┃
44
┗━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
45
46
/tmp/zenml$ zenml stack list
47
Running with active profile: 'legacy-repository-b8133fe0' (local)
48
┏━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━┓
49
┃ ACTIVE │ STACK NAME │ ARTIFACT_STORE │ CONTAINER_REGI… │ METADATA_STORE │ ORCHESTRATOR ┃
50
┠────────┼─────────────────┼─────────────────┼─────────────────┼──────────────────┼─────────────────┨
51
┃ │ local_kubeflow… │ local_artifact… │ local_registry │ local_metadata_… │ kubeflow_orche… ┃
52
┃ 👉 │ local_stack │ local_artifact… │ │ local_metadata_… │ local_orchestr… ┃
53
┗━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┛
Copied!