Initial commit

This commit is contained in:
harmacist 2021-10-25 23:14:24 -05:00
parent dec8c62ed2
commit ee49692ca1
2 changed files with 89 additions and 2 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
# ---> PyCharm
.idea/
# ---> Python # ---> Python
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/

View File

@ -1,4 +1,88 @@
# pyPledge # pyPledge
pyPledge is a project aimed at making serverless functions capable of being run in a self-hosted manner, pyPledge is a project aimed at making serverless functions capable of being run in a self-hosted manner,
while maintaining an easy to use UI. while maintaining an easy to use UI.
## Features
- [ ] Two different modes of function execution
- [ ] CRON based, scheduled execution
- [ ] Web hook based ad-hoc execution (uuid urls)
- [ ] RESTful JSON API
- [ ] Command Line Interface?
- [ ] Multiple Languages Supported
- [ ] Python
- [ ] JavaScript via Node.js
- [ ] Ruby
- [ ] Bash
- [ ] PHP
- [ ] UI to monitor current status, success and failures of all functions
- [ ] Ability to start, stop or sigterm any function
- [ ] In-browser web editor for direct function creation via the web UI with syntax highlighting
## Samples
### Starting the Service
- Single Docker File
- SQLITE database
- CRON and web service are all running in one container
- If any part fails, the entire container goes down
- Docker Compose/Swarm
- Any sqlalchemy database supported
- CRON runs in a separate and/or scalable container setup
- Webhooks run in a separate and/or scalable container setup
### Hello World CRON function
`POST https://localhost:8080/api/v1/new`
```json
{
"name": "example_function",
"lang": "py",
"deployment": {
"type": "cron",
"schedule": "0 * * * *"
},
"content": "print('Hello, World!')"
}
```
The above post request would return the following:
```json
{
"status": {
"value": 201,
"message": "CREATED"
},
"name": "example_function"
}
```
### Hello World URL function
`POST https://localhost:8080/api/v1/new`
```json
{
"name": "example_function",
"lang": "py",
"deployment": {
"type": "url"
},
"content": "print('Hello, World!')"
}
```
The above post could return the following:
```json
{
"status": {
"value": 201,
"message": "CREATED"
},
"name": "example_function",
"endpoint": "8ca0fbdc-831e-45a9-a9a9-eab896d67811"
}
```
Once created, navigating to the url `https://localhost:8080/8ca0fbdc-831e-45a9-a9a9-eab896d67811` would result in the following output:
```json
{
"stdout": "Hello, World!"
}
```