-
Notifications
You must be signed in to change notification settings - Fork 52
/
test_deploy.py
46 lines (34 loc) · 1.33 KB
/
test_deploy.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
import autonetkit.console_script as console_script
import os
import autonetkit
import autonetkit.load.graphml as graphml
import autonetkit.diff
automated = True # whether to open ksdiff, log to file...
enabled = False
if __name__ == "__main__":
# not called by test
automated = False
enabled = True
remote_server = "54.252.205.75"
if enabled:
dirname, filename = os.path.split(os.path.abspath(__file__))
input_file = os.path.join(dirname, "../big.graphml")
input_graph = graphml.load_graphml(input_file)
import autonetkit.build_network as build_network
anm = build_network.initialise(input_graph)
anm = build_network.apply_design_rules(anm)
render_hostname = "localhost"
nidb = console_script.create_nidb(anm)
import autonetkit.compilers.platform.netkit as pl_netkit
nk_compiler = pl_netkit.NetkitCompiler(nidb, anm, render_hostname)
nk_compiler.compile()
import autonetkit.render
autonetkit.render.render(nidb)
import autonetkit.deploy.netkit as nk_deploy
username = "ubuntu"
home_dir = os.path.expanduser("~")
key_filename = os.path.join(home_dir, ".ssh/aws.pem")
dst_folder = nidb.topology['localhost'].render_dst_folder
nk_deploy.deploy(remote_server, username, dst_folder,
key_filename, parallel_count = 10)
#console_script.measure_network(anm, nidb)