{ "info": { "author": "Justin Hammond", "author_email": "runningempty@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "# fabnodes\n\n`fabnodes` is a Python CLI application that creates prefabricated lambda nodes.\nUsing these 'node prefabs' one can create complicated distributed processes.\n\n\n## Requirements\n\nThe python requirements are stored in requirements.txt. `fabnodes` currently uses\n[`cfndsl`](https://github.com/cfndsl/cfndsl) to generate CloudFormation\nJSON files. The instructions to install `cfndsl` is available through the\nprovided link.\n\n## Basic setup\n\nInstall the requirements:\n```\n$ pip install -r requirements.txt\n```\n\nRun the application:\n```\n$ python -m fabnodes --help\n```\n\nTo run the tests (todo):\n```\n $ pytest\n```\n\n## Prefab: Basic Node\n\nThe Basic Node (`samples/basic_node/node.py`) will create the most basic node\nwith the following features:\n\n- `N` SQS inputs, where `N` can be 0 or greater\n- `M` SNS outputs, where `M` can be 0 or greater\n- 1 Lambda Function that triggers on any input, and can write to any output\n\nBelow is a masterpiece that will attempt to illustrate:\n\n```\n==========================================================================\n\n\n\n |----------- Basic Node ----------|\n\n.. -> SNS(SomeNode.alpha) ----\\ /--> SNS(output) -> ..\n ---> SQS(input) -> Lambda\n.. -> SNS(random topic) ---/ \\--> (something)\n\n\n\n==========================================================================\n```\n\nTo create this node your `cwd` needs to be the same as `node.py`:\n\n```\nfabnodes create node.py --account-arn XXXXXXXXXXXX\n```\n\nAt the moment the account-arn needs to be passed in because security.\n\nThis will make the calls required to CloudFormation that will create the above\ninfrastructure.\n\n### Use-cases:\n\nThe basic node has the following use-cases:\n\n- **The Source Node**: A node that reads from an input source (that isn't\n another prefab node) that then can forward to many through a topic (`0:M`\n node)\n- **The Router**: A node that takes an input and can 'farm' it out to\n specifically made workers (other prefab nodes) through named topics (`1:M`\n node)\n- **The Worker**: A node that listens on a topic, performs a specific task,\n then creates output (`1:1` node)\n- **The Ingest**: A node that listens to many topics, consumes data, and then\n produces output for a non-prefab node (`M:0` node)\n\n### The Sample: node.py\n\nBelow is an explanation of the provided sample.\n\n```\n@fablib.Distribution('jlh-dev-lambda-functions')\n@fablib.Inputs([\n {'name': 'Router', 'source': 'snsRouterTopicId'}])\n@fablib.Outputs([\n {'name': 'Alpha'}])\n@fablib.Node('BasicNode', 'comRoaetFabnodeSample', 'Basic Node')\ndef lambda_handler(events, context):\n client = boto3.client('sns')\n sns_target_arn = os.environ['Alpha']\n body_content = json.dumps(events)\n response = client.publish(\n TargetArn=sns_target_arn,\n Message=json.dumps({'default': body_content}),\n MessageStructure='json'\n )\n print(response)\n```\n\n- The `lambda_handler` method is defined exactly as a normal lambda handler\n- The decorators:\n - `Distribution`: defines the S3 bucket to put the code into\n - `Inputs` (a list of dictionaries): creates an SQS trigger that is subscribed\n to the defined SNS topic\n - `Outputs` (a list of dictionaries): creates an SNS topic that can be\n referenced in the `os.environ` dictionary\n - `Node`: defines the name of the lambda function, the name of the stack, and\n the description of the stack\n - The name of the stack can be used as a reference in other prefabs to\n create the input/output connections\n\n## References\n\n`fabnodes` is a Python CLI application generated from https://github.com/roaet/rorochip-cookies", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/roaet/fabnodes", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "fabnodes", "package_url": "https://pypi.org/project/fabnodes/", "platform": "", "project_url": "https://pypi.org/project/fabnodes/", "project_urls": { "Homepage": "https://github.com/roaet/fabnodes" }, "release_url": "https://pypi.org/project/fabnodes/0.0.7/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.0.7" }, "last_serial": 5997301, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "324a0a8bfefe960d7bae2dd91070bfbb", "sha256": "220d9627f0748bae4f9a5aee914c0c9973c9727291d83bb85002560ac8763d8b" }, "downloads": -1, "filename": "fabnodes-0.0.0.tar.gz", "has_sig": false, "md5_digest": "324a0a8bfefe960d7bae2dd91070bfbb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15801, "upload_time": "2019-10-08T19:46:04", "url": "https://files.pythonhosted.org/packages/22/d2/00c975fd7bd1d3e9c95f3b50a718b1bafc7c9cf859f69519845dad0021c5/fabnodes-0.0.0.tar.gz" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "c0e20738005b090fbd7ec48fe7bbfff9", "sha256": "4054c159018b6d094a20e4a1648473ff33495b9b65387fd2571672a4867382af" }, "downloads": -1, "filename": "fabnodes-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c0e20738005b090fbd7ec48fe7bbfff9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18422, "upload_time": "2019-10-08T20:26:39", "url": "https://files.pythonhosted.org/packages/e2/5f/8fed3793d224018ebadca7c6d20f91f6053df96d7d8a8e61d8e189416406/fabnodes-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "24366582508a12f34c360d4d5359cd03", "sha256": "69a8dd7cbcb32267bb0f679d42087064b3e8cf07e3499e9d78efb2c7a7acbc84" }, "downloads": -1, "filename": "fabnodes-0.0.2.tar.gz", "has_sig": false, "md5_digest": "24366582508a12f34c360d4d5359cd03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17393, "upload_time": "2019-10-18T01:25:09", "url": "https://files.pythonhosted.org/packages/e9/64/4f734794ddbdb546da07aed4a46e4ac42a291fe2a31bce70f376a7bf99aa/fabnodes-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "0db30a375422b7d3ca29a1233c0a4f87", "sha256": "2593a25e2afc501a60056159d4778065e89fca163948f85433330c9879f84c2d" }, "downloads": -1, "filename": "fabnodes-0.0.3.tar.gz", "has_sig": false, "md5_digest": "0db30a375422b7d3ca29a1233c0a4f87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22742, "upload_time": "2019-10-18T19:11:18", "url": "https://files.pythonhosted.org/packages/ed/8a/d67d42421ff7f5f57a2804ce34573beb6c5cbf9f9071c485a92cb8e3a937/fabnodes-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "7d26ff02bcc34251ed30467c32327a37", "sha256": "c2765b6dca865d96272a3ee759db15449f1205bcffd48f1381e41262efa7336e" }, "downloads": -1, "filename": "fabnodes-0.0.4.tar.gz", "has_sig": false, "md5_digest": "7d26ff02bcc34251ed30467c32327a37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22734, "upload_time": "2019-10-18T19:33:07", "url": "https://files.pythonhosted.org/packages/9f/78/f41d9d0d7bea8733c58009f2190a7c7232080fdf866d52fd72b583afaedb/fabnodes-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "a2c230fa64cd5557e7603cf0eb9d9c90", "sha256": "0f892b9a4643078301431ba057061afeb01eeab40694821c072db911bf64de35" }, "downloads": -1, "filename": "fabnodes-0.0.5.tar.gz", "has_sig": false, "md5_digest": "a2c230fa64cd5557e7603cf0eb9d9c90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22771, "upload_time": "2019-10-18T19:46:56", "url": "https://files.pythonhosted.org/packages/a3/6c/a7379cdea473362db698f4098981cf536a64af322b317e9307d7a9b38d4f/fabnodes-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "18d90095676f9dd4c7dde2901a1d4450", "sha256": "3dfb4fc01c1a1ba869363cf46731738279c73dc43345f65ca1f7bd65f7c5710b" }, "downloads": -1, "filename": "fabnodes-0.0.6.tar.gz", "has_sig": false, "md5_digest": "18d90095676f9dd4c7dde2901a1d4450", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22787, "upload_time": "2019-10-18T19:51:08", "url": "https://files.pythonhosted.org/packages/08/5f/7864e7b85783f5d40be5d5e01dd0cf28f38d879442eb7769df2f42f1719c/fabnodes-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "3cbd6ccc049c224d7b0153d233007993", "sha256": "cc6f283c3a67edd84cd57e52652cb75e752f9b5942f215444160d254e0370afd" }, "downloads": -1, "filename": "fabnodes-0.0.7.tar.gz", "has_sig": false, "md5_digest": "3cbd6ccc049c224d7b0153d233007993", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22788, "upload_time": "2019-10-18T20:06:51", "url": "https://files.pythonhosted.org/packages/9a/3e/0f24272705c2f163db4f716518be7d09a77aa5da241aa9dea4e10bb0d893/fabnodes-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3cbd6ccc049c224d7b0153d233007993", "sha256": "cc6f283c3a67edd84cd57e52652cb75e752f9b5942f215444160d254e0370afd" }, "downloads": -1, "filename": "fabnodes-0.0.7.tar.gz", "has_sig": false, "md5_digest": "3cbd6ccc049c224d7b0153d233007993", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22788, "upload_time": "2019-10-18T20:06:51", "url": "https://files.pythonhosted.org/packages/9a/3e/0f24272705c2f163db4f716518be7d09a77aa5da241aa9dea4e10bb0d893/fabnodes-0.0.7.tar.gz" } ] }