{"id":22914228,"url":"https://github.com/suse/phoebe","last_synced_at":"2025-05-12T13:43:42.589Z","repository":{"id":52260086,"uuid":"327006970","full_name":"SUSE/phoebe","owner":"SUSE","description":"Phoebe","archived":false,"fork":false,"pushed_at":"2021-05-24T15:17:18.000Z","size":1508,"stargazers_count":88,"open_issues_count":1,"forks_count":14,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-03-26T18:54:38.549Z","etag":null,"topics":["artificial-intelligence","auto-tuning","linux","machine-learning","self-healing","systems"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SUSE.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-05T13:27:58.000Z","updated_at":"2024-10-04T22:50:16.000Z","dependencies_parsed_at":"2022-09-10T04:34:45.753Z","dependency_job_id":null,"html_url":"https://github.com/SUSE/phoebe","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SUSE%2Fphoebe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SUSE%2Fphoebe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SUSE%2Fphoebe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SUSE%2Fphoebe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SUSE","download_url":"https://codeload.github.com/SUSE/phoebe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253749604,"owners_count":21958150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","auto-tuning","linux","machine-learning","self-healing","systems"],"created_at":"2024-12-14T05:14:04.681Z","updated_at":"2025-05-12T13:43:42.563Z","avatar_url":"https://github.com/SUSE.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phoeβe\n\n![CI](https://github.com/SUSE/phoebe/workflows/CI/badge.svg)\n\n\n## Idea\n\nPhoeβe (/ˈfiːbi/) wants to add basic artificial intelligence capabilities to the Linux OS.\n\n\n## What problem Phoeβe wants to solve\n\nSystem-level tuning is a very complex activity, requiring the knowledge and expertise of several (all?) layers which compose\nthe system itself, how they interact with each other and (quite often) it is required to also have an intimate knowledge of\nthe implementation of the various layers.\n\nAnother big aspect of running systems is dealing with failure. Do not think of failure as a machine turning on fire rather as\nan overloaded system, caused by misconfiguration, which could lead to starvation of the available resources.\n\nIn many circumstances, operators are used to deal with telemetry, live charts, alerts, etc. which could help them identifying\nthe offending machine(s) and (re)act to fix any potential issues.\n\nHowever, one question comes to mind: wouldn't it be awesome if the machine could auto-tune itself and provide a self-healing\ncapability to the user? Well, if that is enough to trigger your interest then this is what Phoeβe aims to provide.\n\nPhoeβe uses system telemetry as the input to its \u003ci\u003ebrain\u003c/i\u003e and produces a big set of settings which get applied to the\nrunning system. The decision made by the \u003ci\u003ebrain\u003c/i\u003e is continuously reevaluated (considering the \u003ci\u003egrace_period\u003c/i\u003e setting)\nto offer eventually the best possible setup.\n\n\n## Architecture\n\nPhoeβe is designed with a plugin architecture in mind, providing an interface for new functionality to be added with ease.\n\nPlugins are loaded at runtime and registered with the main body of execution. The only requirement is to implement the interface dictated by the structure *plugin_t*. The **network_plugin.c** represents a very good example of how to implement a new plugin for Phoeβe.\n\n\u003cimg src=\"https://github.com/SUSE/phoebe/blob/main/imgs/phoebe.png\"\u003e\n\n\n## Disclaimer\n\nThe mathematical model implemented is a super-basic one, which implements a *machine-learning 101* approach:\n**input * weight + bias**. It does not use any fancy techniques and the complexity is close to zero.\n\nThe plan is to eventually migrate towards a model created in Tensorflow and exported so to be used by Phoeβe, but\nwe are not there yet.\n\n\n## 10,000 feet view\n\nThe code allows for both **training** and **inference:** — all the knobs which can\nmodify the run-time behavior of the implementation are configurable via the *settings.json* file,\nwhere each parameter is explained in detail.\n\n\nFor the inference case, when a match is found, then the identified kernel parameters are configured accordingly.\n\nThe inference loop runs every N seconds and the value is configurable via the **inference_loop_period**.\nDepending on how quick we want the system to react to a situation change, then the value given to the\n**inference_loop_period** will be bigger or smaller.\n\nThe code has a dedicated stats collection thread which periodically collects system statistics and populates structures\nused by the inference loop. The statistics are collected every _N_ seconds, and this value is configurable via the\n**stats_collection_period**. Depending on the overall network demands, the value of\n**stats_collection_period** will be bigger or smaller to react slower or quicker to network events.\n\n\nIn case a high traffic rate is seen on the network and a matching entry is found, then the code will not consider\nany lower values for a certain period of time: the value is configurable via the **grace_period** in\nthe *settings.json* file.\n\nThat behavior has been implemented to avoid causing too much reconfiguration on the system and to prevent\nsudden system reconfiguration due to network spikes.\n\nThe code also supports few approximation functions, also available via the *settings.json* file.\n\nThe approximation functions can tune the tolerance value - runtime calculated - to further allow the user for fine\ntuning of the matching criteria. Depending on the approximation function, obviously, the matching criteria could be\nnarrower or broader.\n\n\n## Settings\n\nBelow is a detailed an explanation of what configurations are available in settings.json, the possible values and what effect they have. (Note that this is not really valid JSON; please remove the lines with double-forward-slashes if you use it.)\n\n```jsonc\n{\n    \"app_settings\": {\n\n        // path where application is expecting to find plugins to load\n        \"plugins_path\": \"/home/mvarlese/REPOS/phoebe/bin\",\n\n        // max_learning_values: number of values learnt per iteration\n        \"max_learning_values\": 1000,\n\n        // save trained data to file every saving_loop value\n        \"saving_loop\": 10,\n\n        // accuracy: the level of accuracy to find a potential entry\n        // given the transfer rate considered.\n        //\n        // MaxValue: Undefined, MinValue: 0.00..1\n        // Probably not very intuitive: a higher number correspondes to\n        // a higher accuracy level.\n        \"accuracy\": 0.5,\n\n        // approx_function: the approximation function applied\n        // to the calculated tolerance value used to find a\n        // matching entry in values.\n        //\n        // Possible values:\n        // 0 = no approximation function\n        // 1 = square-root\n        // 2 = power-of-two\n        // 3 = log10\n        // 4 = log\n        \"approx_function\": 0,\n\n        // grace_period: the time which must be elapsed\n        // before applying new settings for a lower\n        // transfer rate than the one previously measured.\n        \"grace_period\": 10,\n\n        // stats_loop_period: the cadence of time which\n        // has to be elapsed between stats collection.\n        // It is expressed in seconds but it accepts non-integer\n        // values; ie. 0.5 represents half-second\n        \"stats_collection_period\": 0.5,\n\n        // inferece_loop_period: the time which must be\n        // elapsed before running a new inference evaluation\n        \"inference_loop_period\": 1\n\n    },\n\n    \"labels\": {\n        // geography: valid options are EMEA, NA, LAT, APAC, NOT_SET\n        \"geography\": \"NOT_SET\",\n        // business: valid options are RETAIL, AUTOMOTIVE, SERVICE, NOT_SET\n        \"business\": \"NOT_SET\",\n        // behavior: valid options are THROUGHPUT, LATENCY, POWER\n        \"behavior\": \"THROUGHPUT\"\n    },\n\n    \"weights\":{\n        \"transfer_rate_weight\": 0.8,\n        \"drop_rate_weight\" : 0.1,\n        \"errors_rate_weight\" : 0.05,\n        \"fifo_errors_rate_weight\" : 0.05\n    },\n\n    \"bias\": 10\n}\n```\n\n## Building and installation.\n\nSee [BUILDING.md](BUILDING.md) for build instructions. Packages for various distributions can be found in the [OpenBuild service](https://build.opensuse.org/package/show/science:machinelearning/phoebe).\n\n## Running\nThe code supports multiple mode of operation:\n\n* Training mode:\n```ShellSession\n./build/src/phoebe -f ./csv_files/rates.csv -m training -s settings.json\n```\n\n* Inference\n```ShellSession\n./build/src/phoebe -f ./csv_files/rates_trained_data.csv -i wlan0 -m inference -s settings.json\n```\n\n\n## Feedback / Input / Collaboration\n\u003cp\u003e\nIf you are curious about the project and want more information, please, do reach out to \u003ca href=\"mailto:marco.varlese@suse.com\"\u003emarco.varlese@suse.com\u003c/a\u003e.\u003cbr\u003e\nI will be more than happy to talk to you more about this project and what other initiatives are in this area.\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuse%2Fphoebe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuse%2Fphoebe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuse%2Fphoebe/lists"}