{"id":19928544,"url":"https://github.com/nareddyt/cs4365-task-offload-framework","last_synced_at":"2025-05-03T10:31:17.014Z","repository":{"id":37594912,"uuid":"171153237","full_name":"nareddyt/cs4365-task-offload-framework","owner":"nareddyt","description":"A framework for IoT devices to offload tasks to the cloud, resulting in efficient computation and decreased cloud costs.","archived":false,"fork":false,"pushed_at":"2022-06-21T21:50:42.000Z","size":49165,"stargazers_count":28,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-03T08:52:15.543Z","etag":null,"topics":["cloud","framework","iot","offloading"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nareddyt.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}},"created_at":"2019-02-17T17:54:02.000Z","updated_at":"2025-03-21T16:08:10.000Z","dependencies_parsed_at":"2022-09-01T09:12:21.988Z","dependency_job_id":null,"html_url":"https://github.com/nareddyt/cs4365-task-offload-framework","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareddyt%2Fcs4365-task-offload-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareddyt%2Fcs4365-task-offload-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareddyt%2Fcs4365-task-offload-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareddyt%2Fcs4365-task-offload-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nareddyt","download_url":"https://codeload.github.com/nareddyt/cs4365-task-offload-framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252178716,"owners_count":21707047,"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":["cloud","framework","iot","offloading"],"created_at":"2024-11-12T22:37:33.823Z","updated_at":"2025-05-03T10:31:13.836Z","avatar_url":"https://github.com/nareddyt.png","language":"Python","readme":"# Efficient IoT Compute Allocation Framework\n\n[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n\n\u003e A framework for IoT devices to offload tasks to the cloud, resulting in efficient computation and decreased cloud costs.\n\n## Table of Contents\n\n- [Background](#background)\n- [Code Structure](#code-structure)\n- [Prerequisites](#prerequisites)\n- [Install](#install)\n- [Usage](#usage)\n- [Maintainers](#maintainers)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Background\n\nMany IoT devices lack the compute resources to process and analyze data locally. This is not ideal, as most data collected by IoT devices is either noisy or requires computation to extract useful information. A common solution recommended by major cloud providers, such as AWS and GCP, is to send all raw data directly to the cloud. This allows data processing to be auto-scaled to the rate at which data is collected. Unfortunately, this leads to underutilization of the CPU onboard the IoT device. In large-scale deployments of hundreds of IoT devices, collectively making use of all CPU resources could reduce the cost of cloud processing by a large factor.\n\nWe implemented a framework that can efficiently use the maximal amount of compute resources on the IoT device while still maintaining a high throughput of data processing. Such a framework would allow data processing to be run directly on the IoT device, but would automatically offload data processing tasks to the cloud when throughput expectations are not met. By making maximal use of local compute resources on the IoT device, this framework reduces the cost of data processing on the cloud, while still allowing tasks to be offloaded to the cloud if greater throughput is required.\n\n_See our CS 4365 [Final Report](https://docs.google.com/document/d/1Dh7aKAofPXTKovecV3e-9cyr0K4ERvkXMdTNScChcp8/edit?usp=sharing) for more details._\n\n## Code Structure\n\nOur framework is designed to work with any IoT application that follows the **Task Interface**.\nOur final report contains more information on the design of the **Task Interface**.\n`task_interface_example.py` provides a explanation of the **Task Interface** via example code.\n\nFor the performance evaluation and demo, we have provided 1 example IoT application in the `ball_tracking_example` folder.\n`ball_tracking_example/sequential.py` contains the original IoT example application found in [a blog post](https://www.pyimagesearch.com/2015/09/14/ball-tracking-with-opencv/) online.\n`ball_tracking_example/taskified.py` contains the modified IoT application that adheres to the **Task Interface**.\n\n`iot_client_coordinator.py` contains the framework code that runs on the IoT device. This is responsible for:\n\n- Collecting data from the IoT sensors (_example: camera_)\n- Running tasks on the IoT device\n- Collecting metrics on IoT device load\n- Offload tasks to the server when required (_The Automatic Scheduler_)\n\n`cloud_server_coordinator.py` contains the framework code that runs on the cloud server. This is responsible for:\n\n- Receiving tasks from the IoT device\n- Running the remaining tasks on the server\n- Reporting results of computation\n\n## Prerequisites\n\nThis project was implemented using `Python 3.7`.\nThis project should still run on other minor versions of `Python 3`, but we provide no guarantees.\n\n`pip` is required to install python dependencies.\n\n### Optional Requirements\n\nTo realistically calculate metrics, the following are required:\n- A IoT device with Python Support (Raspberry Pi Zero)\n- Compute resources on a cloud provider with Python support (GCP Compute Engine)\n\n**These are optional:** The IoT device and Cloud server can be run in two separate processes on a single development machine.\n\n## Install\n\nRun the following from the root folder:\n\n```bash\npip install -r requirements.txt \n```\n\n## Usage\n\nThis section describes multiple usage scenarios.\n\n### IoT Client Only\n\nFor debug/demo purposes, we can run all tasks on the client only. \nAll computation will happen locally, and the IoT client will never connect to the cloud server.\nThis run configuration does not represent the intended use-case.\n\n```bash\npython3 iot_client_coordinator.py\n```\n\n### IoT Client Offloading to Cloud Server\n\nTo support offloading tasks to the cloud, the server must be run on a static IP address in the cloud:\n\n```bash\npython3 cloud_server_coordinator.py\n```\n\nPlease make note of the static IP address for the remaining run configurations.\nWhen running the IoT Client (in a new terminal session), \nset the `HOST` environment variable to this static IP address. Examples:\n\n```bash\nexport HOST='localhost'         # When running server locally for testing\nexport HOST='35.190.176.6'      # Realistic server in the cloud\n```\n\n_Note_: In this example, there are a total of 7 tasks.\n\n_Note_:\nThe first task must always run on the IoT Client, as it collects sensor data from the IoT device.\nThe last task must always run on the Cloud Server, as it aggregates data across sensors.\n\n#### IoT Manual Configuration Mode\n\n_Manual Configuration Mode_ only runs a specific, pre-set number of tasks on the IoT Client.\nThe remainder of the tasks are run on the Cloud Server.\n\nPass in an argument with the number of tasks to run on the IoT client. Examples:\n\n```bash\npython3 iot_client_coordinator 1    # Run only the first task locally\npython3 iot_client_coordinator 6    # Run all but the last task locally\npython3 iot_client_coordinator 3    # Run the first 3 tasks locally\n```\n\n#### IoT Automatic Configuration Mode\n\n_Automatic Configuration Mode_ starts off like _manual configuration mode_,\nbut automatically re-adjusts the number of tasks offloaded to the cloud server\nin order to meet the expected throughput.\n\nIn addition to the argument for _manual configuration mode_,\nthe expected throughput must also be configured via the arguments.\n\n```bash\npython3 iot_client_coordinator 6 17     # Start running 6 tasks locally, but re-adjust to meet 17 FPS\npython3 iot_client_coordinator 4 28     # Start running 4 tasks locally, but re-adjust to meet 28 FPS\n```\n\n## Maintainers\n\n[@nareddyt](https://github.com/nareddyt)\n[@rishiy15](https://github.com/rishiy15)\n\n## Contributing\n\nIf editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\nMIT © 2019 Tejasvi Nareddy\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnareddyt%2Fcs4365-task-offload-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnareddyt%2Fcs4365-task-offload-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnareddyt%2Fcs4365-task-offload-framework/lists"}