This repo aimed to build an alternative version for AWS Lambda Hosting. It is a simple and lightweight serverless framework that allows you to run your code without provisioning or managing servers. It is a great way to build serverless applications and microservices.
This project replicates the Hosting of AWS Lambda with Python and FastAPI. For more information about AWS Lambda, you can visit here.
- Supports serverless functions in Python
- Run all functions locally
- Allows user to deploy new function while not interrupting the existing ones
- Allows install new dependencies without rebuilding the image
Before starting, you need to copy the .env.example file to .env and fill in the required environment variables.
cp .env.example .env-
Docker
To run the application, you need to have Docker and installed on your machine. You can install Docker from here.
docker build -t custom-lambda .
docker run -d -p 9999:9999 -v $(pwd):/app custom-lambda-
Docker Compose
You can install Docker Compose from here. Then, you can run the following command to build and run the application:
docker-compose up --build -d-
Pure Python
You can also run the application without Docker. You need to have Python 3.8 or later installed on your machine. Then, you can run the following command to install the dependencies and run the application:
pip install -r requirements.txt
uvicorn app:app --host 127.0.0.1 --port 9999-
Interact through Frontend: Open your web browser and navigate to
http://localhost:9999/. This will take you to the application's frontend where you can interact with its features. -
Testing the Application: We have provided some bash scripts in
testdirectory that you can use to test the application. Run the following command to test the application:
bash test/get_all.sh- API Documentation: To understand the application's API endpoints and their usage, visit
http://localhost:9999/docs. This page provides comprehensive documentation for the API.
v1.0.1 (Released)
- In-app package installation (through pip)
- Add Timeout and Memory Limit for each function
- Limit upload file size
- Add simple UI for the application
v1.0.2 (Released)
- Separate function uploading and executing channels
- Separate dependencies for each function
- Separate functions between users, allow same function name for different users
v1.0.3 (Upcoming)
- Support other languages
- Restrict users' access to system level commands
- Add rate limit
Visit CHANGELOG.md to see full update history.
How to contribute to the project?
- Fork the project
- Create your feature branch:
git checkout -b feature/AmazingFeature - Commit your changes:
git commit -m 'Add some AmazingFeature' - Push to the branch:
git push origin feature/AmazingFeature - Open a pull request
Distributed under the MIT License. See LICENSE for more details.