| Branch: | Tag: | Revision:

root / htools / Ganeti / Luxi.hs @ cefd4a4a

History | View | Annotate | Download (15.1 kB)

# Date Author Comment
3bdbe4b3 12/05/2012 09:03 pm Dato Simó

Jobs.hs: move OpStatus and JobStatus ADTs to Types.hs

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....

7e723913 12/04/2012 04:11 pm Iustin Pop

Switch luxi submit job calls to use MetaOpCode

This patch changes the luxi submit job calls to use wrapped opcodes,
and therefore it changes Hbal to submit actual meta opcodes. For
nicety, hbal also submits a comment now, showing who generated the

Signed-off-by: Iustin Pop <>...

fa10983e 12/04/2012 01:44 pm Iustin Pop

Rework custom fields handling

This patch changes a bit the handling of custom fields. Since in
general we use custom fields to aggregate multiple entries in the JSON
object into a safer data-type, we should also have a way to declare
which extra entries this field covers (so that in the future we can...

c48711d5 12/04/2012 01:44 pm Iustin Pop

Add a 'real' type for JobIds

Currently, the job ID is a simple type alias. This is suboptimal, as
it means we can't use a custom JSON (or Arbitrary) instance for it.

The patch changes it into a newtype, and then a) simplifies some
deserialisation code and b) changes some more fields to this new type...

139c0683 11/30/2012 03:54 pm Iustin Pop

Remove read instances from our Haskell code

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...

f63ffb37 11/13/2012 09:28 pm Michael Hanselmann

Expose changing job priority via LUXI

A new LUXI request is added, in both Python and Haskell.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>
Reviewed-by: Iustin Pop <>

d8e7c45e 11/12/2012 12:00 pm Iustin Pop

Convert tag objects to a safer type

Currently, we keep information about the "target" of a tag operation
in a data type similar to (TagKind, Maybe String). This is unsafe, as
nothing (at the type level) prevents us from accidentally having
(TagCluster, Just ""), or (TagInstance, Nothing)....

88609f00 11/12/2012 11:44 am Iustin Pop

Switch Luxi TH code from simple to custom fields

This is needed so that we have more flexibility in generating Luxi
serialisation code (deserialisation is still custom). Also, only
exceptions are now using the 'simple' field types, so we might be able
later to convert and remove that TH code as well....

367c4241 11/08/2012 12:31 pm Dato Simó

htools: move TagObject from Luxi.hs to OpCodes.hs

In addition to ReqQueryTags in Luxi.hs, the TagObject ADT is also
required for the "kind" attribute of OpTagsSet and OpTagsDel, which
are coming to OpCodes.hs next. Hence, we move TagObject there, and
adjust imports accordingly....

7ae5d703 11/07/2012 03:39 pm Iustin Pop

One more ghc 7.6 fix

This is only in master, so needed to be fixed separately.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

471b6c46 11/06/2012 06:48 pm Iustin Pop

Add test for Luxi calls consistency hs/py

This tests that the same Luxi calls are defined in Python and
Haskell. It doesn't test yet that their serialisation is correct

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

7adb7dff 10/26/2012 06:05 pm Iustin Pop

Convert Luxi results to Ganeti errors

This a bit too complex patch converts the result of Luxi calls
(submitJob, query*, etc.) from Result to ErrorResult. It then
immediately revers this in the HTools/Backend/Luxi module, where we
don't need necessarily the full error type (just a nice error...

66ad857a 10/26/2012 02:22 pm Iustin Pop

Fix a few issues found by newer hlint

Testing with a newer hlint found a few minor issues; but all are real,
valid recommendations:

- don't use "if cond then f x else f y", but "f (if cond then x else y)"
- "if a then b else True" is equivalent to the simpler "not a || b"...

4cd79ca8 10/11/2012 01:03 pm Iustin Pop

Cleanup network timeouts and htools imports

This patch removes the last HTools module imports from non-htools code
(the HTools.Types module), but it requires an associated cleanup:
using luxi-specific constants for luxi timeouts (the only effect is
that one timeout decreases from 15 to 10, the default value in the...

26d62e4c 10/08/2012 12:35 pm Iustin Pop

Rename Ganeti/HTools/Utils.hs to Ganeti/Utils.hs

This is, I believe, the last non-htools specific file that still lived
in the htools directory; it's already widely used in non-htools code,
so let's move it before we add more functionality to this module....

5b11f8db 09/05/2012 05:31 pm Iustin Pop

Further hlint fixes

Commit 2cdaf22, “Re-enable standard hlint warnings”, got it almost
right. The only problem is that (confusingly) the default set of hints
is not in HLint.Default, but in HLint.HLint (it includes Default and
some built-ins).

After changing the lint file to correctly include the defaults, we had...

f3baf5ef 09/04/2012 04:51 pm Iustin Pop

Move JSON.hs and Compat.hs out from under HTools/

These two files are not htools-specific, so let's move them out of the
HTools subdirectory/module hierarchy and directly under Ganeti.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

4cab6703 09/04/2012 02:00 pm Iustin Pop

Rename the Qlang and Queryd modules

Per the new query module hierarchy, rename Qlang to Query/Language and
Queryd to Query/Server. This way, all query-related functionality is
now "contained" in the Query/ directory.

Signed-off-by: Iustin Pop <>...

05ac718f 09/04/2012 01:59 pm Iustin Pop

Parameterize the Filter type

In preparation for introducing filtering functionality, we convert the
'Filter' type from a '*' kind to a '* -> *' kind.

This allows us to define some general properties for the filter, and
for example introduce later an easy filter compilation, etc....

72295708 09/03/2012 04:52 pm Iustin Pop

Add missing luxi query 'QueryFields'

This was missed; we add the definition and the de-serialisation

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

62377cf5 08/28/2012 06:16 pm Iustin Pop

Reduce some more code duplication and split code

The Qlang module defines ResultStatus, but it was already defined in
Ganeti/Luxi.hs; let's remove the duplicate definition from there since
the proper place is in the newer module.

Also, in order to ease testing, we split some confd functions into a...

be747966 08/28/2012 06:01 pm Iustin Pop

Change the Luxi tags kind from String to a custom type

This will allow safer code when we implement the tags query.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

8a9ee1e9 08/28/2012 06:00 pm Iustin Pop

Remove obsolete QrViaLuxi type

The actual query definitions are now in Qlang.hs, so let's use the
ItemType from there instead of luxi-defined type (which is also

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

4b71f30c 08/28/2012 06:00 pm Iustin Pop

Remove obsolete conversion function for Luxi TH

Due to the (now removed) custom filter field, we needed a conversion
function. Since now that field is gone, we can move to a simpler Luxi
TH implementation.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

dc6a0f82 08/28/2012 06:00 pm Iustin Pop

Rename Query2.hs to Qlang.hs

While starting to use the new filter types, I realised that what is
currently implemented is the equivalent of `lib/', not
`lib/', since we only deal with data types for now and not the
actual query runtime functionality (RPC, config, etc.)....

9a94c848 08/28/2012 06:00 pm Iustin Pop

Switch Luxi Query operation to use a proper filter

Until now, since we didn't have a proper type for the encoded query
filters, we were ignoring the filters and handled them as null values
(JSNull and respectively ()). With the current Query2 implementation,...

2cdaf225 08/28/2012 05:59 pm Iustin Pop

Re-enable standard hlint warnings

Commit 5a1e31b4 (Add infrastructure for, and two extra hlint rules)
was intended to add two extra hlint rules, but I didn't realise at
that time that "--hint" when first used overrides the built-in
lints. As such, since then we were basically running with just those...

0aff2293 08/28/2012 05:59 pm Iustin Pop

Enhance the Luxi interface implementation

This makes the implementation a bit nicer for both for server and
client side: we add a wrapper function with a better result type, and
a few extra functions for building the response.

Signed-off-by: Iustin Pop <>...

13f2321c 08/13/2012 06:58 pm Iustin Pop

Add a server-side Luxi implementation

This is a trivial code change, but it allows us to finally test the
send-receive code on both client and server sides via a simple
in-process server.

The unittest works, but it won't handle timeouts very nicely; it will...

e821050d 08/13/2012 06:58 pm Iustin Pop

Switch the Luxi interface from Strings to ByteStrings

I'm doing this change for future performance optimisations. Currently
we use the Luxi interface just as a client, so not in the hot path,
but when we'll use this as a server interface, we're interested to...

76b62028 08/07/2012 12:48 pm Iustin Pop

Switch job IDs to numeric

This has been a long-standing cleanup item, which we've always
refrained from doing due to the high estimated effort needed.

In reality, it turned out that after some infrastructure improvements
(the previous patches), the actual job queue-related changes are quite...

619e89c8 07/31/2012 11:23 am Iustin Pop

htools: abstract function for parsing job ids

Both the job id and submit job result parsing are abstracted into
separate functions, so that later changes are more localised.

Also, this makes submitManyJobs itself easier to read.

Signed-off-by: Iustin Pop <>...

ccc817a2 07/31/2012 11:21 am Iustin Pop

Introduce a type for the ganeti job type

This will be used for easier change later.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

cdd495ae 05/08/2012 01:37 pm Iustin Pop

Add decoding of Luxi calls and unittests for LuxiOp

This patch adds a hand-coded decoder for LuxiCall arguments, as the
data-structure is not uniform enough for automated generation (even
for the serialisation, we had to add hints for some fields,
de-serialisation is even harder)....

95d0d502 05/08/2012 01:37 pm Iustin Pop

Auto-define a LuxiReq data type

We currently auto-generate a LuxiOp data type, which holds the entire
operation (including parameters). However, having a data type just for
the method call would be useful, so let's change THH to also
defineSADT for the Luxi constructors....

fae980e5 05/08/2012 01:37 pm Iustin Pop

Replace hardcoded constants with Constants.hs names

Now that constants are exported, we can use them for more

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

b69be409 01/13/2012 03:16 pm Iustin Pop

Stop exporting JSON functionality from Utils.hs

This completes the Utils/JSON split started in commit f047f90f. The
import graph should be cleaner now.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

3603605a 12/08/2011 10:00 am Iustin Pop

Cleanup hlint errors

First, we update the recommended hlint version to what I used to get a
clean output (1.8.15). Most of the changes are:

- remove unneeded parentheses
- some simplifications (intercalate " " → unwords, maybe … id →
fromMaybe, etc.)
- removal of some duplicate code (in previous patches)...

ebf38064 11/17/2011 03:49 pm Iustin Pop

htools: reindent the rest of the files

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

5f828ce4 10/26/2011 05:35 pm Agata Murawska

Generalize the generation of ADT from raw types

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

260d0bda 10/26/2011 05:35 pm Agata Murawska

Luxi support for Query status in htools

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

b20cbf06 10/14/2011 01:37 pm Iustin Pop

Adjust htools code to new Luxi argument format

This partially undoes commit 92678b3, more specifically it removes the
Store data type and the associated code, since all Luxi arguments are
now lists.

Furthermore, since the qfilter field on Query is complex (it's...

2e5c33db 10/12/2011 02:01 pm Iustin Pop

Rename filter and filter_ to qfilter

We currently use 'filter' as the OpCode, QueryRequest and RAPI field
name for representing a query filter. However, since 'filter' is a
built-in function, we actually have to use filter_ throughout the code
in order to not override the built-in function....

92678b3c 10/12/2011 11:47 am Iustin Pop

Haskell support for generic Query in Luxi

Untill now htools did not have support for generic Query in Luxi. This
patch introduces Query as a supported Luxi operation and replaces
QueryNodes, QueryInstances and QueryGroups with Query.

Signed-off-by: Agata Murawska <>...

9d74cb04 10/12/2011 11:47 am Agata Murawska

TH simplification for Luxi

This patch simplifies the generation of save constructors for LuxiOp
by always using showJSON over an array of JSValues, instead of having
to pass showJSON in most cases, except the 5-tuple case.

Signed-off-by: Agata Murawska <>...

05ff7a00 10/12/2011 10:49 am Agata Murawska

Dots in docstings and hlint error fixes for htools

Signed-off-by: Agata Murawska <>
Signed-off-by: Iustin Pop <>
Reviewed-by: Iustin Pop <>

a0090487 10/06/2011 11:21 am Agata Murawska

Use TemplateHaskell to create LUXI operations

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

525bfb36 07/13/2011 01:01 pm Iustin Pop

htools: docstring fixes and improvements

No code changes (except one definition being moved around in QC.hs)
are contained in this patch.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

dc384cf0 03/17/2011 06:04 pm Iustin Pop

Merge remote branch 'htools/master'

  • htools/master: (605 commits)
    Update NEWS file for version 0.3.1
    Update copyright years in the man pages
    Remove obsolete env vars from the manpages
    Fix dist archive generation
    luxi backend: show attribute names in errors...