{"id":17667477,"url":"https://github.com/josepsampe/micro-controllers","last_synced_at":"2026-05-03T04:34:28.906Z","repository":{"id":104619747,"uuid":"106851371","full_name":"JosepSampe/micro-controllers","owner":"JosepSampe","description":"Software-defined data management framework for OpenStack Swift","archived":false,"fork":false,"pushed_at":"2019-08-31T10:52:25.000Z","size":44363,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T14:42:37.066Z","etag":null,"topics":["micro-controller","middleware","openstack","openstack-swift","policies","smart-data","storage","swift"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JosepSampe.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":"2017-10-13T17:00:57.000Z","updated_at":"2020-07-02T11:28:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"74196d77-833a-435a-9014-5f99c82aed30","html_url":"https://github.com/JosepSampe/micro-controllers","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/JosepSampe%2Fmicro-controllers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosepSampe%2Fmicro-controllers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosepSampe%2Fmicro-controllers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosepSampe%2Fmicro-controllers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JosepSampe","download_url":"https://codeload.github.com/JosepSampe/micro-controllers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246320192,"owners_count":20758410,"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":["micro-controller","middleware","openstack","openstack-swift","policies","smart-data","storage","swift"],"created_at":"2024-10-23T22:07:30.427Z","updated_at":"2026-05-03T04:34:26.875Z","avatar_url":"https://github.com/JosepSampe.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Micro-controllers\nMicro-controllers enable tenants to manage the singularities of the objects in a flexible way. Thus, a micro-controller is a data behavior or management policy that is associated to one or more objects, and to one or more storage operations.\nMicro-controllers act as object wrappers that control objects behavior. It is for this reason that we introduce the concept of **smart objects** in cloud object stores.\nMicro-controllers follow the active storage approach, that is, they are executed close to the data within the storage infrastructure, but in a sandboxed environemnt by using Dockers.\n\nA micro-controller is a piece of code (Java) that can manage the associated objects. Thus, the programmability that micro-controllers provide allows tenants to create advanced forms of object control. There are two different types of micro-controllers: **synchronous** and **asynchronous**. A synchronous micro-controller blocks the incoming or outcoming request until it completes the execution. In the synchronous model, micro-controllers are executed in real-time, which means that the lifecycle of objects is intercepted. In contrast, asynchronous micro-controllers are event-driven, that is, they run when an event occurs. The request that triggered the event does not wait for their completion.\n\n## Framework\nThis implementation of micro-controllers is designed for OpenStack Swift. This framework is called **Vertigo**, and it includes an interception middleware for Swift, and an execution engine that puts into execution the micro-controllers in a sand-boxed environment.\n\n## Installation\n\n### All-In-One Machine\nFor testing purposes, it is possible to install an All-In-One (AiO) machine with all the Crystal components and requirements.\nWe prepared a script for automating this task. The requirements of the machine are a clean installation of **Ubuntu Server 18.04**, at least **2GB** of RAM, and a **fixed IP address**. It is preferable to upgrade the system to the latest versions of the packages with `apt update \u0026\u0026 apt dist-upgrade` before starting the installation, and set the server name as `controller` in the `/etc/hostname` file. Then, download the `aio_u18_rocky.sh` script and run it as sudo:\n\n```bash\ncurl -fsSL https://git.io/fjfRz | sudo bash /dev/stdin install\n```\n\nThe script first installs Keystone, Swift and Horizon (Pike release), then it proceeds to install the micro-controllers framework package (Vertigo). Note that the script uses weak passwords for the installed services, so if you want more secure services, please change them at the top of the script.\n\nBy default, the script has low verbosity. To see the full installation log, run the following command in another terminal:\n\n```bash\ntail -f /tmp/vertigo_aio_installation.log\n```\n\nThe script takes long to complete (~10 minutes) (it depends of the network connection). Once completed, you can access to the dashboard by typing the following URL in the web browser: `http://\u003cnode-ip\u003e/horizon`.\n\nIf you already ran the installation script, you can update micro-controllers framework from this repository by the following command:\n\n```bash\ncurl -fsSL https://git.io/fjfRz | sudo bash /dev/stdin update\n```\n\n## Verify\n### Test Swift\nTo verify the correct operation of the Swift installation, follow these steps:\n\n1- Load credentials:\n```bash\nsource vertigo-openrc\n```\n\n2- Create data bucket:\n```bash\nswift post data\n```\n\n3- Create new .json file and upload it to data bucket:\n```bash\nvi test.json\nswift upload data test.json\n```\n\n4- Test if you can download the .json file:\n```bash\nswift download data test.json\nor\ncurl -H \"X-Auth-Token:$TOKEN\" $STORAGE_URL/data/test.json\n```\n\n### Test Storlets\n1- Download the .json file, running the No-operation Storlet:\n```bash\nswift download data test.json -H \"X-Run-Storlet:noop-1.0.jar\"\n```\n\n2- Download the .json file, running the Compression Storlet:\n```bash\ncurl -H \"X-Auth-Token:$TOKEN\" $STORAGE_URL/data/test.json -H \"X-Run-Storlet:compress-1.0.jar\" -o test.gz\ngunzip test.gz\n```\n\n### Test Micro-controllers\n1- Assign the No-operation micro-controller to the .json file upon GET requests:\n```bash\ncurl -H \"X-Auth-Token:$TOKEN\" $STORAGE_URL/data/test.json -X POST -H \"X-Vertigo-onGet:noop-1.0.jar\"\n```\n\n2- Download the .json file that will put into execution the micro-controller:\n```bash\nswift download data test.json\nor\ncurl -H \"X-Auth-Token:$TOKEN\" $STORAGE_URL/data/test.json\n```\n\n3- Delete the No-operation micro-controller:\n```bash\ncurl -H \"X-Auth-Token:$TOKEN\" $STORAGE_URL/data/test.json -X POST -H \"X-Vertigo-onGet-Delete:noop-1.0.jar\"\n```\n\n4- Assign the Counter micro-controller to the .json file upon GET requests:\n```bash\ncurl -H \"X-Auth-Token:$TOKEN\" $STORAGE_URL/data/test.json -X POST -H \"X-Vertigo-onGet:counter-1.0.jar\"\n```\n\n5- Download the .json file that will put into execution the micro-controller:\n```bash\nswift download data test.json\nor\ncurl -H \"X-Auth-Token:$TOKEN\" $STORAGE_URL/data/test.json\n```\n\n6- The Counter micro-controller adds into the object metadata an access counter and the last access timestamp. Verify the correct execution of the micro-controller by running the following command:\n```bash\nswift stat data test.json\n```\n\n### Usage\nNext we describe the base micro-controller skeleton:\n\n```java\npackage com.urv.microcontroller.default;\n\nimport com.urv.vertigo.api.Api;\nimport com.urv.vertigo.context.Context;\nimport com.urv.vertigo.microcontroller.IMicrocontroller;\n\npublic class DefaultHandler implements IMicrocontroller {\n\n\tpublic void invoke(Context ctx, Api api) {\n\t\t# Micro-controller code\n\t}\n\n}\n```\n\nThe `invoke` method is the entry point of the micro-controller. It has 2 main parameters: The `Context ctx` and the `Api api`.\n\n**Context ctx** class contains these subclasses:\n\n|Class|Description|\n|---|---|\n|ctx.logger| Access to the log.|\n|ctx.microcontroller| Access to the micro-controller parameters |\n|ctx.request| Access to the request metadata |\n|ctx.object| Access to the object metadata |\n\n\n**Api api** class contains these subclasses:\n\n|Class|Description|\n|---|---|\n|api.storlet| Set and run a list of Storlets |\n|api.swift| Access to the Swift cluster |\n|api.redis| Jedis client instance |\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosepsampe%2Fmicro-controllers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosepsampe%2Fmicro-controllers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosepsampe%2Fmicro-controllers/lists"}