Giter Club home page Giter Club logo

faas's Introduction

FaaS

How hard can it be to create a FaaS framework in Java?

to build

mvn clean package

to run

java -jar target/faas-XXX.war

faas's People

Contributors

rdomloge avatar

Watchers

 avatar Martin Davey avatar

faas's Issues

Create multi-threaded executor

public V execute(ExecutionResource<V> resource) {
	
	// probably best to submit this to a thread pool, such as a Scheduled Executor
	
	Function<V> function = resource.getFunction();
	JobRequest jobRequest = resource.getPreparedDescriptor().getJob().getJobRequest();
	function.setRequest(jobRequest);
	return function.call();
}

Create a gateway

Converts REST calls to put JSON messages on the queue to be consumed by Reactor
Presumably a GET call using a URL which identifies the function to call, with the params specified as URL params

http://myserver:8080/faasgw/functions/myFunction?vehicle=car&engine=hybrid

  1. Should be a Spring Boot web app
  2. The GW should include its routing key in the JobRequest object that it serialises to JSON
  3. The GW should bind to the response broker on Rabbit, binding an exclusive queue (only exists whilst connected, deleted when GW disconnects, only accessible to this instance of the GW) using it's private routing key (shall we use hostname-rnd to start with?)

Create the workspace manager

public WorkspaceResourcesDescriptor prepare(Job job, FunctionDefinition functionDefinition) {
	
	String functionUniqueName = functionDefinition.getFunctionUniqueName();
	String jobId = job.getJobId();
	// create a job folder in some configured root folder, named by the job id and function name
	
	// copy in the FaaS libs to <ROOT>/<JOB>/faasLibs
	
	// copy in the function's libs to <ROOT>/<JOB>/lib
	
	// compile the source to <ROOT>/<JOB>/bin
	
	
	return null;
}

public void cleanup(WorkspaceResourcesDescriptor workspaceResourcesDescriptor) {
	// delete the folder recursively
}

Configure queue connectivity

  1. Receiving, sending
  2. Object mapping JSON >> Object >> JSON
  3. No XML config - do with Java code + annotations in classes in .config package

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.