Skip to content

Commit 35d220e

Browse files
grussorussomatnar
andcommitted
Workflow extension: code review
Author: Gabriele Russo Russo <gabri.russo17@gmail.com> Co-authored-by: Matteo Nardelli <matnar@gmail.com>
1 parent 5dba34c commit 35d220e

125 files changed

Lines changed: 4873 additions & 8127 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/makefile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
run: make
2424

2525
- name: Test
26-
run: make unit_test
26+
run: make test

Makefile

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,8 @@ push-images:
4040
docker push $(DOCKERHUB_USER)/serverledge-base
4141
docker push $(DOCKERHUB_USER)/serverledge-nodejs17ng
4242

43-
unit_test:
44-
go test -v ./...
45-
4643
test:
47-
INTEGRATION=1 go test -v ./...
48-
49-
# to get coverage, install cover
50-
# go get golang.org/x/tools/cmd/cover
51-
test_coverage:
52-
go test -coverprofile coverage.txt ./...
53-
54-
coverage:
55-
go tool cover -html=coverage.txt
44+
go test -v ./...
5645

5746
.PHONY: serverledge serverledge-cli lb executor test images
5847

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,4 @@ The configuration file may look like this:
170170
## License
171171

172172
Serverledge is distributed under the terms of the [MIT
173-
license](https://github.com/grussorusso/serverledge/blob/master/LICENSE.txt).
173+
license](https://github.com/serverledge-faas/serverledge/blob/master/LICENSE.txt).

cmd/cli/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"os"
66
"strconv"
77

8-
"github.com/grussorusso/serverledge/internal/cli"
9-
"github.com/grussorusso/serverledge/internal/config"
8+
"github.com/serverledge-faas/serverledge/internal/cli"
9+
"github.com/serverledge-faas/serverledge/internal/config"
1010
)
1111

1212
func main() {

cmd/executor/executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"log"
66
"net/http"
77

8-
"github.com/grussorusso/serverledge/internal/executor"
8+
"github.com/serverledge-faas/serverledge/internal/executor"
99
)
1010

1111
func main() {

cmd/lb/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99

1010
"golang.org/x/net/context"
1111

12-
"github.com/grussorusso/serverledge/internal/config"
13-
"github.com/grussorusso/serverledge/internal/lb"
14-
"github.com/grussorusso/serverledge/internal/registration"
15-
"github.com/grussorusso/serverledge/utils"
12+
"github.com/serverledge-faas/serverledge/internal/config"
13+
"github.com/serverledge-faas/serverledge/internal/lb"
14+
"github.com/serverledge-faas/serverledge/internal/registration"
15+
"github.com/serverledge-faas/serverledge/utils"
1616
"github.com/labstack/echo/v4"
1717
"github.com/labstack/echo/v4/middleware"
1818
)

cmd/serverledge/main.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import (
1010
"os/signal"
1111
"time"
1212

13-
"github.com/grussorusso/serverledge/internal/api"
14-
"github.com/grussorusso/serverledge/internal/cache"
15-
"github.com/grussorusso/serverledge/internal/config"
16-
"github.com/grussorusso/serverledge/internal/metrics"
17-
"github.com/grussorusso/serverledge/internal/node"
18-
"github.com/grussorusso/serverledge/internal/registration"
19-
"github.com/grussorusso/serverledge/internal/scheduling"
20-
"github.com/grussorusso/serverledge/utils"
13+
"github.com/serverledge-faas/serverledge/internal/api"
14+
"github.com/serverledge-faas/serverledge/internal/cache"
15+
"github.com/serverledge-faas/serverledge/internal/config"
16+
"github.com/serverledge-faas/serverledge/internal/metrics"
17+
"github.com/serverledge-faas/serverledge/internal/node"
18+
"github.com/serverledge-faas/serverledge/internal/registration"
19+
"github.com/serverledge-faas/serverledge/internal/scheduling"
20+
"github.com/serverledge-faas/serverledge/utils"
2121

2222
"github.com/labstack/echo/v4"
2323
"github.com/labstack/echo/v4/middleware"

docs/custom_runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ your function code, as explained below.
77

88
The easiest way to build a custom function image is by leveraging the
99
Serverledge base runtime image, i.e., `grussorusso/serverledge-base`.
10-
This image contains a simple implementation of the [Executor](https://github.com/grussorusso/serverledge/blob/main/docs/executor.md)
10+
This image contains a simple implementation of the [Executor](https://github.com/serverledge-faas/serverledge/blob/main/docs/executor.md)
1111
server. When the function is invoked, the Executor runs a user-specified
1212
command as a new process and sets a few environment variables that may be
1313
used by the called process:

docs/writing-function-compositions.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
# Functions composition
22

3-
Serverledge accepts DAGs defined by users through a subset of the JSON-based *Amazon States Language*, currently in use by AWS Step Functions. Furthermore, you can define DAGs programmatically
4-
with the DagBuilder APIs.
3+
Serverledge accepts workflows defined by users through a subset of the JSON-based *Amazon States Language*, currently in use by AWS Step Functions. Furthermore, you can define workflows programmatically
4+
with the Builder APIs.
55

6-
Serverledge DAGs comprise 4 types of nodes:
6+
Serverledge workflows comprise 4 types of nodes:
77
- **SimpleNode**: a node that wraps a function. This is the only node that executes user-defined functions.
88
- **ChoiceNode**: a node with N conditions that transfers its input to the first branch whose condition is evaluated as true
99
- **FanOutNode**: a node with N outputs that copies (or scatters) the input to all the outputs (with subsequent nodes activated in parallel)
1010
- **FanInNode**: a node with N inputs that waits for the termination of all the parent nodes, and then merges the results in one output. The node fails after a specified timeout.
1111

1212
Three special nodes are always present and pre-built when using the APIs:
13-
- **StartNode**: the single node from which the DAG starts executing
14-
- **EndNode**: the final node of the DAG
15-
- **ErrorNode**: a node that terminates DAG execution with failure
13+
- **StartNode**: the single node from which the workflow starts executing
14+
- **EndNode**: the final node of the workflow
15+
- **ErrorNode**: a node that terminates workflow execution with failure
1616

1717

1818
## Signature
1919
Specifying a signature is optional for Serverledge functions. However,
20-
in order to use functions within DAGs, they must have an associated signature.
20+
in order to use functions within workflows, they must have an associated signature.
2121
A signature specifies the type of the inputs accepted by the function, as well as the type of the produced outputs. For instance, a *Fibonacci* function might have a single integer input, and produce a single integer output.
2222

2323
The signature can be specified when creating a function through the CLI.
@@ -41,10 +41,10 @@ Example:
4141

4242
TODO
4343

44-
## DagBuilder API
44+
## Builder API
4545

46-
It is possible to use the internal builder APIs to build complex DAGs programmatically in Go.
47-
Here is an example of a DAG made by two simple nodes and a choice node, with N alternative conditions
46+
It is possible to use the internal builder APIs to build complex workflows programmatically in Go.
47+
Here is an example of a workflow made by two simple nodes and a choice node, with N alternative conditions
4848

4949
N := 4
5050
function := function.Function{...}
@@ -53,11 +53,11 @@ Here is an example of a DAG made by two simple nodes and a choice node, with N a
5353
...
5454
condition[N-1] = Condition{...}
5555

56-
NewDagBuilder().
56+
NewBuilder().
5757
AddSimpleNode(&function).
5858
AddSimpleNode(&function2).
5959
AddChoiceNode(conditions).
60-
ForEach(NewDagBuilder().
60+
ForEach(NewBuilder().
6161
AddSimpleNode(&function).
6262
Build()).
6363
EndChoiceNode().

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/grussorusso/serverledge
1+
module github.com/serverledge-faas/serverledge
22

33
go 1.20
44

@@ -8,7 +8,6 @@ require (
88
github.com/cornelk/hashmap v1.0.8
99
github.com/docker/docker v24.0.5+incompatible
1010
github.com/hexablock/vivaldi v0.0.0-20180727225019-07adad3f2b5f
11-
github.com/labstack/echo v3.3.10+incompatible
1211
github.com/labstack/echo/v4 v4.6.1
1312
github.com/labstack/gommon v0.3.0
1413
github.com/lithammer/shortuuid v3.0.0+incompatible
@@ -27,7 +26,6 @@ require (
2726
github.com/cespare/xxhash/v2 v2.2.0 // indirect
2827
github.com/coreos/go-semver v0.3.0 // indirect
2928
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
30-
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
3129
github.com/docker/distribution v2.8.2+incompatible // indirect
3230
github.com/docker/go-connections v0.4.0 // indirect
3331
github.com/docker/go-units v0.5.0 // indirect

0 commit comments

Comments
 (0)