build_chroot: Add packages for JSON patching (used in QA)

These (optional) packages allow patching QA JSON configuration file (see
[e5398c3a]). While it's meant to be used on Buildbot, it can be useful
to have it installed locally too, for example for testing patches in a
local environment.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Add gnt-network list to network QA

The QA for networks so far did not cover network queries
and as such issues with those could not be discovered.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Rename LuxiSocket to MasterSocket

Rename the constants to name the socket to connect masterd,
as the name LuxiSocket hints on luxid, which is different
from masterd.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Release internal lock for serial file later

When allocating new jobs, the new serial is replicated among
all master candidates. To avoid races with a later job id
allocation, keep the internal lock till after the replication
attempt.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add zlib and base64-bytestring as haskell dependencies

With luxid taking over more and more job management, replicating job
files should use the compressed option, as is currently done by masterd.
This requires gzip compression and base64 encoding available in haskell
as well.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Compress JobqueueUpdate RPCs

Noded understands compressed RPCs for updating files in the
(replicated) job queue. Make use of this feature.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add function to replicate a job to the master candidates

As luxid will be handling the job queue soon, add a utility to
replicate jobs to all master candidates. Also log errors.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add wrapper to replicate many jobs

Add a convenience wrapper around replicateJob to replicate
many jobs to the master candidates.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add a function justBad to filter the Bad value of a list

In the same way as justOk allows to filter the Ok values,
add justBad to filter the Bad values. While there, simplify
the definition of justOk.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add function to enqueue jobs

Add a function that ensures that a given set of jobs gets executed at
the appropriate  time. At the moment, this is still the simple
mechanism of handing over everything to masterd; but even at this
stage, it has the benefit of allowing to remove code duplication in
luxid.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Make luxid job submission be defined by replication

When receiving jobs to be submitted, make luxid replicate them to all
master candidates and then return. The actual execution can be handled
asynchronously.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Mention removal of python queries in NEWS

This patch mentions the removal of the python queries in
the NEWS file, including the removal of the
--enable-split-queries option at configure time.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Update design doc wrt to queries from non-masters

This patch updates the design document of the query
splitting with respect to the proposal of making it
possible to run queries from other nodes than the
master node.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Use the generic query field test for network QA

Instead of just using sporadic 'gnt-network list' commands,
use the more exhaustive generic query test functions for
list and list-fields.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Document the minimal version of base64-bytestring required

There exist several versions of base64-bytestring; the interface we're
using is that of version 1.0.0.0 or higher.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
build_chroot: for wheezy install base64-bytestring via cabal

The version packaged in debian wheezy is less than the minimally
required version 1.0.0.0.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>