{"id":17153882,"url":"https://github.com/stevenmmortimer/pfa-lambda","last_synced_at":"2025-03-24T13:23:49.676Z","repository":{"id":95730446,"uuid":"85610256","full_name":"StevenMMortimer/pfa-lambda","owner":"StevenMMortimer","description":"Dependencies for Deploying PFA Scoring Engine on AWS Lambda","archived":false,"fork":false,"pushed_at":"2017-07-28T16:22:54.000Z","size":901,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T18:28:33.376Z","etag":null,"topics":["aws-lambda","machine-learning","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/StevenMMortimer.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":"2017-03-20T18:10:52.000Z","updated_at":"2017-03-20T18:15:42.000Z","dependencies_parsed_at":"2023-05-21T19:45:10.963Z","dependency_job_id":null,"html_url":"https://github.com/StevenMMortimer/pfa-lambda","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/StevenMMortimer%2Fpfa-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenMMortimer%2Fpfa-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenMMortimer%2Fpfa-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenMMortimer%2Fpfa-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StevenMMortimer","download_url":"https://codeload.github.com/StevenMMortimer/pfa-lambda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245276813,"owners_count":20589035,"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":["aws-lambda","machine-learning","python"],"created_at":"2024-10-14T21:47:34.647Z","updated_at":"2025-03-24T13:23:49.648Z","avatar_url":"https://github.com/StevenMMortimer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pfa-lambda\nA template for executing PFA on AWS Lambda to create a serverless, scalable analytical API.\n\n## Getting Started Quickly\nIf you want to test running PFA on AWS Lambda, clone this project, then zip it \nand upload to the AWS Console.\n\n```\ngit clone git@github.com:ReportMort/pfa-lambda.git\nzip -r my-lambda-deploy.zip .\n```\n\nIf you test this package in the AWS console, it should return `103.14` the result \nof our function which is hard-coded to accept `3.14` and then apply a PFA routine \nthat adds `100` to return `103.14`. You can use the AWS Hello World testing template \nwhich provides 3 dummy key-value pairs, but no key-values are required.\n\n## A More Realistic Example \n\nIn the script `lambda_function.py` a simple PFA routine is supplied directly as \nhand-writter, hard-coded text. Many machine learning models are complex algorithms \nthat would not be hard-coded text. The model would be created and translated to \nPFA using a producer so that the logic would be saved in a separate file. Your \nmodel could be saved in an S3 bucket (with versioning) and called. For an example, \ncheck out `model-from-s3.py`. If you want to use this function, make sure to update \nthe handler on AWS to be `model-from-s3.py.lambda_handler` and replace the bucket \nand key with the bucket and filename of your model on S3. This function depends on \nthe `event` JSON input, therefore, the key-values for each model predictor variable \nmust be provided and are directly paseed into the PFA engine to produce the score.\n\n## Troubleshooting\n\n1. Check the selected Runtime for your lambda is Python 2.7\n2. Check the name of the `.py` file in your root directory and ensure that it matches \nthe handler specification in the AWS console (i.e. The filename.handler-method value \nin your function.)\n3. If you see the message `\"errorMessage\": \"Unable to import module 'lambda_function'\"`, \nmake sure that the permissions of all files inside your `.zip` package are at least 444. \nThe file and directory permissions every file in your deployment package (the .zip file) \nmust be readable globally.\n\n## How This Deployment Package Was Made\nThis deployment package was created by following the instructions on AWS: \nhttp://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html\n\nMore specifically, by running the following code:\n\n```\nmkdir my-pfa-lambda-module\ncd my-pfa-lambda-module\npip install titus -t .\n```\n\nIf you're using OS X and Homebrew you will need to specify a `setup.cfg` file. \nHere are the complete instructions for compiling: \n\n```\nmkdir my-pfa-lambda-module\ncd my-pfa-lambda-module\ntouch setup.cfg\necho \"[install]\" \u003e\u003e setup.cfg\necho \"prefix=\" \u003e\u003e setup.cfg\npip install titus -t .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenmmortimer%2Fpfa-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenmmortimer%2Fpfa-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenmmortimer%2Fpfa-lambda/lists"}