mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Remove iron...
This commit is contained in:
committed by
Reed Allman
parent
521df8c1ff
commit
9cc12b4b12
@@ -1,7 +1,7 @@
|
||||
# fnlb-test-harness
|
||||
Test harness that exercises the fnlb load balancer in order to verify that it works properly.
|
||||
## How it works
|
||||
This is a test harness that makes calls to an IronFunctions route through the fnlb load balancer, which routes traffic to multiple IronFunctions nodes.
|
||||
This is a test harness that makes calls to an Oracle Functions route through the fnlb load balancer, which routes traffic to multiple Oracle Functions nodes.
|
||||
The test harness keeps track of which node each request was routed to so we can assess how the requests are being distributed across the nodes. The functionality
|
||||
of fnlb is to normally route traffic to the same small number of nodes so that efficiences can be achieved and to support reuse of hot functions.
|
||||
### Primes function
|
||||
@@ -14,25 +14,25 @@ where:
|
||||
- *loops*: number of times to calculate the primes (repeating the count consumes additional CPU without consuming additional memory)
|
||||
|
||||
## How to use it
|
||||
The test harness requires running one or more IronFunctions nodes and one instance of fnlb. The list of nodes must be provided both to fnlb and to the test harness
|
||||
The test harness requires running one or more Oracle Functions nodes and one instance of fnlb. The list of nodes must be provided both to fnlb and to the test harness
|
||||
because the test harness must call each node directly one time in order to discover the node's container id.
|
||||
|
||||
After it has run, examine the results to see how the requests were distributed across the nodes.
|
||||
### How to run it locally
|
||||
Each of the IronFunctions nodes needs to connect to the same database.
|
||||
Each of the Oracle Functions nodes needs to connect to the same database.
|
||||
|
||||
STEP 1: Create a route for the primes function. Example:
|
||||
```
|
||||
fn apps create primesapp
|
||||
fn routes create primesapp /primes jconning/primes:0.0.1
|
||||
```
|
||||
STEP 2: Run five IronFunctions nodes locally. Example (runs five nodes in the background using Docker):
|
||||
STEP 2: Run five Oracle Functions nodes locally. Example (runs five nodes in the background using Docker):
|
||||
```
|
||||
sudo docker run -d -it --name functions-8082 --privileged -v ${HOME}/data-8082:/app/data -p 8082:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" iron/functions
|
||||
sudo docker run -d -it --name functions-8083 --privileged -v ${HOME}/data-8083:/app/data -p 8083:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" iron/functions
|
||||
sudo docker run -d -it --name functions-8084 --privileged -v ${HOME}/data-8084:/app/data -p 8084:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" iron/functions
|
||||
sudo docker run -d -it --name functions-8085 --privileged -v ${HOME}/data-8085:/app/data -p 8085:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" iron/functions
|
||||
sudo docker run -d -it --name functions-8086 --privileged -v ${HOME}/data-8086:/app/data -p 8086:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" iron/functions
|
||||
sudo docker run -d -it --name functions-8082 --privileged -v ${HOME}/data-8082:/app/data -p 8082:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" treeder/functions
|
||||
sudo docker run -d -it --name functions-8083 --privileged -v ${HOME}/data-8083:/app/data -p 8083:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" treeder/functions
|
||||
sudo docker run -d -it --name functions-8084 --privileged -v ${HOME}/data-8084:/app/data -p 8084:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" treeder/functions
|
||||
sudo docker run -d -it --name functions-8085 --privileged -v ${HOME}/data-8085:/app/data -p 8085:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" treeder/functions
|
||||
sudo docker run -d -it --name functions-8086 --privileged -v ${HOME}/data-8086:/app/data -p 8086:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" treeder/functions
|
||||
```
|
||||
STEP 3: Run fnlb locally. Example (runs fnlb on the default port 8081):
|
||||
```
|
||||
|
||||
@@ -107,7 +107,7 @@ func invokeLoadBalancer(hostPort, path string, numExecutions, max, loops int) {
|
||||
|
||||
func discoverContainerIds() {
|
||||
// Discover the Docker hostname of each node; create a mapping of hostnames to host/port.
|
||||
// This is needed because IronFunctions doesn't make the host/port available to the function (as of Mar 2017).
|
||||
// This is needed because Oracle Functions doesn't make the host/port available to the function (as of Mar 2017).
|
||||
fmt.Println("Discovering container ids for every node (use Docker's HOSTNAME env var as a container id)...")
|
||||
for _, s := range nodes {
|
||||
if e, err := executeFunction(s, route, 100, 1); err == nil {
|
||||
|
||||
Reference in New Issue
Block a user