kepler-model-server
kepler-model-server copied to clipboard
Model Server for Kepler
Kepler Power Model
Get started with Kepler Model Server.
This repository contains source code related to Kepler power model. The modules in this repository connects to core Kepler project and kepler-model-db as below.
For more details, check the component diagram.
Model server and estimator deployment
Using Kepler Operator
apiVersion: kepler.system.sustainable.computing.io/v1alpha1
kind: KeplerInternal
metadata:
name: kepler
spec:
..
modelServer:
enabled: <true|false>
estimator:
node:
components:
sidecar: <true|false>
initUrl: <static model URL>
total:
sidecar: <true|false>
initUrl: <static model URL>
Using manifests with setup script:
Deploy with estimator sidecar
OPTS="ESTIMATOR" make deploy
Deploy with estimator sidecar and model server
OPTS="ESTIMATOR SERVER" make deploy
Model Training
- Use Tekton pipeline
- Use Bash script with CPE operator
Local test
via docker
-
Build image for testing, run
make build-test
-
Run the test
Test case Command Training pipeline make test-pipeline Model server make test-model-server Estimator make test-estimator Offline Trainer make test-offline-trainer For more test information, check here.
with native python environment
Compatible version: python 3.8
-
Prepare environment
pip install -r ../dockerfiles/requirements.txt
-
Run the test
Test case Command Training pipeline python -u ./tests/pipeline_test.py Model server Terminal 1: export MODEL_PATH=$(pwd)/tests/models;python src/server/model_server.py
Terminal 2: python -u tests/estimator_model_request_test.pyEstimator Terminal 1: python src/estimate/estimator.py
Terminal 2: python -u tests/estimator_power_request_test.pyEstimator with Model Server Terminal 1: export MODEL_PATH=$(pwd)/tests/models;python src/server/model_server.py
Terminal 2: export MODEL_SERVER_URL=http://localhost:8100;export MODEL_SERVER_ENABLE=true;python -u src/estimate/estimator.py
Terminal 3: python -u tests/estimator_power_request_test.pyOffline Trainer Terminal 1: python src/train/offline_trainer.py
Terminal 2: python -u tests/offline_trainer_test.pyFor more test information, check here.
Contributing
Please check the roadmap and guidelines to join us here.