Skip to main content

Whitebox is an open source E2E ML monitoring platform with edge capabilities that plays nicely with kubernetes

Project description

Whitebox - E2E machine learning monitoring

Whitebox

Whitebox is an open source E2E ML monitoring platform with edge capabilities that plays nicely with kubernetes


Documentation: https://whitebox-ai.github.io/whitebox

Source Code: https://github.com/whitebox-ai/whitebox

Roadmap: https://github.com/whitebox-ai/whitebox/milestones

Issue tracking https://github.com/orgs/whitebox-ai/projects/1/views/3

Discord: https://discord.gg/bkAcsx4V


Whitebox is an open source E2E ML monitoring platform with edge capabilities that plays nicely with kubernetes.

The key features are:

  • Classification models metrics
  • Regression models metrics
  • Data / model drift monitoring
  • Alerts

Design guidelines:

  • Easy: Very easy to set up and get started with.
  • Intuitive: Designed to be intuitive and easy to use.
  • Pythonic SDK: Pythonic SDK for building your own monitoring infrastructure.
  • Robust: Get production-ready MLOps system.
  • Kubernetes: Get production-ready code. With automatic interactive documentation.

Installation

Install the server using docker compose. See the docs for more info.

Install the SDK with pip:

pip install whitebox-sdk

How to use

After you are done installing the server and the SDK, you can start using it.

After you get the API key, all you have to do is create an instance of the Whitebox class adding your host and API key as parameters:

from whitebox import Whitebox

wb = Whitebox(host="127.0.0.1:8000", api_key="some_api_key")

Now you're ready to start using Whitebox! Read the documentation to learn more about the SDK.

Set up locally for development

Whitebox supports Postgres and SQLite. You can use either one of them. If you want to use SQLite, you need to set up a SQLite database and set the DATABASE_URL environment variable to the database URL. If you want to use Postgres, you don't need to do anything. Just have a Postgres database running and set the DATABASE_URL environment variable to the database URL.

Install packages:

python -m venv .venv
pip install -r requirements.txt
pre-commit install

Run the server:

ENV=dev uvicorn whitebox.main:app --reload

Quick way to start a postgres database:

docker compose up postgres -d

Tests:

  • Run: ENV=test pytest or ENV=test pytest -s to preserve logs.
  • Watch: ENV=test ptw
  • Run test coverage ENV=test coverage run -m pytest
  • Look at coverage report: coverage report or coverage html to generate an html. To view it in your browser open the htmlcov/index.html file.

Docs

Documentation is hosted bby GitHub here: https://whitebox-ai.github.io/whitebox

mkdocs serve -f docs/mkdocs/mkdocs.yml -a localhost:8001

Deploy Whitebox

Using docker

Whitebox uses postgres as its database. They need to run in the same docker network. An example docker-compose file is located in the examples folder. Make sure you replace the SECRET_KEY with one of your own. Look below for more info.

docker-compose -f examples/docker-compose/docker-compose.yml up

If you just need to run Whitebox, make sure you set the DATABASE_URL in the environment.

docker run -dp 8000:8000 sqdhub/whitebox:main -e DATABASE_URL=postgresql://user:password@host:port/db_name

To save the api key encrypted in the database, provide a SECRET_KEY variable in the environment that is consisted of a 16 bytes string.

python -c "from secrets import token_hex; print(token_hex(16))"

Save this token somewhere safe.

The api key can be retrieved directly from the postgres database:

API_KEY=$(docker exec <postgres_container_id> /bin/sh -c "psql -U postgres -c \"SELECT api_key FROM users WHERE username='admin';\" -tA")

echo $API_KEY

If you've set the SECRET_KEY in the environment get the decrypted key using:

docker exec <whitebox_container_id> /usr/local/bin/python scripts/decrypt_api_key.py $API_KEY

Using Helm

You can also install Whitebox server and all of its dependencies in your k8s cluster using helm

helm repo add squaredev https://chartmuseum.squaredev.io/
helm repo update
helm install whitebox squaredev/whitebox

Contributing

We happily welcome contributions to Whitebox. You can start by opening a new issue!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whitebox-sdk-0.0.20.tar.gz (35.5 kB view details)

Uploaded Source

Built Distribution

whitebox_sdk-0.0.20-py3-none-any.whl (57.7 kB view details)

Uploaded Python 3

File details

Details for the file whitebox-sdk-0.0.20.tar.gz.

File metadata

  • Download URL: whitebox-sdk-0.0.20.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for whitebox-sdk-0.0.20.tar.gz
Algorithm Hash digest
SHA256 49b5d7687d6eb3a8e29ff7b805b41a1387e3b7049f19fcd91a0aea16ca91559d
MD5 368414d5657a9f4caaad45b851bd4e71
BLAKE2b-256 7e2c047341dfebb6e13cfa85ee10bc8dec0ed05304b3b78268f46c23e97c9926

See more details on using hashes here.

File details

Details for the file whitebox_sdk-0.0.20-py3-none-any.whl.

File metadata

File hashes

Hashes for whitebox_sdk-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 bc7188521900de10c4c073660fe6c8eca4bb50ffc8299287af24e6a37d4a20c2
MD5 7536377ad0cdf77fb8ab704a9527c46c
BLAKE2b-256 d66bc374c69336e78d28860836edcea116b2edf37be00fb9b50b299bd4bcbfc7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page