{"id":16055107,"url":"https://github.com/lunik/almost_faas","last_synced_at":"2025-04-05T08:12:52.038Z","repository":{"id":200202906,"uuid":"702230008","full_name":"Lunik/almost_faas","owner":"Lunik","description":"This repository contains the core router for Python functions (FaaS).","archived":false,"fork":false,"pushed_at":"2023-10-14T20:50:29.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T12:50:16.769Z","etag":null,"topics":["cloud","faas","flask","function","lambda","python","serverless"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lunik.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}},"created_at":"2023-10-08T21:36:51.000Z","updated_at":"2023-10-15T20:02:09.000Z","dependencies_parsed_at":"2023-10-16T03:47:57.846Z","dependency_job_id":null,"html_url":"https://github.com/Lunik/almost_faas","commit_stats":null,"previous_names":["lunik/almost_faas"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lunik%2Falmost_faas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lunik%2Falmost_faas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lunik%2Falmost_faas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lunik%2Falmost_faas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lunik","download_url":"https://codeload.github.com/Lunik/almost_faas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305944,"owners_count":20917208,"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","faas","flask","function","lambda","python","serverless"],"created_at":"2024-10-09T02:06:04.165Z","updated_at":"2025-04-05T08:12:52.011Z","avatar_url":"https://github.com/Lunik.png","language":"Python","readme":"# Flask function\n\nThis repository contains the core router for Python functions (FaaS). The framework is based on Flask and is designed to be used with containers.\n\n## Building the base image\n\n```bash\ntask build\n```\n\nThis will create base image with the name `function/python`. The tag version has the following format: `\u003cimage_version\u003e-\u003cpython_version\u003e`. For example, `1.0.0-3.11`.\n\nThe list of builded Python versions can be found in the `Taskfile.yml` file.\n\n## Using the base image\n\nYou will need to create a new Dockerfile that inherits from the base image. Then you can add your function code and install the dependencies. See [examples](./examples).\n\nFunction listen on port `8080` by default. You can change it by setting the `PORT` environment variable.\n\nFunction name is `handler` located in the `function.py` file by default. You can change it by setting the `FUNCTION_HANDLER` environment variable. The format is `\u003cmodule_name\u003e:\u003cfunction_name\u003e`.\n\nFunction list on path `/` by default. You can change it by setting the `FUNCTION_PATH` environment variable.\n\nFunction listen to method `GET` and `POST` by default. You can change it by setting the `FUNCTION_METHODS` environment variable (Comma separated list).\n\nFunction listen on `/healthz` path for health check.\n\n## Running the function\n\nFirst, you need to build the image. See [examples](./examples) if you don't know where to start.\n\nWith Docker\n\n```bash\ndocker run -p 8080:8080 --rm \u003cimage_name\u003e\n```\n\nWith Kubernetes\n\n```bash\nkubectl run \u003cpod_name\u003e --image=\u003cimage_name\u003e --port=8080\nkubectl port-forward \u003cpod_name\u003e 8080:8080\n```\n\n### Testing the function\n\n```bash\ncurl -X POST http://localhost:8080/\n```\n\n## Development\n\nThis project uses [Taskfile](https://taskfile.dev) to automate the development process. You can find the list of available commands in the `Taskfile.yml` file.\n\nSource code is located in the `app` directory. There are also Python requirements in the `requirements.txt` file. The `scripts` folder holds runtime script like the image `entrypoint`. Finally, the `Dockerfile` is used to build the base image.\n\nThe webserver used is [Gunicorn](https://gunicorn.org/).\n\nThe base application framework is [Flask](https://flask.palletsprojects.com).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunik%2Falmost_faas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunik%2Falmost_faas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunik%2Falmost_faas/lists"}