- Dec 20, 2012
-
-
Helga Velroyen authored
The networks field of the node groups class is a dictionary of nic params and not a list of networks. This should fix the broken QA. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 19, 2012
-
-
Guido Trotter authored
This is a new personality that for the moment doesn't do anything. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Helga Velroyen authored
Small renaming to make the test more readable. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Helga Velroyen authored
This creates a number of node groups with up to 3 networks, serializes them and compares them with their python equvalents. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Helga Velroyen authored
This adds a network field to the NIC params and a list of networks to the node group type. It adjusts the nodegroup's unit tests accordingly. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
This adds support for job queries, including (basic) unit-tests. I've tested this for memory and cpu usage as follows: - 3600 jobs (live queue): - via masterd, default: ~1.1s (masterd: ~60MB ram) - via confd, default: ~1.1s (hconfd: ~25MB ram) - via masterd, id only: ~1.0s (masterd: ~57MB ram) - via confd, id only: ~0.2s (hconfd: ~15MB ram) - all jobs (128K in total, around 570MB size on disk): - via masterd, default: 1m22s (masterd cpu: 48s), masterd: 1.4G ram - via confd, default: 1m16s (hconfd cpu: 51s), hconfd: 570MB ram peak (peak only right before starting luxi send, hconfd decreases in RSS as results are streamed over luxi, back to ~18MB after the send) - via masterd, id only: ~49s (masterd cpu: 45s), masterd: 1.3G ram - via confd, id only: ~39s (hconfd cpu: 35s), hconfd: 110MB ram peak (right before luxi send, decreasing as results are sent, back to ~14MB after the send) Given this, and that in production it's not likely to have hundreds of thousand of job files, I believe the implementation is safe from this point of view. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This is required for QueryJobs implementation; we change makeSimpleFilter to support both string and integers as names. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This patch adds implementation for a read-only job queue module, together with "full" test (as full as can be in a lazy language…). One note about the behaviour of the job queue is the handling of opcodes that fail validation: the 'input' opcode actually is a meta-type, which can hold either a real opcode or a plain JSValue, so that we can still load jobs with invalid opcodes for querying. The only downside of this is that, as opposed to Python code, we can't show the correct summary for such an opcode - we try to parse the OP_ID but not the extended OP_DSC_FIELD-equivalent. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
I am very very unhappy with this patch. We have to do this, in order to be compatible with the Python code and behaviour, but there's lots of duplication; both the Python and the Haskell code will need to be cleaned up and simplified (we don't need QFF_* at all). For now though, this implements QffTimestamp and associated code. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Helga Velroyen authored
Forgot to fix that after the review of patch "Haskell/python compatibility test for networks". Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
Since this is a type that behaves non-standard, let's add some more test for "wrong" input values. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
As OpParams definitions are used at Template Haskell type, they don't get any coverage (although the values defined by them are actually used in unittests). However, we can at least test some of the functions defined in the module. This patch tests the failure modes of a few of the custom types in this module. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
These test the newly-changed behaviour, and fix an inconsistency in the hs-check target (versus hs-coverage). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
This allows usage information to display nicer help (like in Python). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Guido Trotter authored
If an instance is offline we definitely shouldn't start it up. But shutting it down, should it be up by mistake is not "that" bad. Still, we only allow it with --force, as it still performs an action on an instance we shouldn't touch. This should make everybody happy. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 18, 2012
-
-
Helga Velroyen authored
This patch contains the HUnit test that checks the compatibility of Haskell-generated networks with the python code. For that the generation of test instances of networks was enhanced to meet the validation steps of the python implementation. Also, so far networks were generated at two different places in the code; this is now consolidated. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Dec 17, 2012
-
-
Iustin Pop authored
Some confd types were not tested for serialisation, so let's move these (type-related) tests to their own module and extend them. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This allows tests to execute IO actions which have logging as a side effect, without polluting the stderr too much. A better solution would be that we have fine-grained control over loggers, so that tests can run with their own logging, etc. etc.. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Instead of always using "arbitrary", make it require a generator (that can then use more complex rules for building the list elements), and also convert it to use a temporary set instead of list membership. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This implements in the Haskell codebase the opcode summary. As opposed to Python, we always use custom code for formatting, since we don't want to use dynamic attribute lookup. To test this properly, we need to change MetaOpCode to record-syntax, so that we get accessor functions. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
Also fixes indentation for OP_STATUS. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Dec 14, 2012
-
-
Guido Trotter authored
Return type is changed from Property to Bool, and the ==? True at the end is dropped. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 12, 2012
-
-
Michele Tartara authored
This commit adds shelltests for the mon-collector binary and for the DRBD data collector. Also, it fixes a small bug in the DRBD parser found thanks to the tests. Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Helga Velroyen authored
An old hlint version (1.8.28) was complaining about the word 'family' being used in the network tests. Thanks to an epiphany of Iustin this was due to that it is a reserved key word. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 11, 2012
-
-
Helga Velroyen authored
Implementation of the network objects and address pool. Functionality as in the reverted commit b9a616e1, but now using only the vector library and not the bit-vector library. Tested with vector library version 0.9 and 0.10., which are also installed on the buildbot machines now. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 07, 2012
-
-
Dato Simó authored
In some ADT, ordering of constructors is important because a certain meaning is attached to ordinality (e.g., "clusters with lesser AllocPolicy are preferred"). To ensure constructor order is not accidentally changed, this commit introduces assertions that verify the ordering of these types is as expected. Signed-off-by:
Dato Simó <dato@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Somehow this went missing in commit 1f1188c3. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Michael Hanselmann authored
Adds a new parameter to “OpInstanceCreate” and “OpInstanceMultiAlloc” to use opportunistic locks. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Helga Velroyen authored
This reverts commit b9a616e1, which depends on the "bitvec" library. We need to investigate a bit further that dependency, as it in turns depends on "vector" 0.9.1 or *below*, since 0.10.* removed support for Data.Vector.Unboxed.Safe which it uses. Signed-off-by:
Helga Velroyen <helgav@google.com> Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Dec 06, 2012
-
-
Helga Velroyen authored
Implementation of the network and address pool class in Haskell. Not complete yet. Includes unit tests that cover all functionality that is so far implemented. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
There is a common conception that Just something is more worth than Nothing. So we're biasing our tests towards that. As such let's generate Nothing fewer times, and Just subgen more times. The values were copied from the "official" maybe generator. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
Commit 3bdbe4b3 (“Jobs.hs: move OpStatus and JobStatus ADTs to Types.hs”) removed the TemplateHaskell language pragma from htest/Test/Ganeti/Jobs.hs due to a hlint warning, but that is bad: it means the testSuite call is no longer interpreted as a splice, so it results in: Parse error: naked expression at top level With newer GHCs. To fix this, we restore the pragma, and add an hlint ignore. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Dec 05, 2012
-
-
Dato Simó authored
This leaves Ganeti/Jobs.hs and Test/Ganeti/Jobs.hs empty, but they're the target of a future move of some functions, so we leave them around, and don't delete them, to avoid unnecessary delete/create diffs. Signed-off-by:
Dato Simó <dato@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 04, 2012
-
-
Guido Trotter authored
We have to check that for each edge its vertices have different colors. This is very easy to do with a vertex-to-color map, but not so easy with a color-to-vertex one. Since all our coloring algorithms created a vertex-to-color map behind the scenes and then converted it, we flip them back to returning it directly, and do the conversion explicitly where we need it (which for now is everywhere except when testing this property). Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Our Dsatur implementation was incorrect: while the paper defined the degree of saturation of a vertex as the number of different colors it is adjacent to, we were using the number of colors, without considering uniqueness. This effectively implemented a different algorithm, which is very similar to the previous one, and while it performs slightly worse on average it still beats Dsatur on some cases. So we refactor the implementation to effectively support both algorithms without code duplication, and then we export both the old algorithms as "Dcolor" and the new one as "Dsatur". Since these are all fast algorithms in hroller we will still be able to pick the best result. Note that the new Dsatur implementation uses an IntSet to calculate the uniqueness. Results with nub + length on a list were significantly slower. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
This function helps treating node node problems as graph problems. It can transform a list of nodes plus a list of instances into a graph which uses the nodes as vertices, and instances as edges connecting them (as long as they have both a primary and a secondary node) Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
This brings our coverage of Graph.hs to 100% Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Check whether coloring on a given graph makes sense. This is the case only if there are no loops and the graph is undirected. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Implement the Dsatur algorithm for Graph coloring. This also abstracts the neighColors function into two subfunctions that this algorithm can reuse. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
This module implements some algorithms on Data.Graph data structures. At the moment its main functionality is an LF-color implementation (greedy coloring in descending order of degree). There are also a few extra functions to calculate the degree order, and convert the node to color mapping to color to nodes. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-