-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.py
64 lines (60 loc) · 1.48 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import requests
import pprint
input = {
"with_db": False,
"solver": {
"type": "NeptuneMinDelayAndUtilization",
"args": {"alpha": 1, "verbose": True, "soften_step1_sol": 1.3}
},
"workload_coeff": 1,
"community": "community-test",
"namespace": "namespace-test",
"node_names": [
"node_a", "node_b", "node_c"
],
"node_delay_matrix": [[0, 3, 2],
[3, 0, 4],
[2, 4, 0]],
"workload_on_source_matrix": [[100, 0, 0], [1, 0, 0]],
"node_memories": [
100, 100, 200
],
"node_cores": [
100, 50, 50
],
"gpu_node_names": [
],
"gpu_node_memories": [
],
"function_names": [
"ns/fn_1", "ns/fn_2"
],
"function_memories": [
5, 5
],
"function_max_delays": [
1000, 1000
],
"gpu_function_names": [
],
"gpu_function_memories": [
],
"actual_cpu_allocations": {
"ns/fn_1": {
"node_a": True,
"node_b": True,
"node_c": True,
},
"ns/fn_2": {
"node_a": True,
"node_b": True,
"node_c": True,
}
},
"actual_gpu_allocations": {
},
}
input["cores_matrix"] = [[1,1,1]] * len(input["function_names"])
input["workload_on_destination_matrix"] = [[1,1,1]] * len(input["function_names"])
response = requests.request(method='get', url="http://localhost:5000/", json=input)
pprint.pprint(response.json())