zenml-nightly 0.68.0.dev20241027__py3-none-any.whl → 0.68.1.dev20241101__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- README.md +17 -11
- RELEASE_NOTES.md +9 -0
- zenml/VERSION +1 -1
- zenml/__init__.py +1 -1
- zenml/analytics/context.py +16 -1
- zenml/analytics/utils.py +18 -7
- zenml/artifacts/utils.py +40 -216
- zenml/cli/__init__.py +63 -90
- zenml/cli/base.py +3 -3
- zenml/cli/login.py +951 -0
- zenml/cli/server.py +462 -353
- zenml/cli/service_accounts.py +4 -4
- zenml/cli/stack.py +77 -2
- zenml/cli/stack_components.py +5 -16
- zenml/cli/user_management.py +0 -12
- zenml/cli/utils.py +24 -77
- zenml/client.py +46 -14
- zenml/config/compiler.py +1 -0
- zenml/config/global_config.py +9 -0
- zenml/config/pipeline_configurations.py +2 -1
- zenml/config/pipeline_run_configuration.py +2 -1
- zenml/constants.py +3 -9
- zenml/enums.py +1 -1
- zenml/exceptions.py +11 -0
- zenml/integrations/github/code_repositories/github_code_repository.py +1 -1
- zenml/login/__init__.py +16 -0
- zenml/login/credentials.py +346 -0
- zenml/login/credentials_store.py +603 -0
- zenml/login/pro/__init__.py +16 -0
- zenml/login/pro/client.py +496 -0
- zenml/login/pro/constants.py +34 -0
- zenml/login/pro/models.py +25 -0
- zenml/login/pro/organization/__init__.py +14 -0
- zenml/login/pro/organization/client.py +79 -0
- zenml/login/pro/organization/models.py +32 -0
- zenml/login/pro/tenant/__init__.py +14 -0
- zenml/login/pro/tenant/client.py +92 -0
- zenml/login/pro/tenant/models.py +174 -0
- zenml/login/pro/utils.py +121 -0
- zenml/{cli → login}/web_login.py +64 -28
- zenml/materializers/base_materializer.py +43 -9
- zenml/materializers/built_in_materializer.py +1 -1
- zenml/metadata/metadata_types.py +49 -0
- zenml/model/model.py +0 -38
- zenml/models/__init__.py +3 -0
- zenml/models/v2/base/base.py +12 -8
- zenml/models/v2/base/filter.py +9 -0
- zenml/models/v2/core/artifact_version.py +49 -10
- zenml/models/v2/core/component.py +54 -19
- zenml/models/v2/core/flavor.py +13 -13
- zenml/models/v2/core/model.py +3 -1
- zenml/models/v2/core/model_version.py +3 -5
- zenml/models/v2/core/model_version_artifact.py +3 -1
- zenml/models/v2/core/model_version_pipeline_run.py +3 -1
- zenml/models/v2/core/pipeline.py +3 -1
- zenml/models/v2/core/pipeline_run.py +23 -1
- zenml/models/v2/core/run_template.py +3 -1
- zenml/models/v2/core/stack.py +7 -3
- zenml/models/v2/core/step_run.py +43 -2
- zenml/models/v2/misc/auth_models.py +11 -2
- zenml/models/v2/misc/server_models.py +2 -0
- zenml/orchestrators/base_orchestrator.py +8 -4
- zenml/orchestrators/step_launcher.py +1 -0
- zenml/orchestrators/step_run_utils.py +10 -2
- zenml/orchestrators/step_runner.py +67 -55
- zenml/orchestrators/utils.py +45 -22
- zenml/pipelines/pipeline_decorator.py +5 -0
- zenml/pipelines/pipeline_definition.py +206 -160
- zenml/pipelines/run_utils.py +11 -10
- zenml/services/local/local_daemon_entrypoint.py +4 -4
- zenml/services/service.py +2 -2
- zenml/stack/stack.py +2 -6
- zenml/stack/stack_component.py +2 -7
- zenml/stack/utils.py +26 -14
- zenml/steps/base_step.py +8 -2
- zenml/steps/step_context.py +0 -3
- zenml/steps/step_invocation.py +14 -5
- zenml/steps/utils.py +1 -0
- zenml/utils/materializer_utils.py +1 -1
- zenml/utils/requirements_utils.py +71 -0
- zenml/utils/singleton.py +15 -3
- zenml/utils/source_utils.py +39 -2
- zenml/utils/visualization_utils.py +1 -1
- zenml/zen_server/auth.py +44 -39
- zenml/zen_server/deploy/__init__.py +7 -7
- zenml/zen_server/deploy/base_provider.py +46 -73
- zenml/zen_server/deploy/{local → daemon}/__init__.py +3 -3
- zenml/zen_server/deploy/{local/local_provider.py → daemon/daemon_provider.py} +44 -63
- zenml/zen_server/deploy/{local/local_zen_server.py → daemon/daemon_zen_server.py} +50 -22
- zenml/zen_server/deploy/deployer.py +90 -171
- zenml/zen_server/deploy/deployment.py +20 -12
- zenml/zen_server/deploy/docker/docker_provider.py +9 -28
- zenml/zen_server/deploy/docker/docker_zen_server.py +19 -3
- zenml/zen_server/deploy/helm/Chart.yaml +1 -1
- zenml/zen_server/deploy/helm/README.md +2 -2
- zenml/zen_server/exceptions.py +11 -0
- zenml/zen_server/jwt.py +9 -9
- zenml/zen_server/routers/auth_endpoints.py +30 -8
- zenml/zen_server/routers/stack_components_endpoints.py +1 -1
- zenml/zen_server/routers/workspaces_endpoints.py +1 -1
- zenml/zen_server/template_execution/runner_entrypoint_configuration.py +7 -4
- zenml/zen_server/template_execution/utils.py +6 -61
- zenml/zen_server/utils.py +64 -36
- zenml/zen_stores/base_zen_store.py +4 -49
- zenml/zen_stores/migrations/versions/0.68.1_release.py +23 -0
- zenml/zen_stores/migrations/versions/c22561cbb3a9_add_artifact_unique_constraints.py +86 -0
- zenml/zen_stores/rest_zen_store.py +325 -147
- zenml/zen_stores/schemas/api_key_schemas.py +9 -4
- zenml/zen_stores/schemas/artifact_schemas.py +21 -2
- zenml/zen_stores/schemas/artifact_visualization_schemas.py +1 -1
- zenml/zen_stores/schemas/component_schemas.py +49 -6
- zenml/zen_stores/schemas/device_schemas.py +9 -4
- zenml/zen_stores/schemas/flavor_schemas.py +1 -1
- zenml/zen_stores/schemas/model_schemas.py +1 -1
- zenml/zen_stores/schemas/service_schemas.py +1 -1
- zenml/zen_stores/schemas/step_run_schemas.py +1 -1
- zenml/zen_stores/schemas/trigger_schemas.py +1 -1
- zenml/zen_stores/sql_zen_store.py +393 -140
- zenml/zen_stores/template_utils.py +3 -1
- {zenml_nightly-0.68.0.dev20241027.dist-info → zenml_nightly-0.68.1.dev20241101.dist-info}/METADATA +18 -12
- {zenml_nightly-0.68.0.dev20241027.dist-info → zenml_nightly-0.68.1.dev20241101.dist-info}/RECORD +124 -107
- zenml/api.py +0 -60
- {zenml_nightly-0.68.0.dev20241027.dist-info → zenml_nightly-0.68.1.dev20241101.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.68.0.dev20241027.dist-info → zenml_nightly-0.68.1.dev20241101.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.68.0.dev20241027.dist-info → zenml_nightly-0.68.1.dev20241101.dist-info}/entry_points.txt +0 -0
zenml/cli/__init__.py
CHANGED
@@ -1525,6 +1525,13 @@ If you wish to rename your stack, use the following command:
|
|
1525
1525
|
zenml stack rename STACK_NAME NEW_STACK_NAME
|
1526
1526
|
```
|
1527
1527
|
|
1528
|
+
If you would like to export the requirements of your stack, you can
|
1529
|
+
use the command:
|
1530
|
+
|
1531
|
+
```bash
|
1532
|
+
zenml stack export-requirements <STACK_NAME>
|
1533
|
+
```
|
1534
|
+
|
1528
1535
|
If you want to copy a stack component, run the following command:
|
1529
1536
|
```bash
|
1530
1537
|
zenml STACK_COMPONENT copy SOURCE_COMPONENT_NAME TARGET_COMPONENT_NAME
|
@@ -1803,7 +1810,7 @@ other things. You can start the ZenML dashboard locally by running the following
|
|
1803
1810
|
command:
|
1804
1811
|
|
1805
1812
|
```bash
|
1806
|
-
zenml
|
1813
|
+
zenml login --local
|
1807
1814
|
```
|
1808
1815
|
|
1809
1816
|
This will start the dashboard on your local machine where you can access it at
|
@@ -1819,18 +1826,18 @@ zenml show
|
|
1819
1826
|
If you want to stop the dashboard, simply run:
|
1820
1827
|
|
1821
1828
|
```bash
|
1822
|
-
zenml
|
1829
|
+
zenml logout --local
|
1823
1830
|
```
|
1824
1831
|
|
1825
|
-
The `zenml
|
1826
|
-
customize how the ZenML dashboard is running.
|
1832
|
+
The `zenml login --local` command has a few additional options that you can use
|
1833
|
+
to customize how the ZenML dashboard is running.
|
1827
1834
|
|
1828
1835
|
By default, the dashboard is started as a background process. On some operating
|
1829
1836
|
systems, this capability is not available. In this case, you can use the
|
1830
1837
|
`--blocking` flag to start the dashboard in the foreground:
|
1831
1838
|
|
1832
1839
|
```bash
|
1833
|
-
zenml
|
1840
|
+
zenml login --local --blocking
|
1834
1841
|
```
|
1835
1842
|
|
1836
1843
|
This will block the terminal until you stop the dashboard with CTRL-C.
|
@@ -1840,7 +1847,7 @@ run the dashboard in a Docker container. This is useful if you don't want to
|
|
1840
1847
|
install all the Zenml server dependencies on your machine. To do so, simply run:
|
1841
1848
|
|
1842
1849
|
```bash
|
1843
|
-
zenml
|
1850
|
+
zenml login --local --docker
|
1844
1851
|
```
|
1845
1852
|
|
1846
1853
|
The TCP port and the host address that the dashboard uses to listen for
|
@@ -1853,7 +1860,7 @@ For example, to start the dashboard on port 9000 and have it listen
|
|
1853
1860
|
on all locally available interfaces on your machine, run:
|
1854
1861
|
|
1855
1862
|
```bash
|
1856
|
-
zenml
|
1863
|
+
zenml login --local --port 9000 --ip-address 0.0.0.0
|
1857
1864
|
```
|
1858
1865
|
|
1859
1866
|
Note that the above 0.0.0.0 IP address also exposes your ZenML dashboard
|
@@ -1862,68 +1869,58 @@ explicit IP address that is configured on one of your local interfaces, such as
|
|
1862
1869
|
the Docker bridge interface, which usually has the IP address `172.17.0.1`:
|
1863
1870
|
|
1864
1871
|
```bash
|
1865
|
-
zenml
|
1866
|
-
```
|
1867
|
-
|
1868
|
-
Connecting to a ZenML Server
|
1869
|
-
----------------------------
|
1870
|
-
|
1871
|
-
The ZenML client can be [configured to connect to a remote database or ZenML
|
1872
|
-
server](https://docs.zenml.io/how-to/connecting-to-zenml)
|
1873
|
-
with the `zenml connect` command.
|
1874
|
-
|
1875
|
-
To connect to a ZenML server, you can either pass the configuration as command
|
1876
|
-
line arguments or as a YAML file:
|
1877
|
-
|
1878
|
-
```bash
|
1879
|
-
zenml connect --url=https://zenml.example.com:8080 --no-verify-ssl
|
1872
|
+
zenml login --local --port 9000 --ip-address 172.17.0.1
|
1880
1873
|
```
|
1881
1874
|
|
1882
|
-
|
1875
|
+
If you would like to take a look at the logs for the local ZenML server:
|
1883
1876
|
|
1884
1877
|
```bash
|
1885
|
-
zenml
|
1878
|
+
zenml logs
|
1886
1879
|
```
|
1887
1880
|
|
1888
|
-
|
1889
|
-
|
1881
|
+
Connecting to a ZenML Server
|
1882
|
+
----------------------------
|
1890
1883
|
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
<Either a boolean, in which case it controls whether the
|
1895
|
-
server's TLS certificate is verified, or a string, in which case it
|
1896
|
-
must be a path to a CA certificate bundle to use or the CA bundle
|
1897
|
-
value itself>
|
1898
|
-
```
|
1884
|
+
The ZenML client can be [configured to connect to a local ZenML server, a remote
|
1885
|
+
database or a remote ZenML server](https://docs.zenml.io/how-to/connecting-to-zenml)
|
1886
|
+
with the `zenml login` command.
|
1899
1887
|
|
1900
|
-
|
1901
|
-
|
1888
|
+
To connect or re-connect to any ZenML server, if you know its URL, you can
|
1889
|
+
simply run:
|
1902
1890
|
|
1903
1891
|
```bash
|
1904
|
-
zenml
|
1892
|
+
zenml login https://zenml.example.com:8080
|
1905
1893
|
```
|
1906
1894
|
|
1895
|
+
Running `zenml login` without any arguments will check if your current ZenML
|
1896
|
+
server session is still valid. If it is not, you will be prompted to log in
|
1897
|
+
again. This is useful if you quickly want to refresh your CLI session when
|
1898
|
+
the current session expires.
|
1899
|
+
|
1907
1900
|
You can open the ZenML dashboard of your currently connected ZenML server using
|
1908
1901
|
the following command:
|
1909
1902
|
|
1910
1903
|
```bash
|
1911
|
-
zenml show
|
1904
|
+
zenml server show
|
1912
1905
|
```
|
1913
1906
|
|
1914
|
-
|
1907
|
+
Note that if you have set your `AUTO_OPEN_DASHBOARD` environment variable to
|
1908
|
+
`false` then this will not open the dashboard until you set it back to `true`.
|
1909
|
+
|
1910
|
+
The CLI can be authenticated to multiple ZenML servers at the same time,
|
1911
|
+
even though it can only be connected to one server at a time. You can list
|
1912
|
+
all the ZenML servers that the client is currently authenticated to by
|
1913
|
+
running:
|
1915
1914
|
|
1916
1915
|
```bash
|
1917
|
-
zenml
|
1916
|
+
zenml server list
|
1918
1917
|
```
|
1919
1918
|
|
1920
|
-
Note that if you have set your `AUTO_OPEN_DASHBOARD` environment variable to
|
1921
|
-
`false` then this will not open the dashboard until you set it back to `true`.
|
1922
1919
|
To disconnect from the current ZenML server and revert to using the local
|
1923
1920
|
default database, use the following command:
|
1924
1921
|
|
1925
1922
|
```bash
|
1926
|
-
zenml
|
1923
|
+
zenml logout
|
1927
1924
|
```
|
1928
1925
|
|
1929
1926
|
You can inspect the current ZenML configuration at any given time using the
|
@@ -1936,53 +1933,28 @@ zenml status
|
|
1936
1933
|
Example output:
|
1937
1934
|
|
1938
1935
|
```
|
1939
|
-
zenml status
|
1940
|
-
|
1941
|
-
Connected to a ZenML server:
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
1950
|
-
|
1951
|
-
|
1952
|
-
┃ STATUS_MESSAGE │ Docker container is running ┃
|
1953
|
-
┠────────────────┼─────────────────────────────┨
|
1954
|
-
┃ CONNECTED │ ┃
|
1955
|
-
┗━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
1956
|
-
```
|
1957
|
-
|
1958
|
-
The ``zenml connect`` command can also be used to configure your client with
|
1959
|
-
more advanced options, such as connecting directly to a local or remote SQL
|
1960
|
-
database. In this case, the `--raw-config` flag must be passed to instruct the
|
1961
|
-
CLI to not validate or fill in the missing configuration fields. For example,
|
1962
|
-
to connect to a remote MySQL database, run:
|
1963
|
-
|
1964
|
-
```bash
|
1965
|
-
zenml connect --raw-config --config=/path/to/mysql_config.yaml
|
1966
|
-
```
|
1967
|
-
|
1968
|
-
with a YAML configuration file that looks like this:
|
1969
|
-
|
1970
|
-
```yaml
|
1971
|
-
type: sql
|
1972
|
-
url: mysql://<username>:<password>@mysql.database.com/<database_name>
|
1973
|
-
ssl_ca: |
|
1974
|
-
-----BEGIN CERTIFICATE-----
|
1975
|
-
...
|
1976
|
-
-----END CERTIFICATE-----
|
1936
|
+
$ zenml status
|
1937
|
+
-----ZenML Client Status-----
|
1938
|
+
Connected to a ZenML Pro server: `test-zenml-login` [16f8a35d-5c2f-44aa-a564-b34186fbf6d6]
|
1939
|
+
ZenML Pro Organization: My Organization
|
1940
|
+
ZenML Pro authentication: valid until 2024-10-26 10:18:51 CEST (in 20h37m9s)
|
1941
|
+
Dashboard: https://cloud.zenml.io/organizations/bf873af9-aaf9-4ad1-a08e-3dc6d920d590/tenants/16f8336d-5c2f-44aa-a534-b34186fbf6d6
|
1942
|
+
API: https://6784e58f-zenml.staging.cloudinfra.zenml.io
|
1943
|
+
Server status: 'available'
|
1944
|
+
Server authentication: never expires
|
1945
|
+
The active user is: 'user'
|
1946
|
+
The active stack is: 'default' (global)
|
1947
|
+
Using configuration from: '/home/user/.config/zenml'
|
1948
|
+
Local store files are located at: '/home/user/.config/zenml/local_stores'
|
1977
1949
|
|
1978
|
-
|
1979
|
-
|
1980
|
-
ssl_verify_server_cert: false
|
1950
|
+
-----Local ZenML Server Status-----
|
1951
|
+
The local daemon server is running at: http://127.0.0.1:8237
|
1981
1952
|
```
|
1982
1953
|
|
1983
|
-
|
1984
|
-
option to `Trust this device`. If you opt out of it a 24-hour token
|
1985
|
-
issued for the authentication service. If you opt-in, you will be
|
1954
|
+
When connecting to a ZenML server using the web login flow, you will be provided
|
1955
|
+
with the option to `Trust this device`. If you opt out of it a 24-hour token
|
1956
|
+
will be issued for the authentication service. If you opt-in, you will be
|
1957
|
+
issued a 30-day token instead.
|
1986
1958
|
|
1987
1959
|
If you would like to see a list of all trusted devices, you can use:
|
1988
1960
|
|
@@ -2024,8 +1996,8 @@ Depending on how you set up and deployed ZenML, the secrets store keeps secrets
|
|
2024
1996
|
in the local database or uses the ZenML server your client is connected to:
|
2025
1997
|
|
2026
1998
|
* if you are using the default ZenML client settings, or if you connect your
|
2027
|
-
ZenML client to a local ZenML server started with `zenml
|
2028
|
-
is using the same local SQLite database as the rest of ZenML
|
1999
|
+
ZenML client to a local ZenML server started with `zenml login --local`, the
|
2000
|
+
secrets store is using the same local SQLite database as the rest of ZenML
|
2029
2001
|
* if you connect your ZenML client to a remote ZenML server, the
|
2030
2002
|
secrets are no longer managed on your local machine, but through the remote
|
2031
2003
|
server instead. Secrets are stored in whatever secrets store back-end the
|
@@ -2259,7 +2231,7 @@ then use the issued API key to connect your ZenML client to the server with the
|
|
2259
2231
|
CLI:
|
2260
2232
|
|
2261
2233
|
```bash
|
2262
|
-
zenml
|
2234
|
+
zenml login https://... --api-key
|
2263
2235
|
```
|
2264
2236
|
|
2265
2237
|
or by setting the `ZENML_STORE_URL` and `ZENML_STORE_API_KEY` environment
|
@@ -2523,6 +2495,7 @@ from zenml.cli.config import * # noqa
|
|
2523
2495
|
from zenml.cli.downgrade import * # noqa
|
2524
2496
|
from zenml.cli.feature import * # noqa
|
2525
2497
|
from zenml.cli.integration import * # noqa
|
2498
|
+
from zenml.cli.login import *
|
2526
2499
|
from zenml.cli.model import * # noqa
|
2527
2500
|
from zenml.cli.model_registry import * # noqa
|
2528
2501
|
from zenml.cli.pipeline import * # noqa
|
zenml/cli/base.py
CHANGED
@@ -361,10 +361,10 @@ def clean(yes: bool = False, local: bool = False) -> None:
|
|
361
361
|
server = get_local_server()
|
362
362
|
|
363
363
|
if server:
|
364
|
-
from zenml.zen_server.deploy.deployer import
|
364
|
+
from zenml.zen_server.deploy.deployer import LocalServerDeployer
|
365
365
|
|
366
|
-
deployer =
|
367
|
-
deployer.remove_server(
|
366
|
+
deployer = LocalServerDeployer()
|
367
|
+
deployer.remove_server()
|
368
368
|
cli_utils.declare("The local ZenML dashboard has been shut down.")
|
369
369
|
|
370
370
|
# delete the .zen folder
|