Skip to content

SFaaSOnOrleans is a Stateful Function as a Service (SFaaS) platform on top of Microsoft Orleans.

Notifications You must be signed in to change notification settings

diku-dk/SFaaSOnOrleans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SFaaSOnOrleans

SFaaSOnOrleans is a Stateful Function as a Service (SFaaS) platform on top of Microsoft Orleans.

Table of Contents

Getting Started

Prerequisites

New Orleans Users

Orleans framework provides facilities to program distributed applications at scale using the virtual actor model. We highly recommend starting from the Orleans Documentation to further understand the model.

How to Run

As any real-world application, we need to make sure the server is up and running before any client interation. Therefore, in the project's root folder, run the following command:

dotnet run --project Server

This command will start up the Orleans server (aka silo).

Next, we can initialize the client program. In another console, run:

dotnet run --project DynamicCodeApi

Assignment

Description

In this programming task, you build upon the application scenario and your Kafka processing logic from your previous assignment. You are asked to design and implement a SFaaS platform on top of Orleans. You are provided with basic APIs to register and call functions and the remaining functionalities must be implemented.

Refer to the assignment description in Absalon for a complete

Basic APIs

Your client program offers an HTTP server so you can perform basic operations in your SFaaS platform. Swagger UI can also support you interacting with the APIs through http://localhost:5244/swagger.

To register a simple function, submit a POST request (http://localhost:5244/register) with the following payload:

{
    "FunctionName": "AddNumbers",
    "Code": "return (System.Int64)args[0] + (System.Int64)args[1];"
}

To invoke a function, submit a POST request (http://localhost:5244/test) with the following payload:

{
    "FunctionName": "AddNumbers",
    "Parameters": [10, 20]
}

To register a function that operates with state, make sure Redis is up and running and submit a POST request (http://localhost:5244/register) with the following payload:

{
    "FunctionName": "TestRedis",
    "Code": "
            kvs.PutString(\"test\",\"test\");
            return kvs.GetString(\"test\");
            "
}

Then invoke it:

{
    "FunctionName": "TestRedis",
    "Parameters": []
}

In case you need to operate with value objects other than strings, make sure to indicate the type when calling the state API:

{
    "FunctionName": "TestRedisTyped",
    "Code": "
            kvs.Put<int>(\"testInt\",1);
            return kvs.Get<int>(\"testInt\");
            "
}
{
    "FunctionName": "TestRedisTyped",
    "Parameters": []
}

Troubleshooting

Q: There are compilation errors

A: Make sure you have installed .NET Framework 7 correctly. Besides, make sure you have not modified the original code.

Q: How to debug?

A: Use an IDEA. For instance, to open the project in Visual Studio, make sure to select the BDSOnlineShop.sln as the solution file, so Visual Studio will recognize the solution as a whole and allow you to debug your application.

Q: The project is throwing exceptions.

A: You are supposed to complete the application according to the assignment description, removing the exceptions thrown in the way.

About

SFaaSOnOrleans is a Stateful Function as a Service (SFaaS) platform on top of Microsoft Orleans.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages