- Nov 30, 2012
-
-
Iustin Pop authored
It turns out that in newer GHC versions, the suffix shouldn't be prefixed with a dot; otherwise name mangling is broken. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently, the And and Or filters use very nice code, e.g. in case of OrFilter: any id <$> mapM evaluateFilter flts However, looking at the memory profiles shows that application of any/id to monadic values via '<$>' does not work nicely, losing the 'early' success property. This results in too much memory being used for thunks in monadic sequencing. Rather than trying to add more strictness (not sure exactly how, TBH), switching these to explicit recursion solves the problem, since we take the 'early' exit problem in our hands and we are explicit about it. Memory usage in case of big (e.g. 1000 'Or' elements) is reduced significantly, and thus also the runtime. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently, the query operators (binop, etc.) create thunks, instead of forcing the evaluation of the simple boolean results. This results in higher than needed memory use. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Since this program is not built normally, a few recent commits broke it: - 707cd3d7 (“Use exitErr instead of explicit error message and exitWith”) introduced wrong syntax (missing '$') - 29a30533 (“Remove unsafePerformIO usage”) changed the signature of G.Path.clusterConfFile - 5183e8be (“Convert query path from string errors to GanetiException”) changed the signature of 'getNode' Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
I've been bitten a couple of times with arbitrary opcodes working on UTF-8 locale, but failing on buildbot (ASCII). So let's add an explicit test that checks always (even with UTF-8) for correct arbitrary values, showing explicitly which opcodes fail. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
It turns out that optimising 'read' derived instances (via -O) for complex data types (like OpCode, or the various objects) can be slow to very slow. Disabling such instances results in (time make $all_our_haskell_binaries) large compile-time savings and also smaller (unstripped) binaries (by a significant amount): ghc 6.12: time htools sz hconfd sz with read: 4m50s 12,244,694 14,927,928 no read: 3m30s 10,234,305 12,536,745 ghc 7.6: with read: 14m45s 13,694,761 15,741,755 no read: 3m40s 11,631,373 13,245,134 So let's remove these instances, since we never use read in production for our custom types, and even when debugging in GHCI, we can simply use the 'show' representation to create the types, without needing to actually parse from strings. Note: for the very slow ghc 7.6 compilation time, I filled a ticket (ghc #7450), since it is surprising(ly slow). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
This is the last inline-written field; I've done it separately from the last patch due to changes being needed in HTools (field changed type). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
… except one, and replace them with separately-defined ones in OpParams. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
It would be even better if the opcodes would actually have all the same definitions, until then we have two sets of definitions. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
Due to lack of attention, we have two styles for generators of arbitrary values: get* and gen* (e.g. getFQDN and genDiskIndices). In order to make this more obvious that we deal with a function in the Gen monad, let's rename all get* functions to gen*. A few other simplifications were done on existing tests, switching to helpers that were introduced later. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This patch enhances the opcode list checks - instead of spawning a Python interpreter to display the opcode list, we export it statically in Constants.hs via a slight convert-constants change. Furthermore, since we now have opcode parity, we enable full opcode list checks. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
OpInstanceQuery was missing accidentally, whereas OpRestrictedCommand was just recently added without Haskell definitions. The patch also slightly improves the OpNodeQuery arbitrary generation. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This completes the last missing opcode group. The only difficulty was with the ip addresses, where we used simple strings to represent them and (for IPv4) a few helpers to generate arbitrary instances; otherwise, the patch is trivial. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
Also add some unittests for this type. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This adds the OpTestAllocator, OpTestJqueue and OpTestDummy opcodes. The OpTestAllocator seems to need some cleanup (on the Python side), for now we implement it as is. As for the other two, while not used in production, we should have full coverage for them as well. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This makes the OpCode more consistent with the other opcodes. The downside is incompatibility when upgrading from 2.6, but since this is a test opcode it shouldn't be problematic. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This field is used with just changed description in about 10 opcodes, so unifying it makes things simpler for future potential changes to the field type. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
The regexp in OpTagsSearch is loaded as is, without testing for validity; the rest of the patch is trivial. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This also corrects a docstring in OpBackupExport on the Python side. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
Only the original instance opcodes (used in htools) are left non-converted to only parameter style; they'll be cleaned up later, once the htools codebase itself migrates to safer types. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
This is not comprehensive, since in Python one can't determine what is and what is not mutable; but I've added a few base cases (list, dict, set). The patch also improves (makes more uniform) the error messages in the parameter definitions. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Commit 12e62af5 (“Adding the new opcode for multi-allocation”) introduced a "bad" default value; while porting this to Haskell, I realised this is wrong. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This is a "big" opcode, so sending it separately. A few types needed changing, and a few parameters were renamed to make it more clear which are cluster-level and which are instance-level parameters. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
Another base type that we need in opcodes as well. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Michael Hanselmann authored
The order of the calls to “ctx.use_privatekey” and “ctx.use_certificate” was wrong, leading to an exception being thrown. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
This code will also be used by the node daemon setup utility. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Dimitris Aragiorgis authored
TValueNone checks if a value is "none" and TMaybeValueNone is a wrapper of TOr(TValueNone, x). This is used by OpNetworkSetParam in order to reset a network value (e.g. mac_prefix, gateway, etc.) Signed-off-by:
Dimitris Aragiorgis <dimara@grnet.gr> Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
Also remove a superfluous empty line in test file. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 29, 2012
-
-
Michael Hanselmann authored
This patch adds descriptors to the “_CheckCIDR*” functions in opcodes and improves the descriptions generated by “ht.TInstanceOf”, thereby indirectly fixing bad type descriptions in the RAPI documentation. Before this patch: - (String and (<function _CheckCIDRAddrNotation at 0x2f…>)) - (Instance of (<class 'ganeti.opcodes.OpInstanceCreate'>)) After this patch: - (String and (IPv4 address)) - (Instance of (ganeti.opcodes.OpInstanceCreate)) Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Helga Velroyen authored
This bug was introduced by my commit "Check ispecs against ipolicy on instance modify", because I did not filter for the 'add' action. Thus it would try to read the size parameter also when removing disks. Signed-off-by:
Helga Velroyen <helgav@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
Some opcodes, for example LUInstanceFailover and LUInstanceMigrate, can't know whether they need to acquire all nodes until they have a lock on the instance. In turn they would have to acquire the node allocation lock “just in case” and could only release it once the instance had been acquired. Since there is no good reason for the node allocation lock to be before instances in the locking order, this patch changes the order so that instances are locked first. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Michele Tartara authored
The hpc tool, on squeeze, does not handle utf8 encoded files correctly. The Attoparsec test is just needed to verify whether the parser handles uft8 correctly, so the solution is to exclude it from coverage checks. Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
A new utility for configuring the node daemon will have to write the node certificate as well. To not split information about the certificate file even more, the constant is added to “pathutils”. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 28, 2012
-
-
Michael Hanselmann authored
A new tool for configuring the node daemon will also have to verify the cluster name, so it's better to have this function in a central place. In the process of moving it to ssconf it is also changed to use “SimpleStore” instead of reading the ssconf directly. Tests are updated. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Michael Hanselmann authored
Until now ssconf would limit the amount read from files to 128 KiB and silently ignored files larger than that. With this patch a check is added by using fstat(2) on the file descriptor while it's being read. There were no tests file ssconf at all, so some are added. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Missing spaces around operator. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Michael Hanselmann authored
There is no good reason why these two constants should be inside the class. This patch moves them to the module so they can be used without “self”. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Commit b0dcdc10 removed the last user of this class. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
- Include filename in error message - s/ip/IP/ - Stop using superfluous variable Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 27, 2012
-
-
Helga Velroyen authored
Extend _GetNetworkStatsField() to accept 4 arguments. This fixes Issue 323. Signed-off-by:
Dimitris Aragiorgis <dimara@grnet.gr> Reviewed-by:
Helga Velroyen <helgav@google.com>
-