Skip to content

Commit 00d571e

Browse files
authored
ZenML Pro web login implementation (#3141)
1 parent 0c2ebc4 commit 00d571e

File tree

93 files changed

+4772
-1553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+4772
-1553
lines changed

docs/book/getting-started/deploying-zenml/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ This default setup allows you to get started and try out the core features but
6262
you won't be able to use cloud-based components like serverless orchestrators
6363
and so on.
6464

65-
Users can run the `zenml up` command to spin up a local ZenML OSS server to serve the
66-
dashboard. For the local OSS server option, the `zenml up` command implicitly
65+
Users can run the `zenml login --local` command to spin up a local ZenML OSS server to serve the
66+
dashboard. For the local OSS server option, the `zenml login --local` command implicitly
6767
connects the client to the server. The diagram for this looks as follows:
6868

6969
![ZenML with a local ZenML OSS Server](../../.gitbook/assets/Scenario2.png)
@@ -72,7 +72,7 @@ In order to move into production, the ZenML server needs to be deployed somewher
7272

7373
![ZenML centrally deployed for multiple users](../../.gitbook/assets/Scenario3.2.png)
7474

75-
You connect to your deployed ZenML server using the `zenml connect` command and
75+
You connect to your deployed ZenML server using the `zenml login` command and
7676
then you have the full benefits and power of ZenML. You can use all the
7777
cloud-based components, your metadata will be stored and synchronized across all
7878
the users of the server and you can leverage features like centralized logs

docs/book/getting-started/deploying-zenml/deploy-using-huggingface-spaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Your Space's URL will only be available and usable for connecting from your loca
4343
You can use the 'Direct URL' to connect to your ZenML server from your local machine with the following CLI command (after installing ZenML, and using your custom URL instead of the placeholder):
4444

4545
```shell
46-
zenml connect --url '<YOUR_HF_SPACES_DIRECT_URL>'
46+
zenml login '<YOUR_HF_SPACES_DIRECT_URL>'
4747
```
4848

4949
You can also use the Direct URL in your browser to use the ZenML dashboard as a fullscreen application (i.e. without the HuggingFace Spaces wrapper around it).

docs/book/getting-started/deploying-zenml/deploy-with-docker.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ The ZenML server container image is available at [`zenmldocker/zenml-server`](ht
1111
If you're just looking for a quick way to deploy the ZenML server using a container, without going through the hassle of interacting with a container management tool like Docker and manually configuring your container, you can use the ZenML CLI to do so. You only need to have Docker installed and running on your machine:
1212

1313
```bash
14-
zenml up --docker
14+
zenml login --local --docker
1515
```
1616

17-
This command deploys a ZenML server locally in a Docker container, then connects your client to it. Similar to running plain `zenml up`, the server and the local ZenML client share the same SQLite database.
17+
This command deploys a ZenML server locally in a Docker container, then connects your client to it. Similar to running plain `zenml login --local`, the server and the local ZenML client share the same SQLite database.
1818

1919
The rest of this guide is addressed to advanced users who are looking to manually deploy and manage a containerized ZenML server.
2020

@@ -284,7 +284,7 @@ The above command will start a containerized ZenML server running on your machin
284284
You need to visit the ZenML dashboard at `http://localhost:8080` and activate the server by creating an initial admin user account. You can then connect your client to the server with the web login flow:
285285

286286
```shell
287-
$ zenml connect --url http://localhost:8080
287+
$ zenml login http://localhost:8080
288288
Connecting to: 'http://localhost:8080'...
289289
If your browser did not open automatically, please open the following URL into your browser to proceed with the authentication:
290290
@@ -364,7 +364,7 @@ docker run -it -d -p 8080:8080 --name zenml \
364364
You need to visit the ZenML dashboard at `http://localhost:8080` and activate the server by creating an initial admin user account. You can then connect your client to the server with the web login flow:
365365

366366
```shell
367-
zenml connect --url http://localhost:8080
367+
zenml login http://localhost:8080
368368
```
369369

370370
### Direct MySQL database connection
@@ -377,10 +377,10 @@ As previously covered, the containerized MySQL database service can be started w
377377
docker run --name mysql -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password mysql:8.0
378378
```
379379

380-
The ZenML client on the host machine can then be configured to connect directly to the database with a slightly different `zenml connect` command:
380+
The ZenML client on the host machine can then be configured to connect directly to the database with a slightly different `zenml login` command:
381381

382382
```shell
383-
zenml connect --url mysql://127.0.0.1/zenml --username root --password password
383+
zenml login mysql://root:password@127.0.0.1/zenml
384384
```
385385

386386
> **Note** The `localhost` hostname will not work with MySQL databases. You need to use the `127.0.0.1` IP address instead.
@@ -438,7 +438,7 @@ docker compose -f /path/to/docker-compose.yml -p zenml up -d
438438
You need to visit the ZenML dashboard at `http://localhost:8080` to activate the server by creating an initial admin account. You can then connect your client to the server with the web login flow:
439439

440440
```shell
441-
zenml connect --url http://localhost:8080
441+
zenml login http://localhost:8080
442442
```
443443

444444
Tearing down the installation is as simple as running:
@@ -493,7 +493,7 @@ You can check the logs of the container to verify if the server is up and, depen
493493

494494
### CLI Docker deployments
495495

496-
If you used the `zenml up --docker` CLI command to deploy the Docker ZenML server, you can check the logs with the command:
496+
If you used the `zenml login --local --docker` CLI command to deploy the Docker ZenML server, you can check the logs with the command:
497497

498498
```shell
499499
zenml logs -f

docs/book/getting-started/deploying-zenml/deploy-with-helm.md

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -113,43 +113,16 @@ Immediately after deployment, the ZenML server needs to be activated before it c
113113

114114
The Helm chart should print out a message with the URL of the deployed ZenML server. You can use the URL to open the ZenML UI in your browser.
115115

116-
To connect your local client to the ZenML server, you can either pass the configuration as command line arguments or as a YAML file:
116+
To connect your local client to the ZenML server, you can run:
117117

118118
```bash
119-
zenml connect --url=https://zenml.example.com:8080 --no-verify-ssl
120-
```
121-
122-
or
123-
124-
```bash
125-
zenml connect --config=/path/to/zenml_server_config.yaml
126-
```
127-
128-
The YAML file should have the following structure when connecting to a ZenML server:
129-
130-
```yaml
131-
url: <The URL of the ZenML server>
132-
verify_ssl: |
133-
<Either a boolean, in which case it controls whether the
134-
server's TLS certificate is verified, or a string, in which case it
135-
must be a path to a CA certificate bundle to use or the CA bundle
136-
value itself>
137-
```
138-
139-
Example of a ZenML server YAML configuration file:
140-
141-
```yaml
142-
url: https://ac8ef63af203226194a7725ee71d85a-7635928635.us-east-1.elb.amazonaws.com/zenml
143-
verify_ssl: |
144-
-----BEGIN CERTIFICATE-----
145-
...
146-
-----END CERTIFICATE-----
119+
zenml login https://zenml.example.com:8080 --no-verify-ssl
147120
```
148121

149122
To disconnect from the current ZenML server and revert to using the local default database, use the following command:
150123

151124
```bash
152-
zenml disconnect
125+
zenml logout
153126
```
154127

155128
## ZenML Helm Deployment Scenarios
@@ -171,7 +144,7 @@ Once deployed, you have to use port-forwarding to access the ZenML server and to
171144
172145
```bash
173146
kubectl -n zenml-server port-forward svc/zenml-server 8080:8080
174-
zenml connect --url=http://localhost:8080
147+
zenml login http://localhost:8080
175148
```
176149

177150
This is just a simple example only fit for testing and evaluation purposes. For production deployments, you should use an external database and an Ingress service with TLS certificates to secure and expose the ZenML server to the internet.

docs/book/getting-started/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Though ZenML can run entirely as a pip package on a local system, complete with
8787

8888
```shell
8989
pip install "zenml[server]"
90-
zenml up # opens the dashboard locally
90+
zenml login --local # opens the dashboard locally
9191
```
9292

9393
However, advanced ZenML features are dependent on a centrally-deployed ZenML server accessible to other MLOps stack components. You can read more about it [here](deploying-zenml/README.md).

docs/book/how-to/advanced-topics/control-logging/view-logs-on-the-dasbhoard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def my_step() -> None:
1616
These logs are stored within the respective artifact store of your stack. This means that you can only view these logs in the dashboard
1717
*if the deployed ZenML server has direct access to the underlying artifact store*. There are two cases in which this will be true:
1818

19-
* In case of a local ZenML server (via `zenml up`), both local and remote artifact stores may be accessible, depending on configuration of the client.
19+
* In case of a local ZenML server (via `zenml login --local`), both local and remote artifact stores may be accessible, depending on configuration of the client.
2020
* In case of a deployed ZenML server, logs for runs on a [local artifact store](../../component-guide/artifact-stores/local.md) will not be accessible. Logs
2121
for runs using a [remote artifact store](../../user-guide/production-guide/remote-storage.md) **may be** accessible, if the artifact store has been configured
2222
with a [service connector](../auth-management/service-connectors-guide.md). Please read [this chapter](../../user-guide/production-guide/remote-storage.md) of

docs/book/how-to/advanced-topics/manage-zenml-server/troubleshoot-your-deployed-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ real-time.
4444
{% tab title="Docker" %}
4545
If you are using Docker, you can view the logs of the ZenML server using the following method:
4646

47-
* If you used the `zenml up --docker` CLI command to deploy the Docker ZenML server, you can check the logs with the
47+
* If you used the `zenml login --local --docker` CLI command to deploy the Docker ZenML server, you can check the logs with the
4848
command:
4949

5050
```shell

docs/book/how-to/debug-and-solve-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ RuntimeError: Error initializing rest store with URL 'http://127.0.0.1:8237': HT
149149
NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9abb198550>: Failed to establish a new connection: [Errno 61] Connection refused'))
150150
```
151151

152-
If you restarted your machine after deploying ZenML then you have to run `zenml up` again after each restart. Local ZenML deployments don't survive machine restarts.
152+
If you restarted your machine after starting the local ZenML server with `zenml login --local`, then you have to run `zenml login --local` again after each restart. Local ZenML deployments don't survive machine restarts.
153153

154154
#### Column 'step\_configuration' cannot be null
155155

docs/book/how-to/infrastructure-deployment/auth-management/best-security-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Most cloud providers and their associated Service Connector Types include some f
5151

5252
There are a few caveats that you should be aware of when choosing an implicit authentication method. It may seem like the easiest way out, but it carries with it some implications that may impact portability and usability later down the road:
5353

54-
* when used with a local ZenML deployment, like the default deployment, or [a local ZenML server started with `zenml up`](../../user-guide/production-guide/README.md), the implicit authentication method will use the configuration files and credentials or environment variables set up _on your local machine_. These will not be available to anyone else outside your local environment and will also not be accessible to workloads running in other environments on your local host. This includes for example local K3D Kubernetes clusters and local Docker containers.
54+
* when used with a local ZenML deployment, like the default deployment, or [a local ZenML server started with `zenml login --local`](../../user-guide/production-guide/README.md), the implicit authentication method will use the configuration files and credentials or environment variables set up _on your local machine_. These will not be available to anyone else outside your local environment and will also not be accessible to workloads running in other environments on your local host. This includes for example local K3D Kubernetes clusters and local Docker containers.
5555
* when used with a remote ZenML server, the implicit authentication method only works if your ZenML server is deployed in the same cloud as the one supported by the Service Connector Type that you are using. For instance, if you're using the AWS Service Connector Type, then the ZenML server must also be deployed in AWS (e.g. in an EKS Kubernetes cluster). You may also need to manually adjust the cloud configuration of the remote cloud workload where the ZenML server is running to allow access to resources (e.g. add permissions to the AWS IAM role attached to the EC2 or EKS node, add roles to the GCP service account attached to the GKE cluster nodes).
5656

5757
<details>

docs/book/how-to/infrastructure-deployment/stack-deployment/deploy-a-cloud-stack-with-terraform.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ you can also use [the stack wizard to seamlessly register your stack](../../how-
3333

3434
To use this feature, you need a deployed ZenML server instance that is reachable
3535
from the cloud provider where you wish to have the stack provisioned (this can't
36-
be a local server started via `zenml up`). If you do not already have one set up,
37-
you [can register for a free ZenML Pro account](https://cloud.zenml.io/signup)
38-
or you can learn about self-hosting a ZenML server [here](../../getting-started/deploying-zenml/README.md).
36+
be a local server started via `zenml login --local`). If you do not already have
37+
one set up, you can fast-track to trying out a ZenML Pro server by simply
38+
running `zenml login --pro` or [register for a free ZenML Pro account](https://cloud.zenml.io/signup).
39+
If you prefer to host your own, you can learn about self-hosting a ZenML server
40+
[here](../../getting-started/deploying-zenml/README.md).
3941

4042
Once you are connected to your deployed ZenML server, you need to create
4143
a service account and an API key for it. You will use the API key to give the
@@ -58,8 +60,10 @@ The API key value is: 'ZENKEY_...'
5860
Please store it safely as it will not be shown again.
5961
To configure a ZenML client to use this API key, run:
6062

61-
zenml connect --url https://842ed6a9-zenml.staging.cloudinfra.zenml.io --api-key \
62-
'ZENKEY_...'
63+
zenml login https://842ed6a9-zenml.staging.cloudinfra.zenml.io --api-key
64+
65+
and enter the following API key when prompted:
66+
ZENKEY_...
6367
```
6468

6569
Finally, you will need the following on the machine where you will be running

docs/book/how-to/infrastructure-deployment/stack-deployment/deploy-a-cloud-stack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ you can also use [the stack wizard to seamlessly register your stack](../../how-
2828
## How to use the 1-click deployment tool?
2929

3030
The first thing that you need in order to use this feature is a
31-
deployed instance of ZenML (not a local server via `zenml up`). If you do
31+
deployed instance of ZenML (not a local server via `zenml login --local`). If you do
3232
not already have it set up for you, feel free to learn how to do so
3333
[here](../../getting-started/deploying-zenml/README.md).
3434

docs/book/how-to/pipeline-development/build-pipelines/fetching-pipelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ output.visualize()
260260
![output.visualize() Output](../../.gitbook/assets/artifact\_visualization\_evidently.png)
261261

262262
{% hint style="info" %}
263-
If you're not in a Jupyter notebook, you can simply view the visualizations in the ZenML dashboard by running `zenml up` and clicking on the respective artifact in the pipeline run DAG instead. Check out the [artifact visualization page](../visualize-artifacts/README.md) to learn more about how to build and view artifact visualizations in ZenML!
263+
If you're not in a Jupyter notebook, you can simply view the visualizations in the ZenML dashboard by running `zenml login --local` and clicking on the respective artifact in the pipeline run DAG instead. Check out the [artifact visualization page](../visualize-artifacts/README.md) to learn more about how to build and view artifact visualizations in ZenML!
264264
{% endhint %}
265265

266266
## Fetching information during run execution

docs/book/how-to/project-setup-and-management/connecting-to-zenml/connect-in-with-your-user-interactive.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
You can authenticate your clients with the ZenML Server using the ZenML CLI and the web based login. This can be executed with the command:
44

55
```bash
6-
zenml connect --url https://...
6+
zenml login https://...
77
```
88

99
This command will start a series of steps to validate the device from where you are connecting that will happen in your browser. You can choose whether to mark your respective device as trusted or not. If you choose not to click `Trust this device`, a 24-hour token will be issued for authentication services. Choosing to trust the device will issue a 30-day token instead.
@@ -28,7 +28,7 @@ zenml authorized-device lock <DEVICE_ID>
2828

2929
To keep things simple, we can summarize the steps:
3030

31-
1. Use the `zenml connect --url` command to start a device flow and connect to a zenml server.
31+
1. Use the `zenml login <URL>` command to start a device flow and connect to a zenml server.
3232
2. Choose whether to trust the device when prompted.
3333
3. Check permitted devices with `zenml devices list`.
3434
4. Invalidate a token with `zenml device lock ...`.

docs/book/how-to/project-setup-and-management/connecting-to-zenml/connect-with-a-service-account.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ This command creates a service account and an API key for it. The API key is dis
1111
* using the CLI:
1212

1313
```bash
14-
zenml connect --url https://... --api-key <API_KEY>
14+
# This command will prompt you to enter the API key
15+
zenml login https://... --api-key
1516
```
1617

1718
* setting the `ZENML_STORE_URL` and `ZENML_STORE_API_KEY` environment variables when you set up your ZenML client for the first time. This method is particularly useful when you are using the ZenML client in an automated CI/CD workload environment like GitHub Actions or GitLab CI or in a containerized environment like Docker or Kubernetes:
@@ -63,7 +64,7 @@ Deactivating a service account or an API key will prevent it from being used to
6364
To keep things simple, we can summarize the steps:
6465

6566
1. Use the `zenml service-account create` command to create a service account and an API key.
66-
2. Use the `zenml connect --url <url> --api-key <api-key>` command to connect your ZenML client to the server using the API key.
67+
2. Use the `zenml login <url> --api-key` command to connect your ZenML client to the server using the API key.
6768
3. Check configured service accounts with `zenml service-account list`.
6869
4. Check configured API keys with `zenml service-account api-key <SERVICE_ACCOUNT_NAME> list`.
6970
5. Regularly rotate API keys with `zenml service-account api-key <SERVICE_ACCOUNT_NAME> rotate`.

docs/book/how-to/project-setup-and-management/develop-locally/keep-your-dashboard-server-clean.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@ options:
1111
## Run locally
1212

1313
One of the easiest ways to avoid cluttering a shared server / dashboard is to
14-
disconnect from the server and simply spin up a local server:
14+
disconnect your client from the remote server and simply spin up a local server:
1515

1616
```bash
17-
zenml disconnect
18-
zenml up
17+
zenml login --local
1918
```
2019

2120
Note that there are some limitations to this approach, particularly if you want
2221
to use remote infrastructure, but if there are local runs that you can do
2322
without the need for remote infrastructure, this can be a quick and easy way to
2423
keep things clean. When you're ready to reconnect to the server to continue with
25-
your shared runs, you can simply run `zenml connect ...` again.
24+
your shared runs, you can simply run `zenml login <remote-url>` again.
2625

2726
## Pipeline Runs
2827

docs/book/reference/api-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The ZenML server is a FastAPI application, therefore the OpenAPI-compliant docs
99
of your ZenML server:
1010

1111
{% hint style="info" %}
12-
In the local case (i.e. using `zenml up`, the docs are available on `http://127.0.0.1:8237/docs`)
12+
In the local case (i.e. using `zenml login --local`, the docs are available on `http://127.0.0.1:8237/docs`)
1313
{% endhint %}
1414

1515
![ZenML API docs](../.gitbook/assets/zenml_api_docs.png)

docs/book/user-guide/production-guide/ci-cd.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ jobs:
9595
run-staging-workflow:
9696
runs-on: run-zenml-pipeline
9797
env:
98-
ZENML_HOST: ${{ secrets.ZENML_HOST }} # Put your server url here
99-
ZENML_API_KEY: ${{ secrets.ZENML_API_KEY }} # Retrieves the api key for use
98+
ZENML_STORE_URL: ${{ secrets.ZENML_HOST }} # Put your server url here
99+
ZENML_STORE_API_KEY: ${{ secrets.ZENML_API_KEY }} # Retrieves the api key for use
100100
ZENML_STACK: stack_name # Use this to decide which stack is used for staging
101101
ZENML_GITHUB_SHA: ${{ github.event.pull_request.head.sha }}
102102
ZENML_GITHUB_URL_PR: ${{ github.event.pull_request._links.html.href }}
@@ -119,9 +119,9 @@ steps:
119119
run: |
120120
pip3 install -r requirements.txt
121121
122-
- name: Connect to ZenML server
122+
- name: Confirm ZenML client is connected to ZenML server
123123
run: |
124-
zenml connect --url $ZENML_HOST --api-key $ZENML_API_KEY
124+
zenml status
125125
126126
- name: Set stack
127127
run: |

0 commit comments

Comments
 (0)