Exemplo n.º 1
0
def get_aip():
    """Get AIPplatform to interface with agent directories in vhome"""

    vhome = get_home()
    options = type("Options", (), dict(volttron_home=vhome))
    aip = AIPplatform(options)
    return aip
Exemplo n.º 2
0
def aip(request):
    volttron_home = tempfile.mkdtemp()
    packaged_dir = os.path.join(volttron_home, "packaged")
    os.makedirs(packaged_dir)
    ipc = 'ipc://{}{}/run/'.format(
        '@' if sys.platform.startswith('linux') else '',
        volttron_home)
    local_vip_address = ipc + 'vip.socket'
    os.environ['VOLTTRON_HOME'] = volttron_home

    opts = dict(
        volttron_home=volttron_home,
        vip_address=get_rand_vip(),
        local_vip_address=ipc+'vip.socket',
        publish_address=ipc+'publish',
        subscribe_address=ipc+'subscribe',
        log_level=logging.DEBUG
    )
    options = type('Options', (), opts)

    # 'verify_agents': False,
    # 'volttron_home': self.volttron_home,
    # 'vip_address': vip_address,
    # 'vip_local_address': ipc + 'vip.socket',
    # 'publish_address': ipc + 'publish',
    # 'subscribe_address': ipc + 'subscribe',
    # 'bind_web_address': bind_web_address,
    # 'volttron_central_address': volttron_central_address,
    # 'volttron_central_serverkey': volttron_central_serverkey,
    # 'platform_name': None,
    # 'developer_mode': not encrypt,
    # 'log': os.path.join(self.volttron_home, 'volttron.log'),
    # 'log_config': None,
    # 'monitor': True,
    # 'autostart': True,
    # 'log_level': logging.DEBUG,
    # 'verboseness': logging.DEBUG
    aip = AIPplatform(options)
    aip.setup()
    return aip
Exemplo n.º 3
0
def aip(request):
    volttron_home = tempfile.mkdtemp()
    packaged_dir = os.path.join(volttron_home, "packaged")
    os.makedirs(packaged_dir)
    ipc = 'ipc://{}{}/run/'.format(
        '@' if sys.platform.startswith('linux') else '',
        volttron_home)
    local_vip_address = ipc + 'vip.socket'
    os.environ['VOLTTRON_HOME'] = volttron_home

    opts = dict(
        volttron_home=volttron_home,
        vip_address=get_rand_vip(),
        local_vip_address=ipc+'vip.socket',
        publish_address=ipc+'publish',
        subscribe_address=ipc+'subscribe',
        log_level=logging.DEBUG
    )
    options = type('Options', (), opts)

    # 'verify_agents': False,
    # 'volttron_home': self.volttron_home,
    # 'vip_address': vip_address,
    # 'vip_local_address': ipc + 'vip.socket',
    # 'publish_address': ipc + 'publish',
    # 'subscribe_address': ipc + 'subscribe',
    # 'bind_web_address': bind_web_address,
    # 'volttron_central_address': volttron_central_address,
    # 'volttron_central_serverkey': volttron_central_serverkey,
    # 'platform_name': None,
    # 'log': os.path.join(self.volttron_home, 'volttron.log'),
    # 'log_config': None,
    # 'monitor': True,
    # 'autostart': True,
    # 'log_level': logging.DEBUG,
    # 'verboseness': logging.DEBUG
    aip = AIPplatform(options)
    aip.setup()
    return aip
Exemplo n.º 4
0
def aip(request):
    volttron_home = tempfile.mkdtemp()
    packaged_dir = os.path.join(volttron_home, "packaged")
    os.makedirs(packaged_dir)
    ipc = "ipc://{}{}/run/".format(
        "@" if sys.platform.startswith("linux") else "", volttron_home)
    local_vip_address = ipc + "vip.socket"
    os.environ["VOLTTRON_HOME"] = volttron_home

    opts = dict(
        volttron_home=volttron_home,
        vip_address=get_rand_vip(),
        local_vip_address=ipc + "vip.socket",
        publish_address=ipc + "publish",
        subscribe_address=ipc + "subscribe",
        log_level=logging.DEBUG,
    )
    options = type("Options", (), opts)

    # 'verify_agents': False,
    # 'volttron_home': self.volttron_home,
    # 'vip_address': vip_address,
    # 'vip_local_address': ipc + 'vip.socket',
    # 'publish_address': ipc + 'publish',
    # 'subscribe_address': ipc + 'subscribe',
    # 'bind_web_address': bind_web_address,
    # 'volttron_central_address': volttron_central_address,
    # 'volttron_central_serverkey': volttron_central_serverkey,
    # 'platform_name': None,
    # 'log': os.path.join(self.volttron_home, 'volttron.log'),
    # 'log_config': None,
    # 'monitor': True,
    # 'autostart': True,
    # 'log_level': logging.DEBUG,
    # 'verboseness': logging.DEBUG
    aip = AIPplatform(options)
    aip.setup()
    return aip
Exemplo n.º 5
0
 def _aip(self):
     opts = type('Options', (), self.opts)
     aip = AIPplatform(opts)
     aip.setup()
     return aip
Exemplo n.º 6
0
 def _aip(self):
     opts = type('Options', (), self.opts)
     aip = AIPplatform(opts)
     aip.setup()
     return aip