[cs615asa] HW6 Grades

Jan Schaumann jschauma at stevens.edu
Sat May 19 11:09:30 EDT 2018


All,

I've just sent out grades for HW6.  If you have not received an email
with your grade, please let me know asap.

A few notes on the assignment:

Several of you misunderstood how the environment variables should be
used.  They were intended to let the user specify any arbitrary flags
they want, not only those given as examples in the manual page or those
that you happened to consider useful.

Likewise, if the user specifies invalid flags, then it's not on your
program to try to detect or correct those.  However, your program needs
to be able to fail gracefully and not attempt to barrel forward
regardless of what the outcome of the commands invoked may have been.

Many of you set defaults for communications with AWS that do not hold in
all scenarios.  The use of the environment flags allows the user to
handle all of this, and a lot of your logic to handle user configuration
is not needed.


One of the most difficult parts of this assignment is dealing with AWS
and the different configurations and output that you may encounter.  The
output you receive from the commands depends on the user's
configuration, so you need to be very specific about the output you
expect and handle.  For almost all commands, you are best off using the
'--query' command to exactly specify the output field rather than trying
to parse text based output based on patterns.


Often, you have to wait for a given condition to be satisfied in AWS;
most of you decided to implement a loop that polls periodically and
sleeps in between.  A simpler approach is to use the 'aws ec2 wait'
command, which does all that for you.


Many of you keep duplicating code or variable declarations in large code
branches; try to develop a habit of never duplicating code.  If you have
to write the same code or string multiple times, try to think about how
to avoid that by declaring it once and then adding/manipulating it or to
create a separate function.


Writing the archive on the remote side to the volume was another pain
point for many of you, where some of you ended up writing to a file
under '/dev' or otherwise filed to write to the volume.  I'm not sure if
any of you verified that they could retrieve the data from the volume
after the backup, but that would have been a good way of verifying your
program works.


Lastly, the single most important lesson you should take away here, and
one that bears repeating often is that you have to check the return
value of any function you call and any command you run.  Do not only
rely on the exit status, but also assert the format of the output is as
expected.  For example, if you try to get an instance's IP address, and
the program you invoke returns successfully, it's still possible that it
returned an empty string.

If you reliably verify that the functions you call return what you
expected, then your program can handle all the different scenarios well,
even if it will not always succeed.  Appropriate failure with a useful
error message is critical to a robust program.


-Jan


More information about the cs615asa mailing list