Skip to content

Commit

Permalink
Feat: migration (#26) (#30)
Browse files Browse the repository at this point in the history
* Feat: migration (#26)

* feat: simple migration policy
* refactor: use IsPodReady function
* feat: prevent dispatcher to route requests to not ready pods
* feat: tons of shitty things. read description
* feat: stop sync only for not ready functions
* feat: fix termination period
* fix: increase maximum delay upper bound
* feat: add proxy metric table
* fix: delete unused const query string
* refactor: extract scheduler name in const field
* refactor: extract default termination grace period
* feat: change latency to float and fix backend update
* refactor: user-fn.yaml
* refactor: manifests used in experiments
* fix: build error

Co-authored-by: Luca Terracciano <[email protected]>
Co-authored-by: DragonBanana <[email protected]>
Co-authored-by: SwagMaster <[email protected]>
  • Loading branch information
3 people authored Jun 10, 2022
1 parent 486196f commit 6ba001d
Show file tree
Hide file tree
Showing 120 changed files with 3,907 additions and 286 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SHELL:=/bin/bash
MAKEFLAGS += --no-print-directory
COMPONENTS = community-controller system-controller edge-scheduler function-deployment-webhook dispatcher
COMPONENTS = community-controller cpu-monitoring simple-dispatcher simple-dispatcher-of system-controller dispatcher

ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
description: MaximumDelay is the upper bound for the delay inside
a community measured in milliseconds
format: int32
maximum: 100
maximum: 10000
minimum: 0
type: integer
probability-threshold:
Expand Down
45 changes: 45 additions & 0 deletions config/deploy/simple-dispatcher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: simple-dispatcher
namespace: default
labels:
app: dispatcher
spec:
selector:
matchLabels:
app: dispatcher
template:
metadata:
labels:
app: dispatcher
spec:
automountServiceAccountToken: true
nodeSelector:
kubernetes.io/kind: worker
serviceAccountName: dispatcher
containers:
- name: dispatcher
image: systemautoscaler/simple-dispatcher:dev
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
---
apiVersion: v1
kind: Service
metadata:
name: dispatcher
labels:
app: dispatcher
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: dispatcher

22 changes: 19 additions & 3 deletions config/metric-db/002_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ CREATE TABLE IF NOT EXISTS ping
timestamp TIMESTAMP,
from_node VARCHAR(50),
to_node VARCHAR(50),
avg_latency INTEGER,
max_latency INTEGER,
min_latency INTEGER,
avg_latency DOUBLE PRECISION,
max_latency DOUBLE PRECISION,
min_latency DOUBLE PRECISION,
PRIMARY KEY (timestamp, from_node)
);

Expand All @@ -47,3 +47,19 @@ CREATE TABLE IF NOT EXISTS resource
);

SELECT create_hypertable('resource', 'timestamp', chunk_time_interval => INTERVAL '5 minutes');

CREATE TABLE IF NOT EXISTS proxy_metric
(
timestamp TIMESTAMP,
node VARCHAR(50),
function VARCHAR(50),
namespace VARCHAR(50),
community VARCHAR(50),
latency INTEGER,
gpu BOOLEAN,
PRIMARY KEY (timestamp, node, function, namespace, community)
);

SELECT create_hypertable('proxy_metric', 'timestamp', chunk_time_interval => INTERVAL '30 seconds');
SELECT add_dimension('proxy_metric', 'community', number_partitions => 4);
SELECT add_dimension('proxy_metric', 'namespace', number_partitions => 4);
14 changes: 8 additions & 6 deletions example/sla-2/carts-delete-sla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ metadata:
name: carts-delete
namespace: openfaas-fn
spec:
integralGain: 3
proportionalGain: 6
metric:
responseTime: 50m
responseTime: 100m
defaultResources:
cpu: "1000m"
memory: 1000Mi
cpu: "600m"
memory: 1500Mi
minResources:
memory: 1000Mi
cpu: 300m
memory: 1500Mi
cpu: 30m
maxResources:
memory: 1000Mi
memory: 1500Mi
cpu: 20000m
service:
container: carts-delete
Expand Down
14 changes: 8 additions & 6 deletions example/sla-2/carts-post-sla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ metadata:
name: carts-post
namespace: openfaas-fn
spec:
integralGain: 3
proportionalGain: 6
metric:
responseTime: 150m
responseTime: 200m
defaultResources:
cpu: "1000m"
memory: 1000Mi
cpu: "600m"
memory: 1500Mi
minResources:
memory: 1000Mi
cpu: 300m
memory: 1500Mi
cpu: 30m
maxResources:
memory: 1000Mi
memory: 1500Mi
cpu: 20000m
service:
container: carts-post
Expand Down
14 changes: 8 additions & 6 deletions example/sla-2/carts-sla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ metadata:
name: carts
namespace: openfaas-fn
spec:
integralGain: 3
proportionalGain: 6
metric:
responseTime: 50m
responseTime: 100m
defaultResources:
cpu: "1000m"
memory: 1000Mi
cpu: "600m"
memory: 1500Mi
minResources:
memory: 1000Mi
cpu: 300m
memory: 1500Mi
cpu: 30m
maxResources:
memory: 1000Mi
memory: 1500Mi
cpu: 20000m
service:
container: carts
Expand Down
14 changes: 8 additions & 6 deletions example/sla-2/catalogue-sla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ metadata:
name: catalogue
namespace: openfaas-fn
spec:
integralGain: 3
proportionalGain: 6
metric:
responseTime: 50m
responseTime: 100m
defaultResources:
cpu: "1000m"
memory: 1000Mi
cpu: "50m"
memory: 250Mi
minResources:
memory: 1000Mi
cpu: 50m
memory: 250Mi
cpu: 30m
maxResources:
memory: 1000Mi
memory: 250Mi
cpu: 20000m
service:
container: catalogue
Expand Down
22 changes: 0 additions & 22 deletions example/sla-2/front-end-sla.yaml

This file was deleted.

12 changes: 7 additions & 5 deletions example/sla-2/orders-sla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ metadata:
name: orders
namespace: openfaas-fn
spec:
integralGain: 3
proportionalGain: 6
metric:
responseTime: 300m
defaultResources:
cpu: "1000m"
memory: 1000Mi
cpu: "600m"
memory: 1500Mi
minResources:
memory: 1000Mi
cpu: 300m
memory: 1500Mi
cpu: 30m
maxResources:
memory: 1000Mi
memory: 1500Mi
cpu: 20000m
service:
container: orders
Expand Down
14 changes: 8 additions & 6 deletions example/sla-2/payment-sla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ metadata:
name: payment
namespace: openfaas-fn
spec:
integralGain: 3
proportionalGain: 6
metric:
responseTime: 50m
responseTime: 100m
defaultResources:
cpu: "1000m"
memory: 1000Mi
cpu: "50"
memory: 250Mi
minResources:
memory: 1000Mi
cpu: 50m
memory: 250Mi
cpu: 30m
maxResources:
memory: 1000Mi
memory: 250Mi
cpu: 20000m
service:
container: payment
Expand Down
14 changes: 8 additions & 6 deletions example/sla-2/queue-master-sla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ metadata:
name: queue-master
namespace: openfaas-fn
spec:
integralGain: 3
proportionalGain: 6
metric:
responseTime: 100m
defaultResources:
cpu: "1000m"
memory: 1000Mi
cpu: "600m"
memory: 1500Mi
minResources:
memory: 1000Mi
cpu: 300m
memory: 1500Mi
cpu: 30m
maxResources:
memory: 1000Mi
memory: 1500Mi
cpu: 20000m
service:
container: queue-master
selector:
matchLabels:
name: queue-master
name: queue-master
14 changes: 8 additions & 6 deletions example/sla-2/shipping-sla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ metadata:
name: shipping
namespace: openfaas-fn
spec:
integralGain: 3
proportionalGain: 6
metric:
responseTime: 50m
responseTime: 100m
defaultResources:
cpu: "1000m"
memory: 1000Mi
cpu: "600m"
memory: 1500Mi
minResources:
memory: 1000Mi
cpu: 300m
memory: 1500Mi
cpu: 30m
maxResources:
memory: 1000Mi
memory: 1500Mi
cpu: 20000m
service:
container: shipping
Expand Down
14 changes: 8 additions & 6 deletions example/sla-2/user-login-sla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ metadata:
name: user-login
namespace: openfaas-fn
spec:
integralGain: 3
proportionalGain: 6
metric:
responseTime: 50m
responseTime: 100m
defaultResources:
cpu: "1000m"
memory: 1000Mi
cpu: "50m"
memory: 500Mi
minResources:
memory: 1000Mi
cpu: 50m
memory: 500Mi
cpu: 30m
maxResources:
memory: 1000Mi
memory: 500Mi
cpu: 20000m
service:
container: user-login
Expand Down
14 changes: 8 additions & 6 deletions example/sla-2/user-register-sla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ metadata:
name: user-register
namespace: openfaas-fn
spec:
integralGain: 3
proportionalGain: 6
metric:
responseTime: 50m
responseTime: 100m
defaultResources:
cpu: "1000m"
memory: 1000Mi
cpu: "50m"
memory: 500Mi
minResources:
memory: 1000Mi
cpu: 50m
memory: 500Mi
cpu: 30m
maxResources:
memory: 1000Mi
memory: 500Mi
cpu: 20000m
service:
container: user-register
Expand Down
Loading

0 comments on commit 6ba001d

Please sign in to comment.