budhash / jerverless

Turn anything into a serverless function

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


GitHub license GitHub (pre-)release GitHub last commit HitCount

Turn anything into a serverless function.. Docker ready!

jerverless is a serverless runner which will execute anything (binaries, commands or your scripts) as a serverless function. It simply pipes http POST data into STDIN of any executable vice versa.

How it works!

Example functions

How to create functions?

On Machine (or VM)

  1. Download jar
$ url --ssl -L https://github.com/jerverless/jerverless/releases/download/v0.0.1/org.jerverless-0.0.1.jar > jerverless.jar
  1. Create jerverless.properties
exec = python helloworld.py
port = 8080
cors = true
  1. Create your program (eg:- helloworld.py)
name = raw_input()
print "Hello %s!" % name
  1. Start server!
 $ java -jar org.jerverless-0.0.1.jar 
  1. Test it!
$ curl -d Jerverless http://localhost:8080/function

Or simply use template and jump to last step!

Docker

  1. On your local machine, clone this repo and go to an examples directory of choice (eg: python):
  git clone https://github.com/jerverless/jerverless.git
  cd jerverless/examples/python
  1. Create the docker image:
  docker build --no-cache -t jerverless-py .
  1. Run the app:
  docker run -it -p 8080:8080 jerverless-py
  1. Navigate to 'https://localhost:8080/function' in your browser.

Kubernetes

  1. Create docker image for your function and push to dockerhub

  2. Add docker image name to .yml deployment

Project Status

  • Initial work (Structure, basic server with runner)
  • Multithreaded server mode
  • Unit cases
  • CLI commands
  • Basic Samples
  • Docs
  • Beta Release!

Developer Guide

 git clone <forked_url>
 mvn clean package
 java -jar target/org.jerverless-0.0.1.jar 

About

Turn anything into a serverless function

License:MIT License


Languages

Language:Java 99.9%Language:Python 0.1%