{"id":15056974,"url":"https://github.com/ds2-lab/alps","last_synced_at":"2025-10-10T22:12:50.086Z","repository":{"id":242412974,"uuid":"802612153","full_name":"ds2-lab/ALPS","owner":"ds2-lab","description":"ALPS: An Adaptive Learning, Priority OS Scheduler for Serverless Functions (USENIX ATC'24)","archived":false,"fork":false,"pushed_at":"2024-06-20T17:45:00.000Z","size":34225,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T05:08:47.361Z","etag":null,"topics":["ebpf","faas","os","scheduling","serverless"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ds2-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-05-18T19:26:24.000Z","updated_at":"2024-11-26T17:02:32.000Z","dependencies_parsed_at":"2025-02-16T14:48:55.871Z","dependency_job_id":null,"html_url":"https://github.com/ds2-lab/ALPS","commit_stats":null,"previous_names":["ds2-lab/alps"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ds2-lab%2FALPS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ds2-lab%2FALPS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ds2-lab%2FALPS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ds2-lab%2FALPS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ds2-lab","download_url":"https://codeload.github.com/ds2-lab/ALPS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161271,"owners_count":21057555,"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":["ebpf","faas","os","scheduling","serverless"],"created_at":"2024-09-24T21:59:37.547Z","updated_at":"2025-10-10T22:12:45.054Z","avatar_url":"https://github.com/ds2-lab.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ALPS: An Adaptive-Learning, Priority OS Scheduler for Serverless Functions\n\n\u003cimg src=\"./figure/ALPS.jpg\" height=\"30%\"\u003e\n\n## Overview\n\nWelcome to ALPS scheduler project. Our innovative kernel scheduler is designed to enhance the performance of Function-as-a-Service (FaaS) workloads, which are known for their ephermeral, highly concurrent, and bursty nature. Existing OS schedulers, such as Linux Completely Fair Scheduler (CFS), often fail to meet the unique demands of serverless functions, particularly those with short execution time. ALPS addresses this challenge by approximating the principles of the Shortest Remaining Process Time (SRPT) with the robust framework on CFS, delivering a dynamic, application-aware OS scheduling solution.\n\n\u003cimg src=\"https://sysartifacts.github.io/images/usenix_available.svg\" alt=\"drawing\" width=\"100\"/\u003e \u003cimg src=\"https://sysartifacts.github.io/images/usenix_functional.svg\" alt=\"drawing\" width=\"100\"/\u003e \u003cimg src=\"https://sysartifacts.github.io/images/usenix_reproduced.svg\" alt=\"drawing\" width=\"100\"/\u003e\n\n## Getting Started Instructions\n\n\u003cfont color=blue\u003e For ATC'24 Artifact review, to save reviewers’ effort, we strongly recommend that reviewers use our dedicated development machine. We will provide support to ensure that reviewers have full access to the machine throughout the artifact review process.\u003c/font\u003e\n\n[![DOI](https://zenodo.org/badge/798944569.svg)](https://zenodo.org/doi/10.5281/zenodo.11181953)\n\n### Operating System required\n\nWe have implemented ALPS based on Linux kernel version 5.18-rc5. You must compile and run the *ALPS* on the the [kernel](https://github.com/fishercht1995/linux.git). We recommend build the kernel based on Ubuntu 22.04 LTS. \n\n### Software Required\n\nThe exact software used to build *ALPS* as follows:\n\n- gcc \n    - version: 11.4\n- go\n    - version: 1.21.10\n- bpftool\n    - version: 5.14.0\n- schedtool\n    - version 1.3.0\n\nIn addition, We modify and provide exact softwares binaries to run FaaS service. \n \n- Docker\n    - Docker client\n        - version: 20.10.25\n    - dockerd\n        - version: 20.10.25\n    - runc\n        - version: 1.1.10\n    -  containerd:\n        - version 1.6.24\n- OpenLambda:\n    - commmit hash: 92fbdfe\n   \n### Step-by-Step Installation\n\n#### gcc installation\n```\napt update -y\nsudo apt install build-essential\ngcc --version \n```\n\n#### go installtion\nDownload the Go language binary archive\n```\nwget https://go.dev/dl/go1.21.10.linux-amd64.tar.gz\nsudo tar -xvf go1.12.linux-amd64.tar.gz\nsudo mv go /usr/local\n```\nSetup Go environment, including `GOROOT` and `GOPATH`. Add environment variables to the `~/.profile`.\n```\nexport GOROOT=/usr/local/go\nmkdir $HOME/project\nexport GOPATH=$HOME/project\nexport PATH=$GOPATH/bin:$GOROOT/bin:$PATH\n```\nVerify installation\n```\n~$ go version\n~$ go version go1.21.10 linux/amd64\n```\n#### bpftool\nClone bpftool repository and build following [installation instruction](https://github.com/libbpf/bpftool/blob/main/README.md)\n```\ngit clone --recurse-submodules https://github.com/libbpf/bpftool.git\n```\n#### schedtool\nInstall schedtool by apt\n```\nsudo apt-get update -y\nsudo apt-get install -y schedtool\n```\n### Docker\nClone *ALPS* repository and copy docker binaries to `/usr/sbin`\n```\ngit clone https://github.com/fishercht1995/ALPS.git\ncd docker_binaries\ncp binary-client/* /usr/bin/\ncp binary-daemon/* /usr/bin/\n```\n#### OpenLambda\nBuild OL worker image\n```\ncd experiments \u0026\u0026 make imgs/lambda\n```\nWe modify openlambda to support *ALPS* JSON configuration schema. We provide the `ol` binary and an example of configuration file at `experiments/`. In addition to OL configuration, *ALPS* allows user to define function meta to distinguish scheduling in the kernel as follow:\n```\n\"seal_priority\": \"Function UID\",\n\"function_name\" : \"Function Name\",\n``` \n### Hello-Word Example\n\nStart Docker service\n```\ncd experiments \u0026\u0026 ./docker.sh\n```\nRun *ALPS* frontend scheduler \n```\ncd frontend \u0026\u0026 python main.py\n```\nBuild and Run *AlPS* backend\n```\nmv LINUX_SOURCE /Linux\ncd backend\nmake bpf \u0026\u0026 make alps\n./alps.o\n```\nRun Openlambda\n```\ncd experiments \u0026\u0026 ./ol worker --path={PATH}\n```\nNow invoke your lambda\n```\ncurl -X POST http://localhost:5002/run/fib \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"n\":\"30\", \"id\":\"20\", \"job\":\"fib\"}'\n``` \n## Detailed Instructions\nTo test performance of *ALPS*, we provides some helper scripts, firstly, start and delete multiple functions:\n```\ncd experiments\n./init_function.sh # init functions\n./delete_function.sh # delete function workers\n```\nThen start frontend and backend. \n```\ncd frontend \u0026\u0026 python3 main.py --alpha 1 --beta 1 --ml avg --exp_result ../experiments/seals\ncd backend \u0026\u0026 ./alps.o\n```\nSubmit benchmark request by http client\n```\ngo build run.go\ncd http_client \u0026\u0026 ./test.sh \n```\n### Ablation Study\nThe frontend scheduler offer two parameter to control policy fine-tuning. By defauly, policy fine-tuning is enable\n```\npython3 main.py\n```\nAnd users can disable unpredictability finetuning and overload finetuning by\n```\npython3 main.py --unpred --overload \n```\n\n### Sensitivity Analysis\nUsers can control policy parameters \n```\npython3 main.py --alpha 1 --beta 1 --theta 50 --gamma 1\n```\nUsers can also change machine learning methods by\n```\npython3 main.py --ml avg\npython3 main.py --ml LR\n```\n\n### Test for different workloads\nTo test different trace workloads, replace the workload file (exp) in the *http_client* folder. By default, the workload is generated by Huawei trace, and we offer an Azure-generated workload (azure) in the same folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fds2-lab%2Falps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fds2-lab%2Falps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fds2-lab%2Falps/lists"}