An Expectant Chat about Script Maturity

advertisement
An Expectant Chat
about Script Maturity
Dr. Alva L. Couch
Electrical Engineering
and Computer Science
Tufts University
couch@eecs.tufts.edu
http://www.eecs.tufts.edu/
~couch/babble
December 6, 2000
www.eecs.tufts.edu/~couch/babble
My original goals
• manage user privileges on a
LightWave 3200 Console Switch
• using convergent administration
scripts that make minimal changes
• create a more powerful ‘expect’ with
modal awareness/exception handling
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Convergence
• “If it ain’t broke, don’t fix it.”
• If it is “broke”, disrupt service as little
as possible in fixing it.
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Convergent account
administration
• Not what but how
• Non-convergent: erase and start over
– erase all users
– build new user table
• Convergent: make minimal changes
– leave appropriately configured users alone
– add, remove, modify others
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Epiphany!
• Expressive power is not empowerment.
• Making ‘expect’ more powerful won’t
help.
• Convergence is complex
– high environmental coupling
– high branch complexity
• Must attack the root of the problem...
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Get your pies ready to throw!
•
•
•
•
I challenge the most basic of tenets
that we must make life easier for us.
I’ll make your lives more difficult.
Make the pies Chocolate Cream.
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Let’s get this over with...
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Scripting is double-edged
• short term win:
– easy tasks become easier
• long term loss:
– poorly documented
– difficult for others to use
– difficult to validate
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Why scripting is a
weak practice
• scripts execute in a highly modal
environment but are typically not
modally aware.
• If they break we “page the author”
instead of questioning why they break.
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Scripts as documentation
• Shift responsibility for modal awareness
away from the script, into the script
interpreter.
• Instead of telling ‘what to do’, tell
‘how to do it’.
• Allow the interpreter to decide ‘when
to do what’.
• Declarative programming.
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Babble
• Instead of writing scripts, document
device interactions in XML.
• To make documentation reusable, bind
things that vary to values listed in a
configuration file.
• To handle modal interactions, allow
documentation to branch when device
responses differ from the norm.
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Configuration
<config> <repeat name='people'>
<instance>
<var name='username'>JOHN</var>
<var name='password'>foo</var>
<var name='logins'>4</var>
<var name='device'>1,4,7</var>
<var name='listen'>1-10</var>
<var name='buffer'>Y</var>
<var name='clear'>Y</var>
</instance>
</repeat> </config>
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Adding a user
<put>adduser\s<var name="username">foo</var>
\r</put>\n
<get>Enter\scase\ssensitive\spassword\s
|\sPASSWORD\s>\s</get>
<put><stars><var name="password">***</var>
</stars>\r</put>\n
<get>Re-enter\scase\ssensitive\spassword\s
|\sPASSWORD\s>\s</get>
<put><stars><var name="password">***</var>
</stars>\r</put>\n
...
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Configuration discovery
<put>listusers\r\n</put>
<while instances="people">
<junction>
<branch>
<get>User\sId\s>\s<var name="username"
pattern="[A-Z0-9]+">FOO</var>\s</get>
</branch><branch>
<get>More</get><put><noecho>\s</noecho></put>
</branch>
</junction>
</while>
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Convergence
<converge key='username' instances='people'>
<list>
<!--how to discover users--> </list>
<add>
<!--how to add a user-->
</add>
<remove> <!--how to remove a user--> </remove>
<read>
<!--how to read user data--> </read>
<modify> <!--how to modify a user--> </modify>
</converge>
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
This is not a script...
•
•
•
•
This may look like a script but
this is documentation, not a program.
Not what but how.
The interpreter exploits rather than
simply interpreting
– ‘Paranoic’ validation
– Built-in convergence and error handling
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Experience
• In production use for account
management.
• Easy ‘rote’ script development process.
• ‘Paranoic’ error checking speeds
development.
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Big ideas
• Babble scripts :
– ‘are closer to real practice than scripts’
– ‘document best practices’
– ‘describe debugging processes’
• The Babble interpreter
– detects many common scripting errors
– encapsulates complex convergent
processes
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Future Uses
• Planned future use: automating service
monitoring and validation.
• Unlike a traditional script, Babble can
easily cross server boundaries.
• To validate a service, ssh or telnet to
another machine and try the service
from there!
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Waxing philosophical...
• We need to allow our interpreters to
become more aware and responsible.
• They can only transcend us if we give
them choices to make.
• They can only make correct choices if
they are educated on our best
practices.
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Conclusions
• Babble is one small step on the path to
total automation of administration.
• Takes away responsibility for execution.
• Grants much more important
responsibility of `education’.
• Not scripting, but `teaching’.
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Availability
• Freely available from
http://www.eecs.tufts.edu/
~couch/babble
• Revision 0.1-Alpha. ~ 4000 lines of Perl5.006
• “more bugs than features” but
• already solves some difficult problems.
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
An Expectant Chat
• URL: http://www.eecs.tufts.edu/
~couch/babble
• Email: couch@eecs.tufts.edu
• (We have an opening for a junior
sysadmin!)
December 6, 2000
www.eecs.tufts.edu/
~couch/babble
Download