| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The CogStack Model Gateway (CMG) is a service that provides a unified interface for accessing machine learning models deployed as standalone servers. It implements service discovery and enables scheduling incoming tasks based on their priority, as well the state of the cluster. The project is designed to work with Cogstack ModelServe (CMS) model server instances and consists of two main components:
In order to run the CogStack Model Gateway, you need:
Installing the CogStack Model Gateway is possible using Docker Compose, while configuration is done through environment variables. Before deploying the Gateway, make sure to set the required variables either by exporting them in the shell or by creating a .env file in the root directory of the project. The following variables are required:
An example configuration is provided below, using the default project name for the CMS stack (i.e. "cms"), forcing the scheduler to handle only one task at a time, using the internal Docker service name in the MLflow URI, and setting up the remaining services with sample credentials that fulfill their respective service validation requirements (e.g. MinIO secret key minimum length, underscores not allowed in MinIO bucket names). The configuration should be saved in a .env file in the root directory of the project before running Docker Compose (or sourced directly in the shell):
CMG_SCHEDULER_MAX_CONCURRENT_TASKS=1
# Postgres
CMG_DB_USER=admin
CMG_DB_PASSWORD=admin
CMG_DB_HOST=db
CMG_DB_PORT=5432
CMG_DB_NAME=cmg_tasks
# RabbitMQ
CMG_QUEUE_USER=admin
CMG_QUEUE_PASSWORD=admin
CMG_QUEUE_HOST=queue
CMG_QUEUE_PORT=5672
CMG_QUEUE_NAME=cmg_tasks
# MinIO
CMG_OBJECT_STORE_ACCESS_KEY=admin
CMG_OBJECT_STORE_SECRET_KEY=admin123
CMG_OBJECT_STORE_HOST=object-store
CMG_OBJECT_STORE_PORT=9000
CMG_OBJECT_STORE_BUCKET_TASKS=cmg-tasks
CMG_OBJECT_STORE_BUCKET_RESULTS=cmg-resultsTo install the CogStack Model Gateway, clone the repository and run docker compose inside the root directory. It is recommended to set the CMG_COMMIT_SHA environment variable to the current commit hash which will be added as a label to all containers for easier tracking in production:
CMG_COMMIT_SHA=$(git rev-parse HEAD) docker compose -f docker-compose.yaml upThis will spin up the following services:
The Gateway exposes 2 main HTTP endpoints, one for interacting with the model servers and one for monitoring the state of submitted tasks. The following endpoints are available:
Model Servers: Interact with CMS model servers.
GET /models: List all available model servers, returning both running containers and on-demand models that can be auto-deployed.
GET /models/{model_name}: Get information about a specific model (running or on-demand) without triggering auto-deployment.
GET /models/{model_name}/info: Get detailed information about a running model server (equivalent to the CMS /info endpoint). May trigger auto-deployment for on-demand models.
POST /models/{model_name}: Deploy a new model server from a previously trained model.
POST /models/{model_name}/tasks/{task_name}: Execute a task on the specified model server, providing any query parameters or request body required (follows the CMS API, striving to support the same endpoints).
Tasks: Monitor the state of submitted tasks.
GET /tasks: List all submitted tasks (currently not allowed, will be enabled once users are introduced).
GET /tasks/{task_id}: Get information about a specific task.
The project is still under active development. In the future we will be focusing on the following:
| Back | FazBrowse Home | New Git URL |