{"id":20357875,"url":"https://github.com/gandi/ml-sacre","last_synced_at":"2025-07-18T14:36:06.594Z","repository":{"id":238217642,"uuid":"790344075","full_name":"Gandi/ML-SACRE","owner":"Gandi","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-05T01:56:20.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-04T17:50:27.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gandi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-22T17:54:48.000Z","updated_at":"2024-05-05T01:56:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b2007d0-1010-4415-a633-afa6d37db51a","html_url":"https://github.com/Gandi/ML-SACRE","commit_stats":null,"previous_names":["gandi/ml-sacre"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Gandi/ML-SACRE","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2FML-SACRE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2FML-SACRE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2FML-SACRE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2FML-SACRE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gandi","download_url":"https://codeload.github.com/Gandi/ML-SACRE/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2FML-SACRE/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265780537,"owners_count":23827278,"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":[],"created_at":"2024-11-14T23:24:18.485Z","updated_at":"2025-07-18T14:36:06.554Z","avatar_url":"https://github.com/Gandi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ML-SACRE\n\nThis project is the code support for the paper *ML-SACRE: Machine Learning-based Stable Auto-scaling of Cloud Resources with Efficiency*. It contains:\n- The code for the presented method, i.e. the ML-SACRE algorithm and its underlying machine learning models.\n- The code to run the presented simulation experiments from the paper and generate their results.\n\n## Setup\n### Requirements\n\n- [Python](https://www.python.org/downloads/) \u003e= 3.9\n- [Poetry](https://python-poetry.org/). It can be installed using:\n```\npip install poetry\n```\n\n### Installation\n\nBefore installing the project, make sure the [requirements](#requirements) are satisfied.\nThen, from the project root directory, run the following command:\n```\npoetry install\n```\nOptional (but recommended):\n```\npoetry shell\n```\nThis will activate a virtual environment to run project scripts in.\n\n## Running\n### Input\n\nAn example cofiguration can be found in [example_configuration.py](example_configuration.py). It is the configuration used for the simulations in the paper. The `input_dirpath` and `output_dirpath` fields need to be filled with real directory paths. The other parameters in the configuration can also be customized.\n\nTraining parameters for the time series and PPO agent models can be found (and modified) in the model files themselves: [models/time_series.py](ml_sacre/models/time_series.py) and [models/agent.py](ml_sacre/models/agent.py) respectively. The current parameters are those used in the paper.\n\nThe input directory specified in the configuration should contain 3 *.csv* files: `df_train.csv`, `df_validation.csv` and `df_test.csv`. The dataframe column names should contain a `Timestamp` column, as well as *Requested* and *Used* resource columns matching each resource item in the configuration file, along the following pattern: `[Resource name] Requested ([Resource unit])` and `[Resource name] Used ([Resource unit])`. The separator used is tab (`\\t`). For example:\n```\nTimestamp\tCPU Requested (%)\tRAM Requested (GB)\tCPU Used (%)\tRAM Used (GB)\n2023-12-04 00:50:00\t100\t17\t8\t5\n2023-12-04 01:00:00\t100\t17\t2\t5\n2023-12-04 01:10:00\t100\t17\t6\t5\n2023-12-04 01:20:00\t100\t17\t2\t5\n...\n```\n\n### Running an experiment (simulation batch)\n\nTo run a set of simulations, prepare the [inputs](#input) as described above, and update the configuration file path in the main file [main.py](ml_sacre/main.py). Then run the main script:\n```\npython main.py\n```\n\n### Outputs\n\nThe output directory as set in the configuration file will contain all results and corresponding plots for each experiment trial (set of simulations), as well as aggregated results and plots.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgandi%2Fml-sacre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgandi%2Fml-sacre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgandi%2Fml-sacre/lists"}