Skip to content

Commit 75e0e0e

Browse files
committed
Extract RPS knob from Platform setting
Signed-off-by: Leonid Kondrashov <leo.kondrashov@gmail.com>
1 parent 11fc411 commit 75e0e0e

File tree

10 files changed

+29
-34
lines changed

10 files changed

+29
-34
lines changed

.github/workflows/e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
run: go run cmd/loader.go --config pkg/config/test_config.json
6363

6464
- name: Check the output
65-
run: test -f "data/out/experiment_duration_5.csv" && test $(grep true data/out/experiment_duration_5.csv | wc -l) -eq 0 # test the output file for errors (true means failure to invoke)
65+
run: test -f "data/out/experiment_duration_5.csv" && test $(cat data/out/experiment_duration_5.csv | wc -l) -gt 1 && test $(grep true data/out/experiment_duration_5.csv | wc -l) -eq 0 # test the output file for errors (true means failure to invoke)
6666

6767
- name: Print logs
6868
if: ${{ always() }}

.github/workflows/e2e_aws.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ jobs:
6060
run: go run cmd/loader.go --config pkg/config/test_config_aws.json
6161

6262
- name: Check the output
63-
run: test -f "data/out/experiment_duration_5.csv" && test $(grep true data/out/experiment_duration_5.csv | wc -l) -eq 0 # test the output file for errors (true means failure to invoke)
63+
run: test -f "data/out/experiment_duration_5.csv" && test $(cat data/out/experiment_duration_5.csv | wc -l) -gt 1 && test $(grep true data/out/experiment_duration_5.csv | wc -l) -eq 0 # test the output file for errors (true means failure to invoke)

cmd/config_dirigent_dandelion_rps.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Seed": 42,
33

4-
"Platform": "Dirigent-Dandelion-RPS",
4+
"Platform": "Dirigent-Dandelion",
55
"InvokeProtocol" : "http1",
66
"EndpointPort": 80,
77

@@ -20,7 +20,7 @@
2020
"RpsMemoryMB": 2048,
2121
"RpsIterationMultiplier": 80,
2222

23-
"TracePath": "data/traces/example",
23+
"TracePath": "RPS",
2424
"Granularity": "minute",
2525
"OutputPathPrefix": "data/out/experiment",
2626
"IATDistribution": "equidistant",

cmd/config_dirigent_rps.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Seed": 42,
33

4-
"Platform": "Dirigent-RPS",
4+
"Platform": "Dirigent",
55
"InvokeProtocol" : "http2",
66
"EndpointPort": 80,
77

@@ -20,7 +20,7 @@
2020
"RpsMemoryMB": 2048,
2121
"RpsIterationMultiplier": 80,
2222

23-
"TracePath": "data/traces/example",
23+
"TracePath": "RPS",
2424
"Granularity": "minute",
2525
"OutputPathPrefix": "data/out/experiment",
2626
"IATDistribution": "equidistant",

cmd/config_knative_rps.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Seed": 42,
33

4-
"Platform": "Knative-RPS",
4+
"Platform": "Knative",
55
"InvokeProtocol" : "grpc",
66
"YAMLSelector": "container",
77
"EndpointPort": 80,
@@ -16,7 +16,7 @@
1616
"RpsMemoryMB": 2048,
1717
"RpsIterationMultiplier": 80,
1818

19-
"TracePath": "data/traces/example",
19+
"TracePath": "RPS",
2020
"Granularity": "minute",
2121
"OutputPathPrefix": "data/out/experiment",
2222
"IATDistribution": "equidistant",

cmd/loader.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"flag"
2929
"fmt"
3030
"os"
31-
"strings"
3231
"time"
3332

3433
"github.com/vhive-serverless/loader/pkg/generator"
@@ -93,29 +92,24 @@ func main() {
9392

9493
supportedPlatforms := []string{
9594
"Knative",
96-
"Knative-RPS",
9795
"OpenWhisk",
98-
"OpenWhisk-RPS",
9996
"AWSLambda",
100-
"AWSLambda-RPS",
10197
"Dirigent",
102-
"Dirigent-RPS",
103-
"Dirigent-Dandelion-RPS",
10498
"Dirigent-Dandelion",
10599
}
106100

107101
if !slices.Contains(supportedPlatforms, cfg.Platform) {
108102
log.Fatal("Unsupported platform!")
109103
}
110104

111-
if cfg.Platform == "Knative" || cfg.Platform == "Knative-RPS" {
105+
if cfg.Platform == "Knative" {
112106
common.CheckCPULimit(cfg.CPULimit)
113107
}
114108

115-
if !strings.HasSuffix(cfg.Platform, "-RPS") {
116-
runTraceMode(&cfg, *iatFromFile, *iatGeneration)
117-
} else {
109+
if cfg.TracePath == "RPS" {
118110
runRPSMode(&cfg, *iatFromFile, *iatGeneration)
111+
} else {
112+
runTraceMode(&cfg, *iatFromFile, *iatGeneration)
119113
}
120114
}
121115

@@ -157,7 +151,7 @@ func parseYAMLSpecification(cfg *config.LoaderConfiguration) string {
157151
case "firecracker":
158152
return "workloads/firecracker/trace_func_go.yaml"
159153
default:
160-
if cfg.Platform != "Dirigent" && cfg.Platform != "Dirigent-RPS" && cfg.Platform != "Dirigent-Dandelion-RPS" && cfg.Platform != "Dirigent-Dandelion" {
154+
if cfg.Platform != "Dirigent" && cfg.Platform != "Dirigent-Dandelion" {
161155
log.Fatal("Invalid 'YAMLSelector' parameter.")
162156
}
163157
}

docs/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
| Parameter name | Data type | Possible values | Default value | Description |
44
|------------------------------|-----------|---------------------------------------------------------------------|---------------------|--------------------------------------------------------------------------------------|
55
| Seed | int64 | any | 42 | Seed for specification generator (for reproducibility) |
6-
| Platform [^1] | string | Knative, OpenWhisk, AWSLambda, Dirigent, Dirigent-Dandelion | Knative | The serverless platform the functions will be executed on |
6+
| Platform | string | Knative, OpenWhisk, AWSLambda, Dirigent, Dirigent-Dandelion | Knative | The serverless platform the functions will be executed on |
77
| InvokeProtocol | string | grpc, http1, http2 | N/A | Protocol to use to communicate with the sandbox |
88
| YAMLSelector | string | wimpy, container, firecracker | container | Service YAML depending on sandbox type |
99
| EndpointPort | int | > 0 | 80 | Port to be appended to the service URL |
@@ -19,7 +19,7 @@
1919
| RpsRuntimeMs | int | >=0 | 0 | Requested execution time |
2020
| RpsMemoryMB | int | >=0 | 0 | Requested memory |
2121
| RpsIterationMultiplier | int | >=0 | 0 | Iteration multiplier for RPS mode |
22-
| TracePath | string | string | data/traces | Folder with Azure trace dimensions (invocations.csv, durations.csv, memory.csv) |
22+
| TracePath [^1] | string | string | data/traces/example | Folder with Azure trace dimensions (invocations.csv, durations.csv, memory.csv) or "RPS" |
2323
| Granularity | string | minute, second | minute | Granularity for trace interpretation[^2] |
2424
| OutputPathPrefix | string | any | data/out/experiment | Results file(s) output path prefix |
2525
| IATDistribution | string | exponential, exponential_shift, uniform, uniform_shift, equidistant | exponential | IAT distribution[^3] |
@@ -38,7 +38,7 @@
3838
| Width | int | > 0 | 2 | Default width of DAG |
3939
| Depth | int | > 0 | 2 | Default depth of DAG |
4040

41-
[^1]: To run RPS experiments add suffix `-RPS`.
41+
[^1]: To run RPS experiments replace the path with `RPS`.
4242

4343
[^2]: The second granularity feature interprets each column of the trace as a second, rather than as a minute, and
4444
generates IAT for each second. This feature is useful for fine-grained and precise invocation scheduling in experiments

pkg/driver/clients/invoker.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package clients
22

33
import (
4+
"sync"
5+
46
"github.com/sirupsen/logrus"
57
"github.com/vhive-serverless/loader/pkg/common"
68
"github.com/vhive-serverless/loader/pkg/config"
79
"github.com/vhive-serverless/loader/pkg/metric"
8-
"sync"
910
)
1011

1112
type Invoker interface {
@@ -14,23 +15,23 @@ type Invoker interface {
1415

1516
func CreateInvoker(cfg *config.LoaderConfiguration, announceDoneExe *sync.WaitGroup, readOpenWhiskMetadata *sync.Mutex) Invoker {
1617
switch cfg.Platform {
17-
case "AWSLambda", "AWSLambda-RPS":
18+
case "AWSLambda":
1819
return newAWSLambdaInvoker(announceDoneExe)
19-
case "Dirigent", "Dirigent-RPS":
20+
case "Dirigent":
2021
if cfg.InvokeProtocol == "grpc" {
2122
return newGRPCInvoker(cfg)
2223
} else {
2324
return newHTTPInvoker(cfg)
2425
}
25-
case "Dirigent-Dandelion", "Dirigent-Dandelion-RPS":
26+
case "Dirigent-Dandelion":
2627
return newHTTPInvoker(cfg)
27-
case "Knative", "Knative-RPS":
28+
case "Knative":
2829
if cfg.InvokeProtocol == "grpc" {
2930
return newGRPCInvoker(cfg)
3031
} else {
3132
return newHTTPInvoker(cfg)
3233
}
33-
case "OpenWhisk", "OpenWhisk-RPS":
34+
case "OpenWhisk":
3435
return newOpenWhiskInvoker(announceDoneExe, readOpenWhiskMetadata)
3536
default:
3637
logrus.Fatal("Unsupported platform.")

pkg/driver/deployment/deployer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ type FunctionDeployer interface {
1212

1313
func CreateDeployer(cfg *config.Configuration) FunctionDeployer {
1414
switch cfg.LoaderConfiguration.Platform {
15-
case "AWSLambda", "AWSLambda-RPS":
15+
case "AWSLambda":
1616
return newAWSLambdaDeployer()
17-
case "Dirigent", "Dirigent-RPS", "Dirigent-Dandelion", "Dirigent-Dandelion-RPS":
17+
case "Dirigent", "Dirigent-Dandelion":
1818
return newDirigentDeployer()
19-
case "Knative", "Knative-RPS":
19+
case "Knative":
2020
return newKnativeDeployer()
21-
case "OpenWhisk", "OpenWhisk-RPS":
21+
case "OpenWhisk":
2222
return newOpenWhiskDeployer()
2323
default:
2424
logrus.Fatal("Unsupported platform.")

pkg/driver/failure/triggers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ func ScheduleFailure(platform string, config *config.FailureConfiguration) {
2323
time.Sleep(time.Duration(config.FailAt) * time.Second)
2424

2525
switch platform {
26-
case "Knative", "Knative-RPS":
26+
case "Knative":
2727
triggerKnativeFailure(config.FailNode, config.FailComponent)
28-
case "Dirigent", "Dirigent-RPS":
28+
case "Dirigent":
2929
triggerDirigentFailure(config.FailNode, config.FailComponent)
3030
default:
3131
logrus.Errorf("No specified failure handler for given type of system.")

0 commit comments

Comments
 (0)