Changes between Version 7 and Version 8 of Internal/NewNodeAgent
- Timestamp:
- Nov 11, 2014, 6:41:53 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Internal/NewNodeAgent
v7 v8 12 12 ''' Design Notes: ''' 13 13 14 '''kmodule.rb''' 14 '''kmodule.rb'''[[BR]] 15 15 ''' Interface: ''' 16 16 * new (private) 17 17 * 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 load19 * unload - unloads module is conditions are met, and de-registers the unload requestor18 * 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 20 20 * loaded? - preforms an actual check to see if module is loaded 21 21 22 22 Moving 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). 23 23 24 ''' nodeagent.rb: ''' 24 ''' nodeagent.rb: '''[[BR]] 25 ''' Interface ''' 26 * hwDiscover - 27 * instance 28 * run 25 29 26 30 The 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. 27 31 28 32 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 30 46 31 47 We'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. 32 48 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 34 75 35 76 This 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. 36 77 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() 38 87 39 TODO40 88 41 ''' rcDrv_e1000e.rb''' 89 ''' rcDrv_e1000e.rb < ethernet.rb'''[[BR]] 90 ''' Interface ''' 91 * new 92 42 93 e1000e 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 43 94 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 48 123 49 124 ''' Driver Inheretance Chain ''' … … 69 144 ''' 10/30/2014''' 70 145 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. 146 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 making the logical names mutable. 147 148 149 ---- 150 ''' 11/11/2014 ''' 151 Now 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 153 In http://www.orbit-lab.org/browser/omf/omf-expctl/ruby/omf-expctl/node/nodeSetPath.rb 154 the 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