Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
workloads/container/vSwarm_deploy_metadata.tar.gz filter=lfs diff=lfs merge=lfs -text
31 changes: 29 additions & 2 deletions .github/workflows/e2e_loader.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: go run cmd/loader.go --config pkg/config/test_config.json

- name: Check the output
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)
run: test -f "data/out/experiment_duration_2.csv" && test $(cat data/out/experiment_duration_2.csv | wc -l) -gt 1 && test $(grep true data/out/experiment_duration_2.csv | wc -l) -eq 0 # test the output file for errors (true means failure to invoke)

- name: Print logs
if: ${{ always() }}
Expand All @@ -54,4 +54,31 @@ jobs:
- name: Down
if: ${{ always() }}
run: |
kn service delete --all
kn service delete --all

- name: Untar vSwarm YAMLs
if: ${{ always() }}
run: |
tar -xzvf workloads/container/vSwarm_deploy_metadata.tar.gz -C workloads/container/
- name: Run vSwarm loader
run: go run cmd/loader.go --config pkg/config/test_vswarm_config.json

- name: Check vSwarm output
run: test -f "data/out/experiment_duration_2.csv" && test $(cat data/out/experiment_duration_2.csv | wc -l) -gt 1 && test $(grep true data/out/experiment_duration_2.csv | wc -l) -le 1 # test the output file for errors (true means failure to invoke)

- name: Print logs
if: ${{ always() }}
run: |
set -x
container_list=$(kubectl get pods -n default -o jsonpath="{.items[*].spec.containers[*].name}")
for container_name in $container_list
do
kubectl logs -n default -c $container_name -l serving.knative.dev/service=${{ matrix.service }}
done
- name: Down
if: ${{ always() }}
run: |
kn service delete --all



3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pkg/workload/openwhisk/*.zip
tools/*/__pycache__
tools/trace_synthesizer/*.csv
tools/trace_synthesizer/*/*.csv
workloads/container/yamls/

### CMake ###
CMakeLists.txt.user
Expand Down Expand Up @@ -209,4 +210,4 @@ tools/plotter/test-out
*.swp

data/traces/azure_*
data/traces/day*
data/traces/day*
32 changes: 32 additions & 0 deletions cmd/config_vswarm_trace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"Seed": 42,

"Platform": "Knative",
"InvokeProtocol" : "grpc",
"YAMLSelector": "container",
"EndpointPort": 80,

"BusyLoopOnSandboxStartup": false,

"TracePath": "data/traces/example/",
"Granularity": "minute",
"OutputPathPrefix": "data/out/experiment",
"IATDistribution": "exponential",
"CPULimit": "1vCPU",
"ExperimentDuration": 10,
"WarmupDuration": 0,

"IsPartiallyPanic": false,
"EnableZipkinTracing": false,
"EnableMetricsScrapping": false,
"MetricScrapingPeriodSeconds": 15,
"AutoscalingMetric": "concurrency",

"GRPCConnectionTimeoutSeconds": 15,
"GRPCFunctionTimeoutSeconds": 900,
"DAGMode": false,
"EnableDAGDataset": true,
"Width": 2,
"Depth": 2,
"VSwarm": true
}
10 changes: 8 additions & 2 deletions cmd/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,17 @@ func parseTraceGranularity(cfg *config.LoaderConfiguration) common.TraceGranular
func runTraceMode(cfg *config.LoaderConfiguration, readIATFromFile bool, writeIATsToFile bool) {
durationToParse := determineDurationToParse(cfg.ExperimentDuration, cfg.WarmupDuration)
yamlPath := parseYAMLSpecification(cfg)
var functions []*common.Function
var traceParser trace.Parser

// Azure trace parsing
traceParser := trace.NewAzureParser(cfg.TracePath, durationToParse)
functions := traceParser.Parse()
if !cfg.VSwarm {
traceParser = trace.NewAzureParser(cfg.TracePath, durationToParse, yamlPath)
} else {
traceParser = trace.NewMapperParser(cfg.TracePath, durationToParse)
}

functions = traceParser.Parse()
// Dirigent metadata parsing
dirigentMetadataParser := trace.NewDirigentMetadataParser(cfg.TracePath, functions, yamlPath, cfg.Platform)
dirigentMetadataParser.Parse()
Expand Down
14 changes: 14 additions & 0 deletions data/traces/example/mapper_output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"c13acdc7567b225971cef2416a3a2b03c8a4d8d154df48afe75834e2f5c59ddfc455703077a17a9b8d0fc655d939fcc6d24d819fa9a1066b74f710c35a43cbc868baea05aa0c3619b6feb78c80a07e27e4e68f921d714b8125f916c3b3370bf2": {
"proxy-function": "cartservice"
},
"a2faad786b3c813b12ce57d349d5e62f6d0f22ceecfa86cd72a962853383b600d7028b01f2422ea9d4f695cae4085800eb34540674081a46bb4e4388e7995f7ac8b8b9160f181010f509ee0af3266cbcb5a5f4c7700ba8d4396f1147e1ad3bbd": {
"proxy-function": "image-rotate-go-11"
},
"7dc5aeabc131669912e8c793c8925cc9928321f45f13a4af031592b4611630d70728f480194febeddbc0d2a69a2cb38344e495f264d52c62102e7bd99505dbf22cc1c836a3b32265b4a36b6e6f56b2d7c0588a926df5d03a76b7b4388cbf2258": {
"proxy-function": "video-processing-python-100"
},
"ae8a1640fa932024f59b38a0b001808b5c64612bd60c6f3eb80ba9461ba2d09101d1a13d091b0cfc764a125ead054ad6a720cb29b0b1fc2c187e9be3311f09fe90ba6ab2b1b9f5b5925d1e9ee6242d0f840ebcfb3221567bc2b5f24cb864b016": {
"proxy-function": "video-processing-python-10"
}
}
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
| EnableDAGDataset | bool | true/false | true | Generate width and depth from dag_structure.csv in TracePath[^8] |
| Width | int | > 0 | 2 | Default width of DAG |
| Depth | int | > 0 | 2 | Default depth of DAG |
| VSwarm | bool | true/false | false | Execute vSwarm functions from mapper_output.json |

[^1]: To run RPS experiments replace the path with `RPS`.

Expand Down
40 changes: 40 additions & 0 deletions docs/generate_deploy_info_docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Deploy Info JSON

The `deploy_info.json` file is used to identify deployment information for services and their pre-dependencies. It is pre-generated, and stored inside the `vSwarm_deploy_metadata.tar.gz` to contain deployment information for vSwarm functions.

## Schema and Usage

The `deploy_info.json` file in the `vSwarm_deploy_metadata.tar.gz` is used to identify the relative file paths for the Knative YAML manifests for deploying vSwarm functions. It also contains the path of YAML files needed as part of the pre-deployment commands to run certain vSwarm benchmarks, for example the `online-shop-database` which requires to be deployed before running `cartservice` benchmark.

The `deploy_info.json` has the following schema:
```console
{
vswarm-function-name:
{
YamlLocation: /path/to/yaml
PredeploymentPath: [/path/to/predeployment-database/yaml]
}
}
```

The `PredeploymentPath` is the path to the YAML file, which is applied via `kubectl apply -f`, before creating the service under `YamlLocation`.

## Deployment File Generation

While the `deploy_info.json` file ships with the `vSwarm_deploy_metadata.tar.gz`, In order to regenerate the `deploy_info.json` run from the root of this repository:
```console
tar -xzvf workloads/container/vSwarm_deploy_metadata.tar.gz -C workloads/container
cd workloads/container/
python3 generate_deploy_info.py
```

## YAML Generation

The `workloads/container/generate_all_yamls.py` is a wrapper script that calls the `generate-yamls.py` script for each vSwarm benchmark in the `vSwarm_deploy_metadata.tar.gz`. The `generate-yamls.py` Python script generates YAML files for vSwarm benchmarks with different workload parameters to create a variety of durations and memory consumption.

While the YAMLs are pre-generated inside the `vSwarm_deploy_metadata.tar.gz` tarball, to regenerate the YAMLs, run this from the root of this repository:
```console
tar -xzvf workloads/container/vSwarm_deploy_metadata.tar.gz -C workloads/container
cd workloads/container
python3 generate_all_yamls.py
```
26 changes: 24 additions & 2 deletions docs/loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,42 @@ value previously collected.
To account for difference in CPU performance set `ITERATIONS_MULTIPLIER=102` if using
Cloudlab `xl170` or `d430` machines. (Date of measurement: 18-Oct-2022)

## Executing vSwarm functions
If you would like to use vSwarm benchmarks as profile functions to execute, first you need to generate a `mapper_output.json` using the `mapper` tool. Please refer to `mapper.md` docs for usage of the mapper tool to generate an output file. Once the `mapper_output.json` has been generated in the input trace directory, next run the following from the root of this repository:

```console
# install pre-requisites
sudo apt update
sudo apt -y install git-lfs pip xz-utils
git lfs install
git lfs fetch
git lfs checkout
```
This retrieves the `vSwarm_deploy_metadata.tar.gz` from Git LFS. Then, untar this tarball by running the following command from the root of this repository:

```bash
$ tar -xzvf workloads/container/vSwarm_deploy_metadata.tar.gz -C workloads/container/
```
This untar the tarball into the `workloads/container/yamls` directory, which contains deployment information and deployment YAML files for all vSwarm benchmarks. If you would like to change some of these deployment files of regenerate them, refer to `generate_deploy_info_docs.md` for an outline of what these deployment files are, and how you can regenerate them.

## Single execution

To run load generator use the following command:

```bash
$ go run cmd/loader.go --config cmd/config_knative_trace.json
```
To run load generator with vSwarm functions based on `mapper_output.json` run the following:

```bash
$ go run cmd/loader.go --config cmd/config_vswarm_trace.json
```
To direct the loader to execute vSwarm functions, set the `VSwarm` flag in the loader configuration `true`. For information on how to configure the workload for load generator, please refer to `docs/configuration.md`.

Additionally, one can specify log verbosity argument as `--verbosity [info, debug, trace]`. The default value is `info`.

To execute in a dry run mode without generating any load, set the `--dry-run` flag to `true`. This is useful for testing and validating configurations without executing actual requests.

For to configure the workload for load generator, please refer to `docs/configuration.md`.

There are a couple of constants that should not be exposed to the users. They can be examined and changed
in `pkg/common/constants.go`.

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ require (
github.com/campoy/embedmd v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davidmz/go-pageant v1.0.2 // indirect
github.com/go-cmd/cmd v1.4.3 // indirect
github.com/go-fonts/liberation v0.3.3 // indirect
github.com/go-latex/latex v0.0.0-20240709081214-31cef3c7570e // indirect
github.com/go-logr/logr v1.4.2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davidmz/go-pageant v1.0.2 h1:bPblRCh5jGU+Uptpz6LgMZGD5hJoOt7otgT454WvHn0=
github.com/davidmz/go-pageant v1.0.2/go.mod h1:P2EDDnMqIwG5Rrp05dTRITj9z2zpGcD9efWSkTNKLIE=
github.com/go-cmd/cmd v1.4.3 h1:6y3G+3UqPerXvPcXvj+5QNPHT02BUw7p6PsqRxLNA7Y=
github.com/go-cmd/cmd v1.4.3/go.mod h1:u3hxg/ry+D5kwh8WvUkHLAMe2zQCaXd00t35WfQaOFk=
github.com/go-fonts/dejavu v0.3.4 h1:Qqyx9IOs5CQFxyWTdvddeWzrX0VNwUAvbmAzL0fpjbc=
github.com/go-fonts/dejavu v0.3.4/go.mod h1:D1z0DglIz+lmpeNYMYlxW4r22IhcdOYnt+R3PShU/Kg=
github.com/go-fonts/latin-modern v0.3.3 h1:g2xNgI8yzdNzIVm+qvbMryB6yGPe0pSMss8QT3QwlJ0=
Expand Down
5 changes: 3 additions & 2 deletions pkg/common/trace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ type Function struct {
CPURequestsMilli int
MemoryRequestsMiB int
CPULimitsMilli int

Specification *FunctionSpecification
YAMLPath string
PredeploymentPath []string
Specification *FunctionSpecification

// used only for dirigent workflows
WorkflowMetadata *WorkflowMetadata
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestConfigParser(t *testing.T) {
!strings.HasPrefix(config.OutputPathPrefix, "data/out/experiment") ||
config.IATDistribution != "equidistant" ||
config.CPULimit != "1vCPU" ||
config.ExperimentDuration != 5 ||
config.ExperimentDuration != 2 ||
config.WarmupDuration != 0 ||
config.IsPartiallyPanic != false ||
config.EnableZipkinTracing != false ||
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/test_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"OutputPathPrefix": "data/out/experiment",
"IATDistribution": "equidistant",
"CPULimit": "1vCPU",
"ExperimentDuration": 5,
"ExperimentDuration": 2,
"WarmupDuration": 0,

"IsPartiallyPanic": false,
Expand Down
32 changes: 32 additions & 0 deletions pkg/config/test_vswarm_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"Seed": 42,

"Platform": "Knative",
"InvokeProtocol" : "grpc",
"YAMLSelector": "container",
"EndpointPort": 80,

"BusyLoopOnSandboxStartup": false,

"TracePath": "data/traces/example/",
"Granularity": "minute",
"OutputPathPrefix": "data/out/experiment",
"IATDistribution": "exponential",
"CPULimit": "1vCPU",
"ExperimentDuration": 2,
"WarmupDuration": 0,

"IsPartiallyPanic": false,
"EnableZipkinTracing": false,
"EnableMetricsScrapping": false,
"MetricScrapingPeriodSeconds": 15,
"AutoscalingMetric": "concurrency",

"GRPCConnectionTimeoutSeconds": 15,
"GRPCFunctionTimeoutSeconds": 900,
"DAGMode": false,
"EnableDAGDataset": true,
"Width": 2,
"Depth": 2,
"VSwarm": true
}
38 changes: 6 additions & 32 deletions pkg/driver/clients/grpc_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,16 @@
package clients

import (
"context"
"fmt"
"os"
"testing"
"time"

"github.com/sirupsen/logrus"
"github.com/vhive-serverless/loader/pkg/common"
"github.com/vhive-serverless/loader/pkg/config"
"github.com/vhive-serverless/loader/pkg/workload/standard"
helloworld "github.com/vhive-serverless/vSwarm/utils/protobuf/helloworld"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
"net"
"os"
"testing"
"time"
"github.com/vhive-serverless/loader/pkg/workload/vswarm"
)

func createFakeLoaderConfiguration() *config.LoaderConfiguration {
Expand Down Expand Up @@ -71,29 +68,6 @@ var testRuntimeSpecs = common.RuntimeSpecification{
Memory: 128,
}

type vSwarmServer struct {
helloworld.UnimplementedGreeterServer
}

func (s *vSwarmServer) SayHello(_ context.Context, req *helloworld.HelloRequest) (*helloworld.HelloReply, error) {
return &helloworld.HelloReply{
Message: "Reply message",
}, nil
}

func startVSwarmGRPCServer(serverAddress string, serverPort int) {
lis, err := net.Listen("tcp", fmt.Sprintf("%s:%d", serverAddress, serverPort))
if err != nil {
logrus.Fatalf("failed to listen: %v", err)
}

grpcServer := grpc.NewServer()

reflection.Register(grpcServer) // gRPC Server Reflection is used by gRPC CLI
helloworld.RegisterGreeterServer(grpcServer, &vSwarmServer{})
_ = grpcServer.Serve(lis)
}

func TestGRPCClientWithServerUnreachable(t *testing.T) {
cfg := createFakeLoaderConfiguration()
cfg.EnableZipkinTracing = true
Expand Down Expand Up @@ -161,7 +135,7 @@ func TestVSwarmClientWithServerReachable(t *testing.T) {
address, port := "localhost", 18081
testFunction.Endpoint = fmt.Sprintf("%s:%d", address, port)

go startVSwarmGRPCServer(address, port)
go vswarm.StartVSwarmGRPCServer(address, port)
time.Sleep(2 * time.Second)

cfgSwarm := createFakeVSwarmLoaderConfiguration()
Expand Down
Loading
Loading