History | View | Annotate | Download (20.5 kB)
Network and address pool (again)
Implementation of the network objects and address pool. Functionalityas in the reverted commit b9a616e132af9bba718d2da8c94eeec7af886814, butnow using only the vector library and not the bit-vector library.Tested with vector library version 0.9 and 0.10., which are...
Revert "Network and address pool"
This reverts commit b9a616e132af9bba718d2da8c94eeec7af886814, whichdepends on the "bitvec" library. We need to investigate a bit further thatdependency, as it in turns depends on "vector" 0.9.1 or below, since0.10.* removed support for Data.Vector.Unboxed.Safe which it uses....
Network and address pool
Implementation of the network and address pool class inHaskell. Not complete yet. Includes unit tests that coverall functionality that is so far implemented.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Rework custom fields handling
This patch changes a bit the handling of custom fields. Since ingeneral we use custom fields to aggregate multiple entries in the JSONobject into a safer data-type, we should also have a way to declarewhich extra entries this field covers (so that in the future we can...
Remove read instances from our Haskell code
It turns out that optimising 'read' derived instances (via -O) forcomplex data types (like OpCode, or the various objects) can be slowto very slow. Disabling such instances results in (time make$all_our_haskell_binaries) large compile-time savings and also smaller...
Move NICMode from Objects.hs to Types.hs
Also add some unittests for this type.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Move FileDriver from Objects to Types
Another base type that we need in opcodes as well.
Move the 'Hypervisor' type from Objects to Types
This is a very basic type and 'Objects' is a heavy-weight module. Bymoving it to 'types' we simplify (in the future) the import chains.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Adeodato Simo <dato@google.com>
Create a new Ganeti/Types.hs module
There are already three cases where we copied type definitions betweenthe htools-specific types into the main ganeti code. Let's stop doingthis ☺ and create a common types module that holds these.
Note that there already exists BasicTypes.hs, but that refers to very...
Cleanup THH function use from built module namespace
Currently, THH.hs "injects" into the built code names of libraryfunctions like Text.JSON.makeObj, Ganeti.JSON.fromObj, etc. builtdirectly from strings, via (e.g.)
varE (mkName "makeObj")
This means that the "makeObj" name must exist in the target module,...
Add missing ipolicy field
This was missing so far…
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Change cluster's hypervisors type
We now have Hypervisor type in Objects, might just as well use it.
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Further hlint fixes
Commit 2cdaf22, “Re-enable standard hlint warnings”, got it almostright. The only problem is that (confusingly) the default set of hintsis not in HLint.Default, but in HLint.HLint (it includes Default andsome built-ins).
After changing the lint file to correctly include the defaults, we had...
Add entire ConfigData serialisation tests
Using the recently-added genArbitrary, we can now implement Arbitraryinstances for even "huge" objects like Cluster, so let's use that toimplement entire ConfigData serialisation tests.
Note that, as we don't have yet proper types for some of the Params...
Add unit test for serialisation of DiskLogicalId and Nodes
Since the DiskLogicalId type is manually serialised/deserialised (seeObjects.hs, `encodeDLid' and `decodeDLId'), let's add a test thatchecks that these are idempotent when combined.
Since we're at it, let's add the same test for Node serialisation,...
Move JSON.hs and Compat.hs out from under HTools/
These two files are not htools-specific, so let's move them out of theHTools subdirectory/module hierarchy and directly under Ganeti.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
One more SADT type - VType
This adds the VTYPE_* conversion to VType, used for QFT equivalencelater.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Agata Murawska <agatamurawska@google.com>
Expand THH with more functionality for parameters
This adds two related improvements to THH:
- for parameters, we declare a list with all their fields, so that Query2 can build the list of fields (e.g. for hvparams, or ndparams) automatically
- we declare a new type class for "DictObjects", i.e. objects which...
Add more node-related data types and functions
This is a simple type declaration for NodeRole, a NdParamObject typeclass, and a few related helper functions for nodes and node groups.
Add type classes for common objects
These mirror the TaggableObject in Python, in the sense that we willbe able to define generic functions for querying such fields.
Expand Objects.hs definitions
This patch adds the missing parameters in the cluster/group objects,for now as simple maps (dictionaries), without type safety. Therationale for adding them as such is:
- we need something to enable query functionality- since we don't modify the values, we don't risk introducing bugs...
Add a fillDict function
This is similar to the Python version, objects.py:FillDict.
Enable tags query over the query socket
This patch adds the tags field to the objects which were missing it(all except Cluster), implements handling the LuxiCall QueryTags, andthen enables the use of the query socket in cli.ListTags, used by allcommands, and in the RAPI client....
Add Objects definitions for the ispec/ipolicy types
Note that since we don't have yet a way to nicely handle two-leveloptional parameters, the Filled/Partial types and filling function areall manually built.
Signed-off-by: Iustin Pop <iustin@google.com>...
Improve Objects.hs definitions
This adds a few missing/incomplete definitions. We're still missingthe special parameters (disk params, hvparams, os_hvp).
Remove container field special cases
Since we now handle Containers uniformly, we can remove all traces ofthe special handling for this field type.
Expand TH with tags field
Also add this new field and the other generic fields to the clusterobject.
Add Hypervisor and start exporting AdminState
Very simple Hypervisor object, that we want to pass in some of RPCcalls is added. We also export AdminState data type, as it is usedin one of the calls that will be implemented in this patch series.
Signed-off-by: Agata Murawska <agatamurawska@google.com>...
Add disk logical ID support in Objects.hs
This is a complex field, so we have to do a lot of manual work for now.
The complexity arises from the fact that the contents of the field,and the way to parse it, depends on the disk type field, so we don'thave a single, static way of parsing it. Hence we needed the...
htools: add partial implementation of lib/objects.py
This is partial since not all object types can be easily converted fornow (will need some changes on the Python side for this).
Most importantly, the *Params types do not have a good solution now:the Python code, due to its dynamic typing, hides the fact that we...