Skip to content

Commit

Permalink
README.md update on howto build and run
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Kraynyukhov committed Apr 14, 2018
1 parent ca514a3 commit d5227c5
Showing 1 changed file with 62 additions and 1 deletion.
63 changes: 62 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,70 @@
# LAppS - Lua Application Server

This is an attempt to provide very easy to use Lua Application Server working over WebSockets protocol (RFC 6455).
This is an attempt to provide very easy to use Lua Application Server working over WebSockets protocol (RFC 6455). LAppS is a application server for micro-services architecture. However it is build to be highly scalable vertically too. The docker cloud infrastructure (kubernetes or swarm) shall be used for horizontal scaling.

It is in an alpha stage right now. As of today (13 April 2018) first lua application is running under LAppS. The WebSocket implementation is not yet 100% strict, though it is complient with RFC 6455 (see autobahn testsuite results in the link bellow). No WebSockets extensions are supported yet.

#How to build and run the LAppS
##Prerequisites

1. Docker installed
2. Docker daemon is running

## Build steps

First we need a base docker image. This step is done only once and after you've got the base image lapps:luadev, you will not require to do this step anymore.
Download Dockerfile and place it somewhere. Change the directory to that *`somewhere'*. And then run the command:


*docker build -t lapps:luadev .*


This will create base image for your experimentation/development. Check it with **docker image ls** and you will see your base image with name *lapps* and tag *luadev* listed between the images.


Download the Dockerfile.lapps-build file now and place it again `somewhere'. Assuming it is the same directory as the last time run the command:

*docker build -t lapps:build-$(date +%s) -f Dockerfile.lapps-build .*

Which will build the LAppS and create docker image with name lapps and tag build-some-number (timestamp in seconds).

One more step before we run it. Lets install LAppS somewhere:


*docker run -it --name myldev -h ldev -v /opt/lapps-builds/latest:/opt/lapps lapps:build make install-examples clone-luajit clone-libressl*


This command will install LAppS, related luajit-2.0.5 and libressl files as well an example app into /opt/lapps-build/latest/


##Running the LAppS

Lets make a separate clean container without anything we do not need. Download the Dockerfile.lapps-runenv file and run following command:

*docker build -t lapps:runenv -f Dockerfile.lapps-runenv .*

*docker run -it --rm --name myrun -h lapps -p 5083:5083 -v /opt/lapps-builds/latest:/opt/lapps lapps:runenv env LD_LIBRARY_PATH=/opt/lapps/lib LUA_PATH="${LUA_PATH};/opt/lapps/apps/echo/?.lua" /opt/lapps/bin/lapps*

Now LAppS is up and running on port 5083, you may test it against autoban-testsuite fuzzing-client. Suppose your container has an IP address 172.17.0.1, the fuzzingclient.json config file for autoban-testsuite would look like:

```json
{
"outdir": "./reports/servers",
"servers": [
{
"agent": "LAppS TLS-enabled",
"url": "wss://172.17.0.1:5083/echo"
}
],
"cases": ["*"],
"exclude-cases": [],
"exclude-agent-cases": {}
}
```

# Side-notes

Though LAppS is not even reached the optimization phase, it is running surprisingly good.

Here are some performance results (dev instance with Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz). Servers all were tested in TLS only. Number of clients: 80. As a client was used benchmark/echo_client_tls.cpp (websocketpp example client)

Expand Down

0 comments on commit d5227c5

Please # to comment.