Skip to content

Commit c9526f1

Browse files
committed
Added deployment for vSwarm functions, end to end pipeline working
Signed-off-by: aryans1204 <arshar1204@gmail.com>
1 parent 8fcbdf5 commit c9526f1

File tree

6 files changed

+58
-7
lines changed

6 files changed

+58
-7
lines changed

cmd/config_vswarm_trace.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"Seed": 42,
3+
4+
"Platform": "Knative",
5+
"InvokeProtocol" : "grpc",
6+
"YAMLSelector": "container",
7+
"EndpointPort": 80,
8+
9+
"BusyLoopOnSandboxStartup": false,
10+
11+
"TracePath": "data/traces/example/",
12+
"Granularity": "minute",
13+
"OutputPathPrefix": "data/out/experiment",
14+
"IATDistribution": "exponential",
15+
"CPULimit": "1vCPU",
16+
"ExperimentDuration": 3,
17+
"WarmupDuration": 0,
18+
19+
"IsPartiallyPanic": false,
20+
"EnableZipkinTracing": false,
21+
"EnableMetricsScrapping": false,
22+
"MetricScrapingPeriodSeconds": 15,
23+
"AutoscalingMetric": "concurrency",
24+
25+
"GRPCConnectionTimeoutSeconds": 15,
26+
"GRPCFunctionTimeoutSeconds": 900,
27+
"DAGMode": false,
28+
"EnableDAGDataset": true,
29+
"Width": 2,
30+
"Depth": 2,
31+
"VSwarm": true
32+
}

cmd/loader.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ func runTraceMode(cfg *config.LoaderConfiguration, readIATFromFile bool, writeIA
180180
if !cfg.VSwarm {
181181
traceParser := trace.NewAzureParser(cfg.TracePath, durationToParse, yamlPath)
182182
functions = traceParser.Parse()
183-
}
184-
else {
183+
} else {
185184
traceParser := trace.NewMapperParser(cfg.TracePath, durationToParse)
186185
functions = traceParser.Parse()
187186
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"c13acdc7567b225971cef2416a3a2b03c8a4d8d154df48afe75834e2f5c59ddf": {
3+
"proxy-function": "video-processing-python-10"
4+
},
5+
"a2faad786b3c813b12ce57d349d5e62f6d0f22ceecfa86cd72a962853383b600": {
6+
"proxy-function": "image-rotate-go-11"
7+
},
8+
"7dc5aeabc131669912e8c793c8925cc9928321f45f13a4af031592b4611630d7": {
9+
"proxy-function": "video-processing-python-100"
10+
},
11+
"ae8a1640fa932024f59b38a0b001808b5c64612bd60c6f3eb80ba9461ba2d091": {
12+
"proxy-function": "video-processing-python-10"
13+
}
14+
}

pkg/driver/deployment/knative.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ var (
2626
type knativeDeployer struct{}
2727

2828
type knativeDeploymentConfiguration struct {
29-
YamlPath string
3029
IsPartiallyPanic bool
3130
EndpointPort int
3231
AutoscalingMetric string
@@ -38,7 +37,6 @@ func newKnativeDeployer() *knativeDeployer {
3837

3938
func newKnativeDeployerConfiguration(cfg *config.Configuration) knativeDeploymentConfiguration {
4039
return knativeDeploymentConfiguration{
41-
YamlPath: cfg.YAMLPath,
4240
IsPartiallyPanic: cfg.LoaderConfiguration.IsPartiallyPanic,
4341
EndpointPort: cfg.LoaderConfiguration.EndpointPort,
4442
AutoscalingMetric: cfg.LoaderConfiguration.AutoscalingMetric,
@@ -61,7 +59,7 @@ func (*knativeDeployer) Deploy(cfg *config.Configuration) {
6159

6260
knativeDeploySingleFunction(
6361
cfg.Functions[i],
64-
knativeConfig.YamlPath,
62+
cfg.Functions[i].YAMLPath,
6563
knativeConfig.IsPartiallyPanic,
6664
knativeConfig.EndpointPort,
6765
knativeConfig.AutoscalingMetric,

pkg/trace/mapper_trace_parser.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ func NewMapperParser(directoryPath string, totalDuration int) *MapperTraceParser
2828
func (p* MapperTraceParser) extractFunctions(mapperOutput map[string]map[string]string, deploymentInfo map[string]map[string]interface{}, dirPath string) []*common.Function {
2929
var result []*common.Function
3030
invocations := parseInvocationTrace(dirPath+"/invocations.csv", p.duration)
31+
runtime := parseRuntimeTrace(dirPath+"/durations.csv")
32+
memory := parseMemoryTrace(dirPath+"/memory.csv")
33+
34+
runtimeByHashFunction := createRuntimeMap(runtime)
35+
memoryByHashFunction := createMemoryMap(memory)
3136
for i := 0; i < len(*invocations); i++ {
3237
invocationStats := (*invocations)[i]
3338
hashFunction := invocationStats.HashFunction
@@ -39,6 +44,8 @@ func (p* MapperTraceParser) extractFunctions(mapperOutput map[string]map[string]
3944
Name: fmt.Sprintf("%s-%d-%d", proxyFunction, i, p.functionNameGenerator.Uint64()),
4045

4146
InvocationStats: &invocationStats,
47+
RuntimeStats: runtimeByHashFunction[hashFunction],
48+
MemoryStats: memoryByHashFunction[hashFunction],
4249
YAMLPath: yamlPath,
4350
PreDeploymentCommands: preDeploymentCommands,
4451
}
@@ -51,8 +58,8 @@ func (p *MapperTraceParser) Parse() []*common.Function {
5158
var mapperOutput map[string]map[string]string // HashFunction mapped to vSwarm function yaml.
5259
var deploymentInfo map[string]map[string]interface{}
5360
// Read the deployment info file for yaml locations and predeployment commands if any
54-
55-
deploymentInfoFile, err := os.ReadFile("deploy_info.json")
61+
homeDir := os.Getenv("HOME")
62+
deploymentInfoFile, err := os.ReadFile(homeDir+"/invitro/pkg/trace/deploy_info.json")
5663
if err != nil {
5764
log.Warn("No deployment info file")
5865
}

workloads/container/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yamls.tar.gz filter=lfs diff=lfs merge=lfs -text

0 commit comments

Comments
 (0)