1. 14 Dec, 2017 3 commits
    • Swann Perarnau's avatar
      [refactor] Fix container namedtuple · 9afe59c7
      Swann Perarnau authored
      This patch propagates the process object into the container namedtuple,
      fix a couple of bad function calls and adapt the run command handler to
      use that process object instead of just the pid of it.
      9afe59c7
    • Swann Perarnau's avatar
      [fix] Fix missing logging changes · ed33ef6d
      Swann Perarnau authored
      The logging improvement patch missed a few calls.
      ed33ef6d
    • Swann Perarnau's avatar
      [refactor] Use globally configured logger · b66c88ec
      Swann Perarnau authored
      The logging module allow us to configure logging facilities once per
      process using basicConfig, and then to use globally defined, named,
      logger objects. This simplifies access to logger objects, their
      configuration and remove pointers from all objects.
      
      This patch refactor all the logging calls to use a single 'nrm' logger
      object, using those facilities.
      b66c88ec
  2. 13 Dec, 2017 3 commits
    • Swann Perarnau's avatar
      [feature] Add kill command · 63c2dea8
      Swann Perarnau authored
      This patch adds a command to kill the parent process of a container
      based on the container uuid, triggering the death of the container.
      
      The os.kill command interacts pretty badly with the custom built
      children handling, causing us to catch unwanted exceptions in an effort
      to keep the code running. The waitpid code was also missing a bit about
      catching children exiting because of signals, so we fixed that.
      
      At this point, two things should be paid attention to:
        - we don't distinguish properly between a container and a command.
        This will probably cause issues later, as it should be possible to
        launch multiple programs in the same container, and for partitions to
        survive the death of the parent process.
        - the message format is growing more complex, but without any
        component having strong ownership over it. This will probably cause
        stability issues in the long term, as the format complexifies and we
        lose track of the fields expected from everyone.
      63c2dea8
    • Swann Perarnau's avatar
      [feature] Add command to list containers · 2f470afb
      Swann Perarnau authored
      This patch adds a very simple command to list the containers currently
      known by the NRM. There's no history or state tracking on the NRM, so
      the code is pretty simple.
      
      We expect that some of the container tracking doesn't need to be sent
      for such a command, so the listing also filters some of the fields.
      
      This patch also adds an 'event' field to container messages, as it would
      probably be needed further for other kind of operations.
      2f470afb
    • Swann Perarnau's avatar
      [feature] Implement simple RM for containers · 1c4645cc
      Swann Perarnau authored
      This patch refactor the resource management and hwloc code into a
      working, albeit very simple scheduling policy. Indeed, the previous code
      contained strong assumptions about the output of hwloc matching an Argo
      NodeOS configuration used during the previous phase of the project, that
      always contained enough CPUs and Mems to perform exclusive scheduling.
      
      The current version is simpler, but should work on more regular systems.
      The patch also improves code organization so that introducing more
      complex scheduling algorithms will be simpler.
      
      The testing of this code resulted in the discovery of simple bugs in the
      daemon children handling code, which should work now.
      1c4645cc
  3. 11 Dec, 2017 4 commits
    • Swann Perarnau's avatar
      [feature] Pull the Argus code into the NRM · 92290b22
      Swann Perarnau authored
      The Argus (globalos) launcher had prototype code to read a container
      manifest, create a container using Judi's code, and map resources using
      hwloc.
      
      This patch brings that code, almost intact, into the NRM repo. This code
      is quite ugly, and the resource mapping crashes if the kernel
      configuration isn't right. But it's still a good starting point, and we
      should be able to improve things little by little.
      
      One part in particular needs attention: SIGCHLD handling. We should
      think of using ioloop-provided facilities to avoid this mess.
      
      The patch also contains the associated CLI changes.
      
      Note: the messaging format is starting to be difficult to keep in check,
      as there's conversions and field checks all over the code. See #3 for
      a possible solution.
      92290b22
    • Swann Perarnau's avatar
      [feature] Add container run skeleton · 5f6f9415
      Swann Perarnau authored
      This is the first step in a series of patches to integrate the container
      launching code from Argus (globalos) into the NRM infrastructure.
      
      This patch creates a valid command on the CLI, and sends the necessary
      info to the NRM. We still need to take care of the actual container
      creation.
      
      Note that the CLI waits for an event indicating that the container was
      launched, at that at this point the event is never generated by the NRM.
      5f6f9415
    • Swann Perarnau's avatar
      [refactor] Improve power message format · 63db906e
      Swann Perarnau authored
      This commit changes the message format for the upstream API, to use a
      json-encoded dictionary. While the format is not set in stone at this
      point, the goal is to slowly move into a proper protocol, with
      well-defined fields to the messages, and proper mechanisms to send
      commands and receive notification of their completion.
      
      The only current user of this API is the power management piece, and
      this change breaks the GRM code maintained outside of this repo. We will
      need to reconcile the two implementation once the message protocol gets
      more stable.
      
      Related to #1 and #6.
      63db906e
    • Swann Perarnau's avatar
      [feature] Implement basic CLI · bc1b7fd2
      Swann Perarnau authored
      Only supports setpower for now, and while it should work in theory, the
      current code doesn't have a way to check if the command was received, as
      the daemon never advertise the current limit.
      
      We need to change the protocol at this point.
      
      This also fixes a bug in the daemon code, that was expecting a single
      string as a message, instead of a list of parts, as zmqstream always
      receives.
      bc1b7fd2
  4. 08 Dec, 2017 5 commits
  5. 06 Sep, 2017 1 commit
  6. 05 Sep, 2017 2 commits
  7. 30 Aug, 2017 4 commits
    • Swann Perarnau's avatar
      [refactor] Use actual sensor info in control loop · 90efdac3
      Swann Perarnau authored
      This patch is the last link between coolr and the daemon. We now create
      a dictionary of machine information inside the sensor manager, and give
      this dictionary back to the daemon. The daemon can then use the real
      data for control.
      
      We still need to receive the target power from somewhere, and that will
      come later.
      90efdac3
    • Swann Perarnau's avatar
      Import coolr files into project, link to sensor · 48771c04
      Swann Perarnau authored
      This a partial import of github.com/coolr-hpc/pycoolr from
      master branch, commit id: 67e7aa4b89b67744922b5926cd1459adf650013b
      
      Coolr will provide us the capability to read power, topology and
      msr-based sensors.
      
      This patch links the sensor module with the coolr code as it is, which
      doesn't really work. The core issue is that the current coolr code is
      meant to be stand-alone, and the main functions to both sampling and
      formatting of the data in json, by hand.
      
      We will solve that in the next commit, removing the json-specific code
      from the sample function to create a dict of values instead.
      48771c04
    • Swann Perarnau's avatar
      Move sensor management to separate module · c0b82b60
      Swann Perarnau authored
      Create a `sensor` module that will handle the interaction with coolr and
      return updated machine information regularly.
      
      The code code is as dumb as the previous one, but the structure is
      improved, which should help for the next round of updates with coolr.
      c0b82b60
    • Swann Perarnau's avatar
      [refactor] Rename clients to applications · 1a8707f2
      Swann Perarnau authored
      Giving the deadlines we have, it's probably a good idea to keep things
      simple and keep the application facing protocol exactly as it is, and
      restrict it to just applications. This way we can keep using the argobots
      tests as valid benchmarks, and at the same start building a decent
      communication protocol on a different socket, with a better interface.
      
      To clarify that, the daemon now use the word application to refer to
      clients connecting on the "legacy" interface.
      
      We'll add a different socket and start building a real protocol in
      future commits.
      1a8707f2
  8. 29 Aug, 2017 1 commit
  9. 25 Apr, 2017 1 commit
    • Swann Perarnau's avatar
      [refactor] Python rewrite of the software · 86409f88
      Swann Perarnau authored
      We chose to rewrite the entire thing in python. The language should make
      it easy to interact will all the moving parts of the Argo landscape, and
      easy to prototype various control schemes.
      
      The communication protocol is exactly the same, but implemented with
      ZeroMQ + tornado.
      
      Power readings are not integrated yet, we are targeting using the Coolr
      project for that.
      
      This is a rough draft, all the code is in binary scripts instead of
      the package, and there are no unit tests. Nevertheless, it should be
      a decent starting point for future development.
      86409f88