Skip to content

Commit

Permalink
Merge pull request #1853 from Giskard-AI/doc/gsk-2877-handle-kernel-m…
Browse files Browse the repository at this point in the history
…igration-for-existing-projects

[GSK-2877] Update doc about ML worker to adapt kernel and multi-ML worker
  • Loading branch information
andreybavt committed Apr 5, 2024
2 parents 4c1faa8 + e15a717 commit f2b7c9f
Show file tree
Hide file tree
Showing 10 changed files with 464 additions and 343 deletions.
10 changes: 8 additions & 2 deletions docs/cli/ngrok/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ Now you can run :code:`giskard hub expose --ngrok-token <ngrok_API_key>` which s
token=...
client = giskard.GiskardClient("<ngrok_external_server_link>", token)

# To run your model with the Giskard Hub, execute these three lines on Google Colab:
# To run your model with the current Python environment on Google Colab, execute these lines:

%env GSK_API_KEY=...
!giskard worker start -d -u <ngrok_external_server_link>
!giskard worker start -d -u <ngrok_external_server_link> --name <your-project-worker-id>

# To let Giskard Hub run your model in a managed Python environment, execute these lines:

%env GSK_API_KEY=...
!giskard worker start -s -u <ngrok_external_server_link> --name <your-project-worker-id>

2 changes: 1 addition & 1 deletion docs/giskard_hub/installation_hub/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The Giskard Hub is the app adapted for an enterprise use of Giskard. Extending t
You have 3 ways to install the Hub:
* **Hugging Face Space installation**: This is adapted for an **easy installation** in the cloud for prototyping purposes. If you don't want to upload your own model and just want to check some Giskard demo projects, the HF public space is perfect for you.
* **On-premise installation**: This is adapted if your data and model are **private** and you don't have the possibility to use the cloud (for instance, because of privacy and connectivity issues).
* **Private cloud**: This is adapted if you can easily run a **Cloud instance** by your favourite Cloud provider (AWS, GCP or Azure) and want to easily use Giskard collaborative features (collect feedback from business, share results, etc.). Make sure that you have the rights to open ports of your Cloud machine because Giskard needs to open a connection with an ML Worker running on your Python environment.
* **Private cloud**: This is adapted if you can easily run a **Cloud instance** by your favourite Cloud provider (AWS, GCP or Azure) and want to easily use Giskard collaborative features (collect feedback from business, share results, etc.). Make sure that you have the rights to open ports of your Cloud machine, if you want to connect your own ML Worker to the Giskard Hub.

```{toctree}
:caption: Table of Contents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,72 +44,8 @@ You can stop the instance and restart it when you need to save AWS compute costs

## 5. Start the ML worker

Giskard executes your model using a worker that runs the model directly in **your Python environment**, with all the dependencies required by your model. You can either execute the ML worker:
Giskard executes your model using an ML worker that runs the model. The worker is created along with your project, using the dependencies in your current environment. You can start the worker on Giskard Hub, if it is not started automatically.

- From your **local notebook** within the kernel that contains all the dependencies of your model
- From **Google Colab** within the kernel that contains all the dependencies of your model
- Or from **your terminal** within the Python environment that contains all the dependencies of your model

:::{note}
If you plan to use LLM-assisted tests or transformations, don’t forget to set the ``OPENAI_API_KEY`` environment
variable before starting the Giskard worker.
:::

:::::::{tab-set}
::::::{tab-item} From your local notebook

To start the ML worker from your notebook, run the following code in your notebook:

```
!giskard worker start -d -k YOUR_KEY -u https://<your IP address>:19000/
```

The API Access Key (`YOUR_KEY`) can be found in the Settings tab of the Giskard Hub.


> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
For advanced and flexible usages, please check [our doc for ML worker](../../mlworker/index.md).

You're all set to try Giskard in action. Upload your first model, dataset or test suite by following the [upload an object](../../../upload/index.md) page.

::::::
::::::{tab-item} From Colab notebook

To start the ML worker from your Colab notebook, run in your Colab cell:

```
!giskard worker start -d -k YOUR_KEY -u https://<your IP address>:19000/
```
The API Access Key (`YOUR_KEY`) can be found in the Settings tab of the Giskard Hub.

> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
You're all set to try Giskard in action. Upload your first model, dataset or test suite by following the [upload an object](../../../upload/index.md) page.

::::::
::::::{tab-item} From your terminal

* Run the following command **within the Python environment that contains all the dependencies of your model**:

```
giskard worker start -k YOUR_KEY -u https://<your IP address>:19000/
```
The API Access Key (`YOUR_KEY`) can be found in the Settings tab of the Giskard Hub.

> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
You're all set to try Giskard in action. Upload your first model, dataset or test suite by following the [upload an object](../../../upload/index.md) page.

::::::
:::::::
Original file line number Diff line number Diff line change
Expand Up @@ -57,72 +57,8 @@ You can stop the instance and restart it when you need to save your Azure comput

## 4. Start the ML worker

Giskard executes your model using a worker that runs the model directly in **your Python environment**, with all the dependencies required by your model. You can either execute the ML worker:
Giskard executes your model using an ML worker that runs the model. The worker is created along with your project, using the dependencies in your current environment. You can start the worker on Giskard Hub, if it is not started automatically.

- From your **local notebook** within the kernel that contains all the dependencies of your model
- From **Google Colab** within the kernel that contains all the dependencies of your model
- Or from **your terminal** within the Python environment that contains all the dependencies of your model

:::{note}
If you plan to use LLM-assisted tests or transformations, don’t forget to set the ``OPENAI_API_KEY`` environment
variable before starting the Giskard worker.
:::

:::::::{tab-set}
::::::{tab-item} From your local notebook

To start the ML worker from your notebook, run the following code in your notebook:

```
!giskard worker start -d -k YOUR_KEY -u https://<your IP address>:19000/
```

The API Access Key (`YOUR_KEY`) can be found in the Settings tab of the Giskard Hub.


> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
You're all set to try Giskard in action. Upload your first model, dataset or test suite by following the [upload an object](../../../upload/index.md) page.

::::::
::::::{tab-item} From Colab notebook

To start the ML worker from your Colab notebook, run in your Colab cell:

```
!giskard worker start -d -k YOUR_KEY -u https://<your IP address>:19000/
```
The API Access Key (`YOUR_KEY`) can be found in the Settings tab of the Giskard Hub.

> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
You're all set to try Giskard in action. Upload your first model, dataset or test suite by following the [upload an object](../../../upload/index.md) page.

::::::
::::::{tab-item} From your terminal

* Run the following command **within the Python environment that contains all the dependencies of your model**:

```
giskard worker start -k YOUR_KEY -u https://<your IP address>:19000/
```
The API Access Key (`YOUR_KEY`) can be found in the Settings tab of the Giskard Hub.

> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
For advanced and flexible usages, please check [our doc for ML worker](../../mlworker/index.md).

You're all set to try Giskard in action. Upload your first model, dataset or test suite by following the [upload an object](../../../upload/index.md) page.

::::::
:::::::
Original file line number Diff line number Diff line change
Expand Up @@ -62,76 +62,10 @@ You can stop the instance and restart it when you need to save your GCP compute
&#x20;`giskard hub start`
:::



## 4. Start the ML worker

Giskard executes your model using a worker that runs the model directly in **your Python environment**, with all the dependencies required by your model. You can either execute the ML worker:

- From your **local notebook** within the kernel that contains all the dependencies of your model
- From **Google Colab** within the kernel that contains all the dependencies of your model
- Or from **your terminal** within the Python environment that contains all the dependencies of your model

:::{note}
If you plan to use LLM-assisted tests or transformations, don’t forget to set the ``OPENAI_API_KEY`` environment
variable before starting the Giskard worker.
:::

:::::::{tab-set}
::::::{tab-item} From your local notebook

To start the ML worker from your notebook, run the following code in your notebook:

```
!giskard worker start -d -k YOUR_KEY -u https://<your IP address>:19000/
```

The API Access Key (`YOUR_KEY`) can be found in the Settings tab of the Giskard Hub.


> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
You're all set to try Giskard in action. Upload your first model, dataset or test suite by following the [upload an object](../../../upload/index.md) page.

::::::
::::::{tab-item} From Colab notebook

To start the ML worker from your Colab notebook, run in your Colab cell:

```
!giskard worker start -d -k YOUR_KEY -u https://<your IP address>:19000/
```
The API Access Key (`YOUR_KEY`) can be found in the Settings tab of the Giskard Hub.
Giskard executes your model using an ML worker that runs the model. The worker is created along with your project, using the dependencies in your current environment. You can start the worker on Giskard Hub, if it is not started automatically.

> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
For advanced and flexible usages, please check [our doc for ML worker](../../mlworker/index.md).

You're all set to try Giskard in action. Upload your first model, dataset or test suite by following the [upload an object](../../../upload/index.md) page.

::::::
::::::{tab-item} From your terminal

* Run the following command **within the Python environment that contains all the dependencies of your model**:

```
giskard worker start -k YOUR_KEY -u https://<your IP address>:19000/
```
The API Access Key (`YOUR_KEY`) can be found in the Settings tab of the Giskard Hub.

> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
You're all set to try Giskard in action. Upload your first model, dataset or test suite by following the [upload an object](../../../upload/index.md) page.

::::::
:::::::
66 changes: 3 additions & 63 deletions docs/giskard_hub/installation_hub/install_hfs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,71 +66,11 @@ Alternatively, provide your HF access token through the Giskard Settings.

### 4. Start the ML worker

Giskard executes your model using a worker that runs the model directly in **your Python environment**, with all the dependencies required by your model. You can either execute the ML worker:
Giskard executes your model using an ML worker that runs the model. The worker is created along with your project, using the dependencies in your current environment. You can start the worker on Giskard Hub, if it is not started automatically.

- From your **local notebook** within the kernel that contains all the dependencies of your model
- From **Google Colab** within the kernel that contains all the dependencies of your model
- Or from **your terminal** within the Python environment that contains all the dependencies of your model
For advanced and flexible usages, please check [our doc for ML worker](../mlworker/index.md).

:::{note}
If you plan to use LLM-assisted tests or transformations, don’t forget to set the ``OPENAI_API_KEY`` environment
variable before starting the Giskard worker.
:::

:::::::{tab-set}
::::::{tab-item} From your local notebook

To start the ML worker from your notebook, run the following code in your notebook:

```
!giskard worker start -d -k YOUR_KEY -u https://XXX.hf.space -t HF-TOKEN
```

To find the **exact** command with the right API Access Key (`YOUR_KEY`) and HuggingFace token (`HF-TOKEN`), go to the "Ml Worker" section in the Settings tab in the Giskard Hub that you install in HF Space.


> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
::::::
::::::{tab-item} From Colab notebook

To start the ML worker from your Colab notebook, run in your Colab cell:

```
!giskard worker start -d -k YOUR_KEY -u https://XXX.hf.space -t HF-TOKEN
```

To find the **exact** command with the right API Access Key (`YOUR_KEY`) and HuggingFace token (`HF-TOKEN`), go to the "Ml Worker" section in the Settings tab in the Giskard Hub that you install in HF Space.

> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
::::::
::::::{tab-item} From your terminal

* Run the following command **within the Python environment that contains all the dependencies of your model**:

```
giskard worker start -d -k YOUR_KEY -u https://XXX.hf.space -t HF-TOKEN
```

To find the **exact** command with the right API Access Key (`YOUR_KEY`) and HuggingFace token (`HF-TOKEN`), go to the "Ml Worker" section in the Settings tab in the Giskard Hub that you install in HF Space.

> ### ⚠️ Warning
> To see the available commands of the worker, you can execute:
>```
>!giskard worker --help
>```
::::::
:::::::
You're all set to try Giskard in action. Upload your first model, dataset or test suite by following the [upload an object](../../../upload/index.md) page.

### 5. Upload your test suite by creating a Giskard Client for your HF Space

Expand Down
Loading

0 comments on commit f2b7c9f

Please sign in to comment.