{"id":22340044,"url":"https://github.com/mandelsoft/engine","last_synced_at":"2025-03-26T09:15:03.733Z","repository":{"id":241128209,"uuid":"742195583","full_name":"mandelsoft/engine","owner":"mandelsoft","description":"Request engine","archived":false,"fork":false,"pushed_at":"2024-05-22T14:32:31.000Z","size":4676,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-22T15:44:13.689Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/mandelsoft.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-01-12T00:20:30.000Z","updated_at":"2024-06-19T03:58:29.674Z","dependencies_parsed_at":null,"dependency_job_id":"b4a3bc00-588d-4dd0-ba77-863eb7a1ad3a","html_url":"https://github.com/mandelsoft/engine","commit_stats":null,"previous_names":["mandelsoft/engine"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandelsoft%2Fengine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandelsoft%2Fengine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandelsoft%2Fengine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandelsoft%2Fengine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mandelsoft","download_url":"https://codeload.github.com/mandelsoft/engine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245623078,"owners_count":20645680,"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-12-04T07:10:13.139Z","updated_at":"2025-03-26T09:15:03.702Z","avatar_url":"https://github.com/mandelsoft.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## An Egine to process Flow Graphs described by Resource Manifests\n\nThis project provides a controller working on an\nobject space, which processes a flow graph described by resource\nobjects stored in the object space.\n\nThe graph is an instance of a graph metamodel, which is passed\nto the controller. The controller itself provides a metamodel\nused to describe graph metamodels.\n\n![engine metamodel](images/engine-metamodel.png)\n\nA graph metamodel defines the node types (whose instances\nare stored in the object space) and the potential dependencies\namong instances of such types.\n\nA concrete model with dedicated instances, their types and\ndependencies is then stored in the objectspace.\n\nThe processing is based on a model of shadow elements, which\nimplement the concrete processing steps.\nThey are wrapping persistent objects stored in the object space.\n\nThere are the user facing defining object types (external objects),\nwhich describe the desired state of the processing graph.\n\nEvery external object is typically shadowed by an internal (state) \nobject, which keeps the processing state.\n\nOn top of those persistent objects, the programming\nmodel uses implementation objects, which must be provided \nby an implementation of the graph metamodel.\nThose objects are instantiated by the engine in memory and must implement\nthe engine interface. They are used by the engine to provide\nstandardized information, like the external desired state,\nor the dependency information. And they execute the payload\nrelated processing steps. The flow control is completely done\nby engine. \n\n![architecture](images/architecture.png)\n\nThe processing of an internal object is divided into one or more\nprocessing phases. Every phase has the same interface towards the\nengine:\n- provide current state\n- accepting target state from a triggering external object\n- providing dependency information according to current and target\n  state\n- providing a processing step (which might provide incremental progress)\n- providing an output state after successful processing.\n\nThe engine then handles the dataflow among the\nprocessing graph defined by the current and target state\nof the phases and their dependencies. The output of input dependencies\nis provided to the processing, and if it is successful the output\nof the processing is again used as input for dependent phases.\n\nEvery external object has an assigned internal object (which is created by engine on demand), which handles the concrete processing.\nTherefore, changes on the external object trigger the processing of\na phase of the internal object. Multiple phases might be provided\nby the internal object, which feature different dependencies.\n\nThereby, three kinds of relations between an external and\nan internal (state carrying) objects are supported:\n1) Every external object is used to control the life-cycle of\n  the internal one\n2) An external object is controlled by a phase of an internal object.\n3) A phase of an internal object may create other internal objects\n  with dependencies of successor phases of the internal object.\n\n### Testing\n\nThe project includes a filesystem-based implementation\nof an objectspace. Additionally, a web server is included,\nwhich can be used to access and manipulate the objectspace.\n\nIt can be started with the `engine` command. By default,\nit is linked with an implemention of the sample metamodel\nprovided by this project.\n\nWith the command `ectl` resource objects can be retrieved and applied.\n\nBoth commands can be installed with `make install`.\n\n\n### Example metamodel\n\nThe project come with an example metamodel describing a simple\ncalculator.\n\n![calculator metamodel](images/calc-metamodel.png)\n\nIt describes Value objects (case 1) usable as operands for Operator\nobjects. \n\nThe operator manages an expression object responsible\nfor  the execution of the operation. This object is processed by a\ndedicated  expression controller. The opertor just gather the \noperands, creates an expression object (case 3), waits for the result\n(case 2) and provides the output to described output value object (case 3).\n\nThe concrete implementation uses an expression controller, which now \nmay create again sub processing graphs to calculate more complex\nexpressions like A*B+C.\n\nAn example for a concrete model based on this metamodel is shown here:\n\n![model example](images/calc-example.png)\n\n#### Running the example\n\nFirst, start the engine with\n\n```shell\nengine engine -d local/db -F ./ui -P /watch -c -D 1s\n```\n\nAdding the option `-L debug` will provide more logging output.\nWith `-D 1s` it is possible to slow down the processing to observe\nthe processing flow. With a web browser the URL\n`http://localhost:8080/ui` starts a simple visualization of the\nprocessing based on the phases can be seen.\n\nThe folder `scenarios` contains some example scenarios\nwhich can be deployed using\n\n```shell\nectl apply -f *.yaml\n```\n\nWith \n```shell\nectl get -c \nectl get Value\n```\n\nit is possible to display the involved objects and their state.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandelsoft%2Fengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmandelsoft%2Fengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandelsoft%2Fengine/lists"}