Deployment¶
Docker Installation¶
The ICOS Intelligence Layer can be deployed using Docker containers. While the core installation remains consistent with deliverable D4.1, this version introduces new environment configurations to customize API timeout and resource allocation.
Download the Docker image from this link and run the container using the command below:
docker run --network host -it --rm -p 3000:3000 -p 5000:5000 \
-e BENTOML_CONFIG_OPTIONS='api_server.traffic.timeout=600 runners.resources.cpu=0.5 runners.resources."nvidia.com/gpu"=0' \
docker_name:latest serve
This command launches the ICOS Intelligence Layer Coordination API server, accessible via http://0.0.0.0:3000.
Trustworthy AI Module – Deployment¶
Explainable AI¶
- Deployment: Packaged inside the Intelligence Layer Docker container.
- Access: Trigger using the
start_mlflow_ui()
API endpoint (runs on port5000
). - URL: http://127.0.0.1:5000
- Dependencies: MLFlow 2.13.2, Python 3.10, BentoML 1.2.16
Prediction Confidence Scores¶
- Tech Stack: Python 3.10, Scikit-learn
- Deployment: Returned as part of model prediction responses.
Model Monitoring (Drift Detection)¶
- API Endpoint:
POST /detect_drift
- Description: Activates drift detection using Jensen-Shannon Divergence.
- Input: Boolean flag (
true
to enable,false
to skip). - Output: Structured report detailing drift metrics and anomalies.
Federated Learning¶
- Tech Stack: Python 3.10, Flower FL, PyTorch
- Model: LSTM for time-series metrics (CPU, memory, power)
- Pipeline: Scaphandre → Prometheus → OpenTelemetry → dataClay
- Export Format: BentoML
- Deployment: Via Docker Compose, supporting multi-service orchestration
- Retraining: Supports periodic or on-demand loops based on data availability
AI Analytics Module – Deployment¶
AIOps with MLFlow¶
- Access: Launch via the
start_mlflow_ui()
API endpoint (port5000
) - URL: http://localhost:5000
- Dependencies: MLFlow 2.13.2, Python 3.10, BentoML 1.2.16
Model Compression¶
Compression options can be configured during model training by submitting a request to /core/analytics_train
with the parameters below:
{
"pytorch_model_parameters": {
"hidden_size": 64,
"num_epochs": 50,
"quantize": true,
"distill": false
}
}
Supported configurations include: - Quantization: Dynamic quantization applied post-training using PyTorch - Distillation: Trains a teacher-student model pair with a smaller student model - Combined: Applies distillation followed by quantization to produce an INT8-optimized model
Trained models (INT8 or FP32) are stored in the Intelligence Layer model registry.
System Requirements¶
The following packages and versions are required for successful deployment of the ICOS Intelligence Layer container:
Package Name | Version | Source/Info |
---|---|---|
bentoml | 1.2.16 | https://github.com/bentoml/BentoML |
dataclay | icos-ai-dataclay | https://github.com/bsc-dom/icos-ai-dataclay |
mlflow | 2.13.2 | https://mlflow.org/docs/2.13.2/index.html |
numpy | >=1.15.0,<1.25.2 | https://numpy.org/doc/stable/ |
pandas | >=1.4.3,<2.0.0 | https://pandas.pydata.org/docs/ |
seaborn | >=0.11.2,<=0.12.2 | https://github.com/mwaskom/seaborn |
matplotlib | 3.7.1 | https://matplotlib.org/3.7.1/index.html |
scikit-learn | 1.2.2 | https://scikit-learn.org/stable/whats_new/v1.2.html |
notebook | 6.5.1 | https://docs.jupyter.org/en/latest/ |
xgboost | 1.7.6 | https://xgboost.readthedocs.io/en/stable/ |
tqdm | 4.65.0 | https://tqdm.github.io/ |
pydantic | 1.10.10 | https://docs.pydantic.dev/latest/ |
scipy | 1.10.1 | https://docs.scipy.org/doc/scipy/ |
river | 0.14.0 | https://riverml.xyz/0.14.0/ |
tensorflow | 2.10.0 | https://github.com/tensorflow/tensorflow/releases/tag/v2.10.0 |
tflite | 2.10.0 | https://github.com/tensorflow/tflite-support/releases |
tensorflow_hub | 0.12.0 | https://github.com/tensorflow/hub/tree/r0.12 |
tensorflow_datasets | 4.7.0 | https://github.com/tensorflow/datasets/tree/v4.7.0 |
tensorflow-model-optimization | 0.7.3 | https://github.com/tensorflow/model-optimization/tree/v0.7.3 |
keras-tuner | 1.3.5 | https://github.com/keras-team/keras-tuner/tree/v1.3.5 |
statsmodels | 0.14.0 | https://github.com/statsmodels/statsmodels/tree/v0.14.0 |
fastapi | 0.93.0 | https://github.com/fastapi/fastapi/tree/0.93.0 |
category_encoders | 2.6.3 | https://github.com/scikit-learn-contrib/category_encoders/tree/2.6.3 |
shap | 0.46.0 | https://github.com/shap/shap/tree/v0.46.0 |
nannyml | 0.9.0 | https://github.com/NannyML/nannyml/tree/v0.9.0 |
torch | 2.0.0 | https://github.com/pytorch/pytorch/tree/v2.0.0 |