Skip to content

Commit

Permalink
Cos integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ColmBhandal committed Aug 30, 2023
1 parent 8797fc2 commit 2bfc2bc
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 1 deletion.
88 changes: 88 additions & 0 deletions docs/how-to/cos-integration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
Integrate MLflow with the Canonical Observability Stack (COS)
=============================================================

This guide shows how to integrate MLflow with the Canonical Observability Stack (COS).

Prerequisites
-------------

This guide asssumes:

#. You have deployed the COS stack in the ``cos`` model. For steps on how to do this, see the `MicroK8s tutorial <https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s>`_.
#. You have deployed the MLflow bundle in the ``kubeflow`` model. For steps on how to do this, see :doc:`../tutorial/mlflow`.

Deploy Grafana Agent
--------------------

Deploy the `Grafana Agent <https://charmhub.io/grafana-agent-k8s>`_ to your ``kubeflow`` model alongside the MLflow bundle. Run the following command:

.. code-block:: bash
juju deploy grafana-agent-k8s --channel=edge --trust
Relate MLflow Server Prometheus Metrics to Grafana Agent
--------------------------------------------------------

Establish the relationship between the MLflow Server Prometheus metrics and the Grafana Agent. Use the following command:

.. code-block:: bash
juju add-relation mlflow-server:metrics-endpoint grafana-agent-k8s:metrics-endpoint
Relate Grafana Agent to Prometheus in the COS Model
---------------------------------------------------

Next, relate the Grafana Agent to Prometheus in the ``cos`` model. Execute the following command:

.. code-block:: bash
juju add-relation grafana-agent-k8s admin/cos.prometheus-receive-remote-write
Relate MLflow Server in the Kubeflow Model to Grafana Charm in the COS Model
----------------------------------------------------------------------------

Establish the relationship between the MLflow Server in the ``kubeflow`` model and the Grafana charm in the ``cos`` model. Run the following command:

.. code-block:: bash
juju add-relation mlflow-server admin/cos.grafana-dashboards
Obtain the Grafana Dashboard Admin Password
-------------------------------------------

Switch the model to ``cos`` and retrieve the Grafana dashboard admin password. Execute the following commands:

.. code-block:: bash
juju switch cos
juju run-action grafana/0 get-admin-password --wait
Obtain the Grafana Dashboard URL
--------------------------------

To access the Grafana dashboard, you need the URL. Run the following command to get the URLs for the COS endpoints:

.. code-block:: bash
juju show-unit catalogue/0 | grep url
You will see a list of endpoints similar to the following:

.. code-block:: bash
url: http://10.43.8.34:80/cos-catalogue
url: http://10.43.8.34/cos-grafana
url: http://10.43.8.34:80/cos-prometheus-0
url: http://10.43.8.34:80/cos-alertmanager
Choose the ``cos-grafana`` URL and access it in your browser.

Login to Grafana
----------------

Login to Grafana with the password obtained from the previous section. The username is ``admin``.

Access the dashboard in the UI
------------------------------

Go to the left sidebar and choose the MLflow Dashboards from the list. From the General dashboards folder choose the ``MLflow metrics Dashboard``. When accessing the dashboard for the first time, choose some reasonable time range from the top right dropdown.
3 changes: 2 additions & 1 deletion docs/how-to/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Welcome to the How-To section. These guides provide practical instructions for s
.. toctree::
:maxdepth: 1

create-ck8s-aws
cos-integration
create-ck8s-aws
deploy-ck8s-aws
deploy-eks
deploy-kubeflow-mlflow-ck8s-aws
Expand Down

0 comments on commit 2bfc2bc

Please sign in to comment.