install: updates to support building deb/rpm packages that contain python wheels and install core from a single file, updates to core to install scripts by way of python directly

This commit is contained in:
Blake Harnden 2022-07-27 16:00:10 -07:00
parent cd6bb319ad
commit fcf6f30302
54 changed files with 528 additions and 187 deletions

View file

@ -0,0 +1,36 @@
import logging
from core.emulator.coreemu import CoreEmu
from core.emulator.data import IpPrefixes
from core.emulator.enumerations import EventTypes
from core.nodes.lxd import LxcNode
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
coreemu = CoreEmu()
session = coreemu.create_session()
session.set_state(EventTypes.CONFIGURATION_STATE)
# create nodes and interfaces
try:
prefixes = IpPrefixes(ip4_prefix="10.83.0.0/16")
# create node one
options = LxcNode.create_options()
options.image = "ubuntu:18.04"
node1 = session.add_node(LxcNode, options=options)
interface1_data = prefixes.create_iface(node1)
# create node two
node2 = session.add_node(LxcNode, options=options)
interface2_data = prefixes.create_iface(node2)
# add link
session.add_link(node1.id, node2.id, interface1_data, interface2_data)
# instantiate
session.instantiate()
finally:
input("continue to shutdown")
coreemu.shutdown()