Changes between Version 7 and Version 8 of Internal/NewNodeAgent


Ignore:
Timestamp:
Nov 11, 2014, 6:41:53 PM (10 years ago)
Author:
ssugrim
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/NewNodeAgent

    v7 v8  
    1212''' Design Notes: '''
    1313
    14 '''kmodule.rb'''
     14'''kmodule.rb'''[[BR]]
    1515''' Interface: '''
    1616 * new (private)
    1717 * instance - give you and instance of the object with checks to make sure the module name is unique
    18  * load(private) - loads the module if needed and registers a reference to the class that requested the load
    19  * unload - unloads module is conditions are met, and de-registers the unload requestor
     18 * mload(private) - loads the module if needed and registers a reference to the class that requested the load
     19 * munload - unloads module is conditions are met, and de-registers the unload requestor
    2020 * loaded? - preforms an actual check to see if module is loaded
    2121
    2222Moving all the functionality of module handling into a separate class. There may be a need to have drivers load multiple modules. Additionally the module class needs to keep track of how many devices are using one module (as there may be many to one). The unload method should only unload if the last reference asks it to (all other references have de-registered).
    2323
    24 ''' nodeagent.rb: '''
     24''' nodeagent.rb: '''[[BR]]
     25''' Interface '''
     26 * hwDiscover -
     27 * instance
     28 * run
    2529
    2630The hwdiscovery mode of the nodeagent code is being re-done. Instead of the original grep lspci lines, we now have has of dev_id's. Each dev_id in the hash maps to a node agent device driver that will be loaded to handle that specific device. This device will load the module for it's respective device type.
    2731
    2832
    29 ''' devices.rb '''
     33''' agentCommands.rb: '''[[BR]]
     34''' Interface '''
     35 * configure
     36
     37''' device.rb '''[[BR]]
     38''' Interface '''
     39 * activate
     40 * deactivate
     41 * active?
     42 * getconfigCMD
     43 * configure
     44 * hasMod?
     45 *add_kmodName
    3046
    3147We're implementing all the module handeling code here. It uses the cocaine command line library as a wrapper. The cocaine lib kicks out an exception if the command fails. Exception handling will mitigate failed commands.
    3248
    33 ''' ethernet.rb '''
     49''' ethernet.rb < device.rb'''[[BR]]
     50''' Interface '''
     51 * initialize()
     52 * claim_ctrl(call_ref)
     53 * self.set_control_if(iface="eth1")
     54 * self.get_control_if()
     55 * control_if?
     56 * set_ip(ip)
     57 * get_ip()
     58 * up()
     59 * down()
     60 * set_netmask(netmask)
     61 * set_mtu(mtu)
     62 * set_mac(mac)
     63 * get_mac()
     64 * set_arp(arp)
     65 * set_forwarding(forwarding)
     66 * set_gateway(gateway)
     67 * drop_config()
     68 * restart_dhcp()
     69 * execConfigCmd(prop, value=nil)
     70 * getCmdForRoute(value)
     71 * getCmdForFilter(value)
     72 * deactivate()
     73
     74 
    3475
    3576This class is responsible for all of the ifconfig/route handling code (all things ethernet). The same cocaine lib will handle shell commands with similar exception handeling. The interface has been extended to implement getters and setters for all the requisite interface state (ip, netmask, etc...). We've left the original get config command structure alone, but now also have implemented an execConfigCmd which will actually implement these config commands.
    3677
    37 ''' wifi.rb '''
     78''' wifi.rb < ethernet.rb '''[[BR]]
     79''' Interface '''
     80 * initialize()
     81 * check_time
     82 * connected?()
     83 * connect_simple(ssid)
     84 * disconnect()
     85 * checkStatus(retries = true)
     86 * scan()
    3887
    39 TODO
    4088
    41 ''' rcDrv_e1000e.rb'''
     89''' rcDrv_e1000e.rb < ethernet.rb'''[[BR]]
     90''' Interface '''
     91 * new
     92
    4293e1000e kernel module specif driver. A child of ethernet. Overides any thing that is specific to e1000e, but mostly leaves the parent class in tact. Also sets the value of @kmodName
    4394
    44 More to follow[[BR]]
    45 .[[BR]]
    46 .[[BR]]
    47 .[[BR]]
     95
     96''' rcdrv_r8169.rb < ethernet.rb'''[[BR]]
     97''' Interface '''
     98 * new
     99
     100''' rcdrv_skge.rb < ethernet.rb'''[[BR]]
     101''' Interface '''
     102 * new
     103
     104''' rcdrv_ath5k.rb < wifi.rb'''[[BR]]
     105''' Interface '''
     106 * new
     107
     108''' rcdrv_ath9k.rb < wifi.rb'''[[BR]]
     109''' Interface '''
     110 * new
     111
     112''' rcdrv_ipw2200.rb < wifi.rb'''[[BR]]
     113''' Interface '''
     114 * new
     115
     116''' rcdrv_iwlwifi.rb < wifi.rb'''[[BR]]
     117''' Interface '''
     118 * new
     119
     120''' rcdrv_wl.rb < wifi.rb'''[[BR]]
     121''' Interface '''
     122 * new
    48123
    49124''' Driver Inheretance Chain '''
     
    69144''' 10/30/2014'''
    70145
    71 I've run into a chicken and egg problem where I need to know the device name before I can make the object but can't know the device name until after the object is made. I think I'm going to resolve this by makign the logical names muteable.
     146I've run into a chicken and egg problem where I need to know the device name before I can make the object but can't know the device name until after the object is made. I think I'm going to resolve this by making the logical names mutable.
     147
     148
     149----
     150''' 11/11/2014 '''
     151Now trying to integrate the driver and agent code. We'll basically be modifying the behavior of the agentCommands.configure method. This used to construct command strings that would be run with minimal error checking. Now this will map the request strings to a specific method call. This method should have it's own error handling and raise exceptions when something doesn't work properly. These exceptions can be caught at the top level to prevent crashes.
     152
     153In http://www.orbit-lab.org/browser/omf/omf-expctl/ruby/omf-expctl/node/nodeSetPath.rb
     154the set of possible properties that can be set is listed in an array. The original agent command code is here: http://www.orbit-lab.org/browser/omf/omf-resctl/ruby/omf-resctl/omf_agent/agentCommands.rb