1. 06 Nov, 2009 1 commit
    • Iustin Pop's avatar
      Change the Utils.fromObj signature · 262f3e6c
      Iustin Pop authored
      Currently the fromObj function takes a JSON object which is then
      converted into a list of (String, JSValue) in which we make a lookup.
      However, most of the callers of this function call it repeatedly on the
      same object, which means we do the object→list conversion repeatedly.
      
      This patch converts it to take directly the list, and converts its
      callers to do the conversion themselves (and only once).
      
      While this is not in the hot-path today, it would be if we ever were to
      process much data over Luxi (or RAPI), and is a good cleanup in any
      case.
      262f3e6c
  2. 14 Jul, 2009 1 commit
    • Iustin Pop's avatar
      Introduce timeout in RAPI queries · 135a6c6a
      Iustin Pop authored
      The patch adds two constants in Types.hs for connect and query timeout,
      then modifies Rapi.hs to use them as the connect and general curl
      timeout.
      
      Rapi could be improved more, as currently we wait double the total
      timeout due to not aborting early in case the node queries failed.
      135a6c6a
  3. 06 Jul, 2009 1 commit
    • Iustin Pop's avatar
      Fix hlint-generated warnings · 9f6dcdea
      Iustin Pop authored
      This big patch cleans up the code per hlint indications. Many removals
      of extra parentheses, replacements of concat . map with concabtMap,
      extra dollar signs, eta reductions, etc. were performed.
      
      The code still compiles and passes a couple of manual tests on sample
      files. The individual changes are also small enough as to be visually
      easy to confirm.
      9f6dcdea
  4. 10 Jun, 2009 2 commits
    • Iustin Pop's avatar
      Add cpu-count-related attributes to nodes · 1a82215d
      Iustin Pop authored
      This patch adds cpu-count related attributes to nodes:
        - total cpus
        - cpus in use
        - ratio of virtual:physical cpus
      
      We also set correctly the cpu values at load time, but we don't do
      anything yet while moving instances around. The cpu ratio is shown in
      the cluster list.
      1a82215d
    • Iustin Pop's avatar
      Add a new vcpus attribute to instances · d752eb39
      Iustin Pop authored
      This patch adds reading of vcpu count for instances, in preparation for
      using the vcpu ratio in cluster scoring.
      d752eb39
  5. 01 Jun, 2009 2 commits
    • Iustin Pop's avatar
      Add copyright/license information · e2fa2baf
      Iustin Pop authored
      This doc-patch adds copyright and license information to (hopefully) all
      needed files.
      e2fa2baf
    • Iustin Pop's avatar
      Lots of documentation updates · 9188aeef
      Iustin Pop authored
      This patch does only doc build changes, doc changes and function move
      around (for more logical documentation). It should have no impact at all
      on the code.
      9188aeef
  6. 27 May, 2009 1 commit
    • Iustin Pop's avatar
      Add type synonyms for the node/instance indices · 608efcce
      Iustin Pop authored
      This is a first step towards full datatype renaming. That requires more
      changes, so at first we only want to document clearly what is a node
      index, what is an instance index, and what is a plain Int.
      608efcce
  7. 25 May, 2009 1 commit
  8. 23 May, 2009 2 commits
    • Iustin Pop's avatar
      Remove ktn/kti from first half of loader · e3a684c5
      Iustin Pop authored
      This patch removes the ktn/kti lists from most parts of the first half
      of the loading sequence. Some remain as the [(String, Int)] is the
      nicest way to lookup names and get indices back.
      e3a684c5
    • Iustin Pop's avatar
      Add a small class for Nodes and Instances · 497e30a1
      Iustin Pop authored
      Since both nodes and instances support some common functionality (names
      and indices), we add a class so that we can access these attributes in a
      generic way.
      497e30a1
  9. 22 May, 2009 3 commits
    • Iustin Pop's avatar
      Add back names to nodes/instances · 2727257a
      Iustin Pop authored
      In order to simplify the data structures, we add back the name on the
      node and instance objects. We still keep the index for, well, indexing,
      but we will use the name directly from the object, in order to get rid
      of the ktn/kti arguments which are passed around everywhere.
      2727257a
    • Iustin Pop's avatar
      More code reorganizations · e4c5beaf
      Iustin Pop authored
      This new big patch does a couple of more cleanups in the loading of data
      chapter:
        - introduce a Types module that holds most types (except the base
          Node/Instance/etc.) so that multiple other modules can use these
          (instead of only Cluster and its users)
        - bring IAlloc.hs in line with the recent changes of providing data
          types and not strings
        - removal of obsolete Utils.hs json-related functions
      e4c5beaf
    • Iustin Pop's avatar
      Rework the loader model · 040afc35
      Iustin Pop authored
      This big patch changes the loader model from “string data as common
      format” to actual object structures as common format.
      
      The text loading function move from Cluster.hs to a new Text.hs module,
      some common functions are moved to a new Loader.hs module, and the
      return values from both Rapi.hs and Text.hs are uniformized.
      040afc35
  10. 20 May, 2009 5 commits
    • Iustin Pop's avatar
      Small syntax improvement · 1297ce13
      Iustin Pop authored
      D'oh, one can extract from a wrapped variable, not only from functions.
      1297ce13
    • Iustin Pop's avatar
      Allow overriding the RAPI port/scheme · e015b554
      Iustin Pop authored
      This patch adds a very dumb way to override the port and scheme for
      RAPI: if the master string doesn't contain a colon, we consider it a
      simple hostname specification, and thus prepend ‘https://’ and append
      ‘:5080’, (the default RAPI port); otherwise, we consider it a fully
      specified URL, and don't do any mangling to it.
      
      This allows to use saved RAPI responses in testing, with the “file://”
      scheme, or to use another port or non https mode with an actual RAPI
      instance.
      e015b554
    • Iustin Pop's avatar
      Remove some 1.2 specific code · ba00ad4d
      Iustin Pop authored
      Now that we dropped 1.2 compatibility, we can removed the special casing
      for RAPI differences.
      ba00ad4d
    • Iustin Pop's avatar
      Generalize some Result function into monad ones · 5aa48dbe
      Iustin Pop authored
      We don't really needed, but is more clean like this.
      5aa48dbe
    • Iustin Pop's avatar
      Switch from hand-written monads to a real one · 942403e6
      Iustin Pop authored
      This big patch converts from our home-grown monad-like constructs
      (the Either stuff) to a real, Either-like-but-another-name monad.
      
      We introduce a “Result a” monad, and this allows dropping many of the
      extra constructs. Hopefully the code is also more clear.
      
      Many of the functions could now be written in a generic-monad style,
      instead of Result specifically, but that will come in future patches.
      
      IAlloc.hs also has some unrelated patches.
      942403e6
  11. 19 May, 2009 2 commits
    • Iustin Pop's avatar
      Drop RAPI v1 compatiblity · aff363a4
      Iustin Pop authored
      Since we only support Ganeti 2.0, we drop the 1.2 compatibility.
      aff363a4
    • Iustin Pop's avatar
      Add support for 'offline' nodes · 00b15752
      Iustin Pop authored
      This patch drops compatiblity with Ganeti 1.2 and adds support for
      offline nodes in the cluster. When reading from RAPI, the drained nodes
      are considered offline so that we don't allocate on them too.
      00b15752
  12. 18 May, 2009 1 commit
  13. 22 Mar, 2009 2 commits
    • Iustin Pop's avatar
      Include DRBD overhead in sda/sdb size · 190ce47c
      Iustin Pop authored
      For Ganeti 1.2 which doesn't have the ‘disk_usage’ instance query field,
      we need to manually include the DRBD overhead (per disk). This patch
      modifies the RAPI collection to do this, but loading from disk does not
      as it's unknown if the query came from hscan or RAPI 1.2 or RAPI 2.0...
      190ce47c
    • Iustin Pop's avatar
      Add a new instance field denoting run status · f82f1f39
      Iustin Pop authored
      This patch modifies Rapi, the Cluster.loadData and hscan serialization to load
      and save the instance run status. At instance level, we add both a boolean
      field denoting the true/false run status, and a string field which holds the
      original value (since we don't have a 1-to-1 mapping) for use in hscan
      serialization.
      
      The run status is not yet used.
      f82f1f39
  14. 21 Mar, 2009 1 commit
    • Iustin Pop's avatar
      Add node memory field to Node objects · 04be800a
      Iustin Pop authored
      This patch adds a new n_mem field to the node objects, and implements
      read/save/show support for it. The field is not currently used (except
      in the node list) but will be used for checking data consistency and
      instance up/down status.
      04be800a
  15. 20 Mar, 2009 1 commit
  16. 14 Feb, 2009 3 commits
  17. 13 Feb, 2009 1 commit
    • Iustin Pop's avatar
      Add compatibility with rapi v1 · aab26f2d
      Iustin Pop authored
      The patch adds compatibility with RAPI v1, and this required some new
      JSON functions as valFromObj doesn't behave nicely.
      
      Some other unrelated changes were done too.
      aab26f2d
  18. 12 Feb, 2009 1 commit
  19. 11 Feb, 2009 1 commit