-
Notifications
You must be signed in to change notification settings - Fork 1
RPMeta Service Documentation
RPMeta provides a systemd service for running the prediction server as a background service. This document describes how to install, configure, and manage the service.
Disclaimer: The service is shipped only to Fedora.
The RPMeta server service is installed as part of the rpmeta-server package:
sudo dnf install rpmeta-serverThe service uses a configuration file located at /etc/rpmeta/config.toml. You can create or modify this file to customise the API server settings:
# Create or edit the configuration file
sudo vi /etc/rpmeta/config.tomlExample configuration options:
[api]
# Host to bind the server to
# Use "localhost" for local access only, "0.0.0.0" to allow external connections
host = "localhost"
# Port to run the server on
port = 9876
# Enable debug mode for more verbose output
debug = false
[logging]
# Log format
format = "[%(asctime)s] [%(levelname)s] [%(name)s]: %(message)s"
# Date format for logs
datefmt = "%Y-%m-%d %H:%M:%S"
# Log file location
file = "/var/log/rpmeta.log"The service also needs to specify the model data (path, name, categories) and the configuration file. This is configured via an environment file located at /etc/sysconfig/rpmeta.
The service expects model files to be installed in /usr/share/rpmeta/models/ or in the environment file:
- The model files themselves (trained using the
rpmeta-trainerpackage) - A
categories.jsonfile containing category data types
To use your own trained model:
- Train a model using the
rpmeta trainercommand - Copy the model and categories.json files to the appropriate location:
sudo mkdir -p /usr/share/rpmeta/models
sudo cp /path/to/your/models /usr/share/rpmeta/models/
sudo cp /path/to/your/categories.json /usr/share/rpmeta/models/This file allows you to customise the service parameters without directly modifying the service file.. The environment file contains these defaults:
| Parameter | Description | Default Value |
|---|---|---|
| MODEL_DIR | Path to the model directory | /usr/share/rpmeta/models |
| MODEL_NAME | Name of the model to use | lightgbm |
| CATEGORIES | Path to categories file | /usr/share/rpmeta/models/categories.json |
| CONFIG | Path to configuration file | /etc/rpmeta/config.toml |
| EXTRA_OPTS | Additional options to pass to the service | (empty) |
Works as you are used to a typical systemd service.
Once the service is running, you can test it by sending a prediction request:
curl -X POST http://localhost:9876/predict -H "Content-Type: application/json" -d '{
"package_name": "example-package",
"epoch": 0,
"version": "1.0.0",
"mock_chroot": "fedora-42-x86_64",
"hw_info": {
"cpu_model_name": "Intel Xeon Processor (Cascadelake)",
"cpu_arch": "x86_64",
"cpu_model": "85",
"cpu_cores": 6,
"ram": 15324520,
"swap": 8388604
}
}'If everything is working correctly, you should receive a response with a prediction value:
{
"prediction": 1234
}