Skip to content

Commit 06e0651

Browse files
NotAnAddictzleokondrashov
authored andcommitted
Added logic for creating and managing DAG invocations
Signed-off-by: Kway Yi Shen <kwayyishen@gmail.com>
1 parent 65d108b commit 06e0651

File tree

18 files changed

+601
-70
lines changed

18 files changed

+601
-70
lines changed

.github/configs/wordlist.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ workerNodeNum
2323
durations
2424
dur
2525
ACM
26+
Acyclic
2627
addr
2728
adservice
2829
AdService
@@ -153,6 +154,7 @@ Daglis
153154
DAGMode
154155
datacenter
155156
Datacenter
157+
DAGs
156158
dataflows
157159
dataset
158160
david
@@ -710,6 +712,7 @@ cgroups
710712
noop
711713
YAMLs
712714
cgo
715+
EnableDAGDataset
713716
EnableMetricsScrapping
714717
EnableZipkinTracing
715718
EndpointPort

cmd/config_knative_trace.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@
2424

2525
"GRPCConnectionTimeoutSeconds": 15,
2626
"GRPCFunctionTimeoutSeconds": 900,
27-
"DAGMode": false
27+
"DAGMode": false,
28+
"EnableDAGDataset": true,
29+
"Width": 2,
30+
"Depth": 2
2831
}

cmd/loader.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ import (
3232
"strings"
3333
"time"
3434

35+
"golang.org/x/exp/slices"
36+
3537
"github.com/vhive-serverless/loader/pkg/common"
3638
"github.com/vhive-serverless/loader/pkg/config"
3739
"github.com/vhive-serverless/loader/pkg/driver"
3840
"github.com/vhive-serverless/loader/pkg/trace"
39-
"golang.org/x/exp/slices"
4041

4142
log "github.com/sirupsen/logrus"
4243
tracer "github.com/vhive-serverless/vSwarm/utils/tracing/go"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Width,WidthPercentile,Depth,DepthPercentile,TotalNodes,TotalNodes
2+
1,0.00%,1,0.00%,2,0.00%
3+
1,78.66%,1,12.51%,2,55.98%
4+
2,92.13%,2,67.96%,3,79.20%
5+
3,95.24%,3,86.84%,4,86.63%
6+
4,100.00%,4,100.00%,5,100.00%
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.tar.gz filter=lfs diff=lfs merge=lfs -text
2+
dag_structure.csv filter=lfs diff=lfs merge=lfs -text
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:4454eacfd79dffef7be37728c442d3f5cdfa183bd219feef8a9036f782806178
3+
size 76204

docs/configuration.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
| MetricScrapingPeriodSeconds | int | > 0 | 15 | Period of Prometheus metrics scrapping |
3434
| GRPCConnectionTimeoutSeconds | int | > 0 | 60 | Timeout for establishing a gRPC connection |
3535
| GRPCFunctionTimeoutSeconds | int | > 0 | 90 | Maximum time given to function to execute[^5] |
36-
| DAGMode | bool | true/false | false | Sequential invocation of all functions one after another |
36+
| DAGMode | bool | true/false | false | Generates DAG workflows iteratively with functions in TracePath [^8]. Frequency and IAT of the DAG follows their respective entry function, while Duration and Memory of each function will follow their respective values in TracePath. |
37+
| EnableDAGDataset | bool | true/false | true | Generate width and depth from dag_structure.csv in TracePath[^9] |
38+
| Width | int | > 0 | 2 | Default width of DAG |
39+
| Depth | int | > 0 | 2 | Default depth of DAG |
3740

3841
[^1]: To run RPS experiments add suffix `-RPS`.
3942

@@ -57,6 +60,10 @@ Lambda; https://aws.amazon.com/about-aws/whats-new/2018/10/aws-lambda-supports-f
5760

5861
[^7] It is recommended that the first 10% of cold starts are discarded from the experiment results for low cold start RPS.
5962

63+
[^8]: The generated DAGs consist of unique functions. The shape of each DAG is determined either ```Width,Depth``` or calculated based on ```EnableDAGDAtaset```.
64+
65+
[^9]: A [data sample](https://github.com/icanforce/Orion-OSDI22/blob/main/Public_Dataset/dag_structure.xlsx) of DAG structures has been created based on past Microsoft Azure traces. Width and Depth are determined based on probabilities of this sample.
66+
6067
---
6168

6269
InVitro can cause failure on cluster manager components. To do so, please configure the `cmd/failure.json`. Make sure

docs/loader.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,53 @@ For more options, please see the `Makefile`.
179179

180180
For instructions on how to use the loader with OpenWhisk go to `openwhisk_setup/README.md`.
181181

182+
## Workflow Invocation
183+
Generation of a Directed Acyclic Graph (DAG) workflow is supported by setting `"DAGMode: true"` in `cmd/config_knative_trace.json` (as specified in [`docs/configuration.md`](../docs/configuration.md)).
184+
185+
Before invocation, DAGs will be iteratively generated based on the parameters: `width`,`depth`,`EnableDAGDataset`, until the remaining functions are insufficient to maintain the desired DAG structure. The remaining functions will be unused for the rest of the experiment.
186+
187+
An example of the generated workflow can be seen here:
188+
189+
```bash
190+
Functions available: 20
191+
Width: 3
192+
Depth: 4
193+
EnableDAGDataset: false
194+
195+
DAG 1: f(0) -> f(1) -> f(3) -> f(5)
196+
\
197+
\ -> f(2) -> f(4) -> f(6)
198+
\
199+
\ -> f(7)
200+
201+
DAG 2: f(8) -> f(9) -> f(12) -> f(15)
202+
\
203+
\ -> f(10) -> f(13) -> f(16)
204+
\
205+
\-> f(11) -> f(14) -> f(17)
206+
```
207+
In the example, a single invocation of DAG 1 will result in 8 total functions invoked, with parallel invocations per branch. Invocation Frequency and IAT of DAGs 1 and 2 will depend on entry functions f(0) and f(8) respectively.
208+
209+
To obtain [reference traces](https://github.com/vhive-serverless/invitro/blob/main/docs/sampler.md#reference-traces) for DAG execution, use the following command:
210+
```bash
211+
git lfs pull
212+
tar -xzf data/traces/reference/sampled_150.tar.gz -C data/traces
213+
```
214+
Microsoft has publicly released Microsoft Azure traces of function invocations from 10/18/2021 to 10/31/2021. From this trace, a [data sample](https://github.com/icanforce/Orion-OSDI22/blob/main/Public_Dataset) of DAG structures, representing the cumulative distribution of width and depth of DAGs during that period, was generated. Probabilities were applied to the data to derive the shape of the DAGs. The file `data/traces/example/dag_structure.csv` provides a simplified sample of the publicly released traces.
215+
216+
By default, the shape of the DAGs are automatically calculated at every iteration using the above mentioned cumulative distribution.
217+
To manually set the shape of the DAGs, change the following parameters in `cmd/config_knative_trace.json`. Note that the number of functions in `TracePath` must be large enough to support the maximum size of the DAG. This ensures all DAGs generated will have the same width and depth.
218+
```bash
219+
"EnableDAGDataset": false,
220+
"Width": <width>,
221+
"Depth": <depth>
222+
```
223+
224+
Lastly, start the experiment. This invokes all the generated DAGs with their respective frequencies.
225+
```bash
226+
go run cmd/loader.go --config cmd/config_knative_trace.json
227+
```
228+
182229
## Running on Cloud Using Serverless Framework
183230

184231
**Currently supported vendors:** AWS
@@ -204,7 +251,6 @@ For instructions on how to use the loader with OpenWhisk go to `openwhisk_setup/
204251
```bash
205252
go run cmd/loader.go --config cmd/config_knative_trace.json
206253
```
207-
208254
---
209255
Note:
210256
- Current deployment is via container image.

pkg/common/trace_types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
package common
2626

27+
import "container/list"
28+
2729
type FunctionInvocationStats struct {
2830
HashOwner string
2931
HashApp string
@@ -103,3 +105,10 @@ type Function struct {
103105

104106
Specification *FunctionSpecification
105107
}
108+
109+
type Node struct {
110+
Function *Function
111+
Branches []*list.List
112+
Depth int
113+
DAG string
114+
}

pkg/common/utilities.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,15 @@ func SumNumberOfInvocations(withWarmup bool, totalDuration int, functions []*Fun
135135

136136
return result
137137
}
138+
139+
func GetName(function *Function) int {
140+
parts := strings.Split(function.Name, "-")
141+
if parts[0] == "test" {
142+
return 0
143+
}
144+
functionId, err := strconv.Atoi(parts[2])
145+
if err != nil {
146+
log.Fatal(err)
147+
}
148+
return functionId
149+
}

0 commit comments

Comments
 (0)