-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support customizable cpu, memory, network task complexities #47
Changes from 17 commits
4bc86f3
2941e9b
7790463
ded6541
026e3b7
755b2c5
c8be963
1234685
81e5574
07c331d
d52d5df
597be4a
6f02860
c6859c5
44a7415
d3fda0d
15ef418
ed9ff7d
2b77f26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: config-service1 | ||
labels: | ||
name: config-service1 | ||
version: cluster1 | ||
namespace: edge-namespace | ||
data: | ||
conf.json: '{"processes":2,"threads":2,"endpoints":[{"name":"endpoint1","protocol":"http","execution_mode":"sequential","cpu_complexity":{"execution_time":"","method":"","workers":0,"cpu_affinity":null,"cpu_load":""},"memory_complexity":{"execution_time":"","method":"","workers":0,"bytes_load":""},"network_complexity":{"forward_requests":"asynchronous","response_payload_size":512,"called_services":[{"service":"service2","port":"80","endpoint":"endpoint1","protocol":"http","traffic_forward_ratio":1,"request_payload_size":256},{"service":"service2","port":"80","endpoint":"endpoint2","protocol":"http","traffic_forward_ratio":1,"request_payload_size":256}]}},{"name":"endpoint2","protocol":"http","execution_mode":"parallel","cpu_complexity":{"execution_time":"","method":"","workers":0,"cpu_affinity":null,"cpu_load":""},"memory_complexity":{"execution_time":"","method":"","workers":0,"bytes_load":""},"network_complexity":{"forward_requests":"asynchronous","response_payload_size":512,"called_services":[]}}]}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is cpu_affinity true for this example? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right, I didn't update the example yaml files |
||
service.proto: "syntax = \"proto3\";\n\n\nservice service1 {\n \n rpc endpoint1 (Request) returns (Response) {}\n \n rpc endpoint2 (Request) returns (Response) {}\n \n}\n\nservice service2 {\n \n rpc endpoint1 (Request) returns (Response) {}\n \n rpc endpoint2 (Request) returns (Response) {}\n \n}\n\n\nmessage Request {\n string data = 1;\n}\n\nmessage Response {\n string data = 1;\n}" | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: service1 | ||
namespace: edge-namespace | ||
labels: | ||
version: cluster1 | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: service1 | ||
version: cluster1 | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: service1 | ||
version: cluster1 | ||
spec: | ||
nodeName: cluster1-control-plane | ||
containers: | ||
- name: app | ||
image: app-demo:latest | ||
imagePullPolicy: Never | ||
env: | ||
- name: SERVICE_NAME | ||
value: service1 | ||
ports: | ||
- containerPort: 5000 | ||
volumeMounts: | ||
- mountPath: /usr/src/app/config | ||
name: config-data-volume | ||
readinessProbe: | ||
httpGet: | ||
path: / | ||
port: 5000 | ||
initialDelaySeconds: 1 | ||
periodSeconds: 1 | ||
resources: | ||
limits: | ||
cpu: 2000m | ||
memory: 1024M | ||
requests: | ||
cpu: 2000m | ||
memory: 1024M | ||
volumes: | ||
- name: config-data-volume | ||
configMap: | ||
name: config-service1 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: service1 | ||
namespace: edge-namespace | ||
labels: | ||
version: cluster1 | ||
annotations: | ||
http: / | ||
spec: | ||
selector: | ||
app: service1 | ||
ports: | ||
- name: http | ||
port: 80 | ||
targetPort: 5000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: config-service2 | ||
labels: | ||
name: config-service2 | ||
version: cluster1 | ||
namespace: edge-namespace | ||
data: | ||
conf.json: '{"processes":2,"threads":2,"endpoints":[{"name":"endpoint1","protocol":"http","execution_mode":"parallel","cpu_complexity":{"execution_time":"5s","method":"fibonacci","workers":2,"cpu_affinity":[22,23],"cpu_load":"100%"},"memory_complexity":{"execution_time":"5s","method":"swap","workers":24,"bytes_load":"100%"},"network_complexity":{"forward_requests":"asynchronous","response_payload_size":512,"called_services":[]}},{"name":"endpoint2","protocol":"http","execution_mode":"parallel","cpu_complexity":{"execution_time":"","method":"","workers":0,"cpu_affinity":null,"cpu_load":""},"memory_complexity":{"execution_time":"","method":"","workers":0,"bytes_load":""},"network_complexity":{"forward_requests":"asynchronous","response_payload_size":512,"called_services":[]}}]}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not everyone has access to servers with 24 cores of CPU. I would suggest changing the values of cpu_affinity. |
||
service.proto: "syntax = \"proto3\";\n\n\nservice service1 {\n \n rpc endpoint1 (Request) returns (Response) {}\n \n rpc endpoint2 (Request) returns (Response) {}\n \n}\n\nservice service2 {\n \n rpc endpoint1 (Request) returns (Response) {}\n \n rpc endpoint2 (Request) returns (Response) {}\n \n}\n\n\nmessage Request {\n string data = 1;\n}\n\nmessage Response {\n string data = 1;\n}" | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: service2 | ||
namespace: edge-namespace | ||
labels: | ||
version: cluster1 | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: service2 | ||
version: cluster1 | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: service2 | ||
version: cluster1 | ||
spec: | ||
nodeName: cluster1-control-plane | ||
containers: | ||
- name: app | ||
image: app-demo:latest | ||
imagePullPolicy: Never | ||
env: | ||
- name: SERVICE_NAME | ||
value: service2 | ||
ports: | ||
- containerPort: 5000 | ||
volumeMounts: | ||
- mountPath: /usr/src/app/config | ||
name: config-data-volume | ||
readinessProbe: | ||
httpGet: | ||
path: / | ||
port: 5000 | ||
initialDelaySeconds: 1 | ||
periodSeconds: 1 | ||
resources: | ||
limits: | ||
cpu: 2000m | ||
memory: 1024M | ||
requests: | ||
cpu: 2000m | ||
memory: 1024M | ||
volumes: | ||
- name: config-data-volume | ||
configMap: | ||
name: config-service2 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: service2 | ||
namespace: edge-namespace | ||
labels: | ||
version: cluster1 | ||
annotations: | ||
http: / | ||
spec: | ||
selector: | ||
app: service2 | ||
ports: | ||
- name: http | ||
port: 80 | ||
targetPort: 5000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is suggested to have the existing namespace for all cases, which is
default
.