1. 17 Nov, 2003 1 commit
    • Leigh Stoller's avatar
      Merge the two state machines (batchstate and state) into a single · 2025e0bd
      Leigh Stoller authored
      state machine (state). All of the stuff that was previously handled by
      using batchstate is now embedded into the one state machine. Of
      course, these mostly overlapped, so its not that much of a change,
      except that we also redid the machine, adding more states (for
      example, modify phases are now explicit. To get a picture of the
      actual state machine, on boss:
      
      		stategraph -o newstates EXPTSTATE
      		gv newstates.ps
      
      Things to note:
      
      * The "batchstate" slot of the experiments table is now used solely to
        provide a lock for batch daemon. A secondary change will be to
        change the slot name to something more appropriate, but it can
        happen anytime after this new stuff is installed.
      
      * I have left expt_locked for now, but another later change will be to remove
        expt_locked, and change it to active_busy or some such new state name in
        the state machine. I have removed most uses of expt_locked, except those
        that were necessary until there is a new state to replace it.
      
      * These new changes are an implementation of the new state machine,
        but I have not done anything fancy. Most of the code is the same as
        it was before.
      
      * I suspect that there are races with the batch daemon now, but they
        are going to be rare, and the end result is probably that a
        cancelation is delayed a little bit.
      2025e0bd
  2. 30 Sep, 2003 1 commit
    • Leigh Stoller's avatar
      Up to now we have had two state variables associated with an experiment, · 4269dad1
      Leigh Stoller authored
      plus a lock field. The lock field was a simple "experiment locked, go away"
      slot that is easy to use when you do not care about the actual state that
      an experiment is in, just that it is in "transition" and should not be
      messed with.
      
      The other two state variables are "state" and "batchstate". The former
      (state) is the original variable that Chris added, and was used by the tb*
      scripts to make sure that the experiment was in the state each particular
      script wanted them to be in. But over time (and with the addition of so
      much wrapper goo around them), "state" has leaked out all over the place to
      determine what operations on an experiment are allowed, and if/when it
      should be displayed in various web pages. There are a set of transition
      states in addition to the usual "active", "swapped", etc like "swapping"
      that make testing state a pain in the butt.
      
      I added the other state variable ("batchstate") when I did the batch
      system, obviously! It was intended as a wrapper state to control access to
      the batch queue, and to prevent batch experiments from being messed with
      except when it was really okay (for example, its okay to terminate a
      swapped out batch experiment, but not a swapped in batch experiment since
      that would confuse the batch daemon). There are fewer of these states, plus
      one additional state for "modifying" experiments.
      
      So what I have done is change the system to use "batchstate" for all
      experiments to control entry into the swap system, from the web interface,
      from the command line, and from the batch daemon. The other state variable
      still exists, and will be brutally pushed back under the surface until its
      just a vague memory, used only by the original tb* scripts. This will
      happen over time, and the "batchstate" variable will be renamed once I am
      convinced that this was the right thing to do and that my changes actually
      work as intended.
      
      Only people who have bothered to read this far will know that I also added
      the ability to cancel experiment swapin in progress. For that I am using
      the "canceled" flag (ah, this one was named properly from the start!), and
      I test that at various times in assign_wrapper and tbswap. A minor downside
      right now is that a canceled swapin looks too much like a failed swapin,
      and so tbops gets email about it. I'll fix that at some point (sometime
      after the boss complains).
      
      I also cleaned up various bits of code, replacing direct calls to exec
      with calls to the recently improved SUEXEC interface. This removes
      some cruft from each script that calls an external script.
      
      Cleaned up modifyexp.ph3 quite a bit, reformatting and indenting.
      Also fixed to not run the parser directly! This was very wrong; should
      call nscheck instead. Changed to use "nobody" group instead of group
      flux (made the same change in nscheck).
      
      There is a script in the sql directory called newstates.pl. It needs
      to be run to initialize the batchstate slot of the experiments table
      for all existing experiments.
      4269dad1
  3. 30 May, 2003 1 commit
  4. 23 Apr, 2003 1 commit
    • Leigh Stoller's avatar
      More bloat! Check for experiments in transition. Check state for · 5987ba7f
      Leigh Stoller authored
      active. Add explanation of how to use the page at the top. Add check
      box for modifying the base experiment (virt_lans). Redo Red/Gred stuff
      so that its "greyed" out on links that are not red/gred. Clean up the
      script argument processing and proper permission checks.
      
      The missing feature that would be nice to add is the ability to modify
      the base experiment config when the experiment is swapped out. I think
      it would be very handy. The problem is that instead of looking at
      delays and linkdelays, we have to read virt_lans directly and do a
      bunch of stuff that assign_wrapper does when creating delays and
      linkdelays; namely putting together the individual member parameters
      of a link or lan into a coherent set of values. Not rocket science,
      but a lot of ugly script hacking, and I am not in the mood. Note
      though that I modified the backend (delay_config) to allow this to be
      done in the future.
      5987ba7f
  5. 22 Apr, 2003 1 commit
    • Leigh Stoller's avatar
      Inject some serious bloat! Add queue limit/type and the RED/GRED · b20ae26a
      Leigh Stoller authored
      params. Allow "easier" changing of entire link/lan (rather than having
      to specify each node). A lot data structure hacking to allow for
      reducing the number of actual backend (delay_config) commands issued.
      Used to be 1 per change! Now its one per node or link/lan.
      
      This is almost ready ...
      b20ae26a
  6. 05 Mar, 2003 1 commit
  7. 02 Oct, 2002 1 commit
    • Chad Barb's avatar
      Initial version of delay web control. · dd27f82a
      Chad Barb authored
      Functional, but needs some work.
      Won't allow non-admins to use it (since it doesn't do "proper" permission checking yet.)
      Input is aggressively checked for bad mojo before being pasted into any command line.
      
      Run from /delaycontrol.php3?eid=exptname&pid=projname
      Admin bit must be on.
      dd27f82a