2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-26 03:19:48 +00:00
Commit Graph

263 Commits

Author SHA1 Message Date
Jarrod Johnson
e9422e3c4d Implement the ability to delete users 2014-04-11 10:07:35 -04:00
Jarrod Johnson
1b7a18c108 Implement a first attempt at '/users/' to manage authorization and authentication 2014-04-10 17:05:57 -04:00
Jarrod Johnson
4ad8c6ff40 For resource paths short enough, assume a collection name rather than resource name 2014-04-10 13:49:59 -04:00
Jarrod Johnson
0ab31694d5 Implement create and delete from CLI 2014-04-10 13:48:29 -04:00
Jarrod Johnson
9d72be287e Implement send break support in confluent consoles 2014-04-09 15:37:35 -04:00
Jarrod Johnson
d72f3addae Fix missing __init__.py from git repository 2014-04-08 16:27:37 -04:00
Jarrod Johnson
92512da79f Apply IBM 2014 copyright and Apache 2 license to project 2014-04-07 16:43:39 -04:00
Jarrod Johnson
092983caf5 Fix mistake in configmanager around deleting a group 2014-04-07 16:28:45 -04:00
Jarrod Johnson
be552cc446 Fix the session reconfiguration automatic response
Previously, it would register 2**x attribute watchers by mistake.  Exponential
growth of threads trying to talk to one BMC is evidently a bad thing.  Fix
this by correctly tracking and cancelling previous attribute watchers.
Additionally, mask a harmless exception brought on by the death of orphaned
pyghmi console objects by having them yell into the endless void rather
than trip on an exception.
2014-04-04 20:45:48 -04:00
Jarrod Johnson
4f2b15dc8e First pass at automatic reconfiguration enablement
The ipmi plugin, at least, is not yet quite right.  Need to
continue debugging having a console session open, then changing
the bmc to a bad address, then changing it back.  I fixed some of
the easier exceptions, but it is clearly still getting quite confused
to the point where 3 or 4 cycles guarantees the console can not easily heal.
2014-04-04 18:40:45 -04:00
Jarrod Johnson
32ffa4587e Render console method specification more straightforward
Require user indicate 'console.method' rather than trying to guess.
Notably, console.method might not be desired in a configuration
that wishes only to use remote video.
2014-04-04 12:36:46 -04:00
Jarrod Johnson
530cb64402 Fix the 'everything' group behavior 2014-04-04 09:28:09 -04:00
Jarrod Johnson
0d668e3f55 Fix ipmi plugin use of new attribute names 2014-04-04 09:15:20 -04:00
Jarrod Johnson
c89a165c6a Simplify IPMI credential management
The strategy was going to allow for a distinct IPMI account for automation
from other protocols.  However, this is pretty complicated to explain to
people.  The thought before was that the HTTPS/SSH type access could use
a passphrase that is easy to remember whilst ipmi accounts would tend
to be randomized.  Instead, have the software managed authentication
info be used across all protocols and avail endpoint of user management
to add human-friendly accounts if needed (disabling IPMI/SNMP by default
in such cases).
2014-04-04 09:09:00 -04:00
Jarrod Johnson
aadbfdb29a Remove aliases for 'nodes' for now
The aliases can be added when/if the time comes to distinguish types of nodes from one another
2014-04-04 08:58:39 -04:00
Jarrod Johnson
3ec6db4fe9 Configmanager fix up
Implement 'everything' group behavior
precheck group and node settings
do not create groups or nodes by default
Have httpapi preserve original query in case the plugin modifies it for accurate API
explorer output
2014-04-04 08:52:40 -04:00
Jarrod Johnson
96c04d21e2 Remove dead clause for 'keys'
With the departure from shellinabox javascript code, remove the clause that serviced it.
2014-04-03 17:05:08 -04:00
Jarrod Johnson
d859615e45 Change http console replies to not always put things under 'data'.
To resemble more strongly the socket api, have the HTTP response resemble
a normal reply more closely.
2014-04-03 16:55:23 -04:00
Jarrod Johnson
e2e2d884b7 Remove 'null' workaround to UEFI not resetting appmode
Firmware fixes obsolete the need.  The bad behavior on older firmware
is sufficiently tolerable that code to workaround that could have bad
side effects can reasonably be abolished.
2014-04-03 15:01:51 -04:00
Jarrod Johnson
8fa8951896 Put comments in to hint a decent strategy to profile runtime performance
To do performance optimization in this sort of application, this is
about as well as I have been able to manage in python.  I will say perl with
NYTProf seems to be significantly better for data, but this is servicable.

I tried yappi, but it goes wildly inaccurate with this codebase.  Because of
the eventlet plumbing, cProfile is still pretty misleading.  Best strategy
seems to be review cumulative time with a healthy grain of salt around the
top items until you get down to info that makes sense.  For example, trampoline
unfairly gets a great deal of the 'blame' by taking on nearly all the activity.

internal time seems to miss a great deal of important information.
2014-04-03 09:54:46 -04:00
Jarrod Johnson
e7eab2bb20 Have confetty put notable state information into title of terminal 2014-04-02 16:18:30 -04:00
Jarrod Johnson
f57060a314 Send clients notifications about changing numbers of clients connecting 2014-04-02 15:48:31 -04:00
Jarrod Johnson
15fefe6d1e Convert states from a number to a string
Remote clients are presented the data as-is rather than trying to coordinate
the meaning of abstract numbers.
2014-04-02 15:14:56 -04:00
Jarrod Johnson
fcf8a36659 Begin tracking disconnected/connecting/connected state in console server
This also has failed connection attempts causing a 30-60 second retry.  Said retry
is done early if a user session attaches in the meantime.
2014-04-02 13:29:04 -04:00
Jarrod Johnson
a2f540d3b9 Fix issue where ipmi plugin left configmanager decrypting more than needed 2014-04-02 08:59:40 -04:00
Jarrod Johnson
a29032e70c Rework ipmi console object to block on connect
Previously, the state would be seen as 'connected' and then 'disconnected' in event of
connection failing.  Rework things such that the console session stays in 'connecting' state
until timeout or success occurs and don't send disconnect, instead raising an exception.
This makes the connection action a bit more intuitive to the user, who would assume a 'connected'
console means the endpoint was reachable.  This may not always be possible in a console plugin,
but it's a nice pattern when possible.  If a console plugin cannot tell when 'connected' happens, then
the previous behavior of this plugin makes sense as a 'best effort': return 'connected', send
disconnect event when the console turns out to be bad.  For example, executable consoles are most
likely going to follow this pattern.  An option could be for an executable to have a certain
signature to print to show 'connected' though...
2014-04-01 16:53:20 -04:00
Jarrod Johnson
6fcfc70985 Rename endpoint unreachable exception to be more genericly applicable 2014-04-01 16:32:56 -04:00
Jarrod Johnson
17bf92ce16 Aggregate changes into sets and notify only after changeset full
This change causes cfg change notifications to more accurately reflect atomic
expectactions.  If multiple fields are changed on multiple nodes that a watcher may
have registered, they will now get that data in one chunk instead of many.
2014-04-01 14:48:31 -04:00
Jarrod Johnson
43c6ed5c93 Amend the notification structure to better bind attributes to nodes 2014-04-01 14:10:30 -04:00
Jarrod Johnson
fda2dd08d1 First pass at configuration change notification
Add ability for code to add watchers on nodes and their attributes.  This is likely to
be reworked internally to better aggregate requests, but the code interface
is potentially complete.
2014-04-01 11:01:26 -04:00
Jarrod Johnson
9d8ff78716 Fix persistence of group data on node deletion. 2014-03-28 16:42:36 -04:00
Jarrod Johnson
f326a03d33 Fix attributes plugin for api rename 2014-03-28 15:29:48 -04:00
Jarrod Johnson
f7321f4e70 Rename nodes and groups collections
It has been expressed that plural form for collection names are preferred.  Additionally, tab
completion is nicer if names do not share so much leading characters.
2014-03-28 14:59:37 -04:00
Jarrod Johnson
e96e4bd527 Fix bug with log replay without log
Without log, termstate was left as non-numeric None.  Correct
to set to zero if still None by the time return happens.
2014-03-18 16:30:37 -04:00
Jarrod Johnson
2742e83751 Fix order of text log reassembly
The facility was incorrectly reassembling the text records in reverse order.  With this change,
the set buffer from log function seems to be working as intended.
2014-03-12 19:50:42 -04:00
Jarrod Johnson
92210a9097 Only set most recent state
Before, it would delve back to set state if recent entries indicated to not
assert the tracked states.  Correct that behavior so only last entry counts.
2014-03-12 17:14:00 -04:00
Jarrod Johnson
28a9c9b900 Attempt to read in recent state/data from log
The attempt seems to not work right at the moment, but it seems to be in the
right direction and also does grab terminal state.
2014-03-12 17:12:01 -04:00
Jarrod Johnson
2ba93379b7 Track some particularly key terminal states and replay them for new clients
ESXi requires a distinctly different keypad mode and 'shift in' character set.  Track
requests for those states.  Reset on 'null' character, which seems to only be emitted by UEFI
so far.  Ideally, things change such that we can remove that workaround.
2014-03-12 16:16:31 -04:00
Jarrod Johnson
12d3f91d59 Amend connection count to avoid oversized count
Since the log analysis merely needs to know if a connect/disconnect is redundant,
only report 0, 1, or '2' connections to indicate 2 or greater.  log analysis
then would want to seek out a connect with eventdata of '1' and disconnect with
eventdata of '0' and mostly ignore the '2' info.  Desire for more data
could be done by actually counting the connects and disconnects, this is
just to provide a fast path to finding the 'first connection' and 'last disconnect'
signatures.
2014-03-10 13:25:08 -04:00
Jarrod Johnson
bbbb88b2b2 Track how many times a user is connected on connect/disconnect events
For a log reviewer tool to unambiguously understand whether a given user is conceivably watching,
more data is needed.  It doesn't keep track of which disconnect goes with which connection, but
it at least provides a way of detecting whether user is truly disconnected or not.
2014-03-10 13:15:31 -04:00
Jarrod Johnson
466b37495e Implement preliminary console logging facility
Implement the bits and pieces that are at least required for conserver like logging.
This has a plaintext file and a binary metadata file.  The plaintext file basically
resembles a conserver log, while the binary file facilitates faster seeking to points
of interest with the file and much more precise timestamp information.
2014-03-09 20:34:39 -04:00
Jarrod Johnson
83627938bb Fix problem on disconnect from console session
After refactor, some bad codepath was left behind in confetty.  Address the
shortcoming.
2014-03-06 19:49:46 -05:00
Jarrod Johnson
65af925b2d Add quick and dirty example of a command
'nodepower' is not yet 'rpower' like, but it's a quick
demonstration of using the python confluent client library.  It
only supports unix socket as written
2014-03-04 21:09:17 -05:00
Jarrod Johnson
a5504ec62f Refactor/rename code
confetty had a lot of stuff in it.  Factor out bits to a common library for
constructing purpose oriented commands.
2014-03-04 17:12:19 -05:00
Jarrod Johnson
04faa9fdfd Correct typo of 'nodes' as 'node' 2014-03-03 20:16:14 -05:00
Jarrod Johnson
9617d1f4a4 Implement dbm style backing for the configuration persistence
The pickling would get horrendously slow as total node count increased.  This meant very long time to sync
to disk for just one change out of 65,000.  This strategy changes things to more selective and only
do things for the dirty keys rather than everything.  Large changes to small amounts of nodes will take
more time (because more calls to dump pickle), but small changes to a small subset of nodes will take much
less time.
2014-03-03 20:01:13 -05:00
Jarrod Johnson
7595984cb9 Have socket api gracefully handle client disconnect
When client disconnected, an unsightly trace was incurred.
Properly handle that particular scenario and proceed as intended.
2014-03-03 16:03:10 -05:00
Jarrod Johnson
7caa9f741f Have sockapi stay alive through as-yet uncaught circumstances
Previously, the client would be left hanging.  Correct that by
keeping the session alive and notifying the client of the unexpected
condition.
2014-03-03 15:52:12 -05:00
Jarrod Johnson
3e1f90882f Fix confetty client behavior when trying to show something that is 404 2014-03-03 15:48:33 -05:00
Jarrod Johnson
79fc5faaf6 Fix problem where reordering groups did not affect inheritence
There was an optimization to skip examination of groups if it was determined
that the group membership had not changed.  However, this erroneously
masked the examination in the case of reordered groups.  Skip the
optimization to cover that case at the expense of at least some needless churn.
This only happens when something goes to change group membership in some way, so
this shouldn't be too expensive.
2014-03-03 15:35:08 -05:00