This augments the dib-request list (which shows what images have
manual build requests) with information about whether the image
is paused. The resulting command is renamed to "image-status".
Change-Id: If75a8757b4ec93563e47bfdf0a239a9c21660c45
Image build requests can now be retrieved through the /dib-request-list
endpoint or via the dib-request-list sub-command. The list will show the
age of the request and if it is still pending or if there is already a
build in progress.
Change-Id: If73d6c9fcd5bd94318f389771248604a7f51c449
When running nodepool launchers in kubernetes a common method to
update nodepool or its config is doing rolling restarts. The process
for this is start a new nodepool, wait for it to be ready and then
tear down the old instance. Currently this is not possible without
risking node_failures when there is only one instance serving a
label. The reason for this is that there is no reliable way to
determine when the new instance is fully started which could lead to a
too early tear down of the old instance. This would result in
node_failures for all in-flight nore requests that are only valid for
this provider.
Adding a /ready endpoint to the webapp can make this deterministic
using readiness checks of kubernetes.
Change-Id: I53e77f3d8aaa4742ce2a89c1179e8563f850270e
This small match had a surprising number of issues...
Even though we're testing returning 'text/plain' when 'text/html' is
specified, it turns out the accept headers real browsers send actually
specify "*/*;q=0.8" which means that unmatched types will be given the
same, lower weight.
This means in the extant code, the best_match() for a normal browser
request (without 'text/plain') will think that 'application/json' and
'text/plain' are the same preference, and will take the first in the
list, which happens to be 'application/json'. The result is that
*real* webrowsers are getting back json, when we wanted them to get a
human readable result.
Also, in the mean time webob has a new accept handling model, and
best_match() is deprecated anyway. Update the requirements to the
latest WebOb (new handling was added in 1.8.0, 1.8.1 is a bugfix)
So now we use the new API, and list 'text/html' as an acceptable
offer, which ensures it will be chosen if a browser is requesting
things. It still returns a text/plain table.
A check for this is added to the test suite. Also a bug with setting
the headers after the request is fixed, which went unnoticed because
of the prior default behaviour.
Change-Id: I84094ca67b16ce9246507aa0010646ffc3e9dbff
This is useful for getting the list of all available labels.
Originally implemented in Iafff02d546abb34affa88310f6a97918166cbf47,
this is based on the new info available from
Icfb73fbe3b67321235a78ea7ed9bf4319567eb1a
Co-Authored-By: Tristan Cacqueray <tdecacqu@redhat.com>
Change-Id: I4b43ac0e2ba44516ff289e93dbf553033fc9e130
Depends-On: https://review.openstack.org/548376
Rather than having end-points with ".json", check the accept-header
and return the correct thing based on that.
Change-Id: Ia0e4cb90cdaa113bb1bf7b4636bc10293811f0f6
node_list takes an argument "detail" which adds a rather arbitrary
list of results to the output. This comes from the command-line,
where we're trying to keep width under a certain length; but doesn't
make as much sense here (especially for json).
For dashboard type applications, replace this with a simple "fields"
parameter which, if set, will only return those fields it sees in the
common text output function.
Note, this purposely doesn't apply to the JSON output, as it expected
client-side filtering is more appropriate there. We could also add
generic field support to the command-line tools, if considered
worthwhile.
Add some documentation on all the end-points, and add info about these
parameters.
Change-Id: Ifbf1019b77368124961e7aa28dae403cabe50de1
All the _list functions return the same thing; save the results and
use a common output function to generate the json or text output.
Change-Id: I9cb44b09de2cb948e7381ef10302b21040433a2c
This reverts commit b737889250.
As discussed in [1] the label list is intended to provide a list of
available labels so users don't have to dig into configuration files
to determine what is available to run jobs on. As written it possibly
misses nodes without a min-ready or in-use nodes, so an alternative
implementation is probably called for. This is also currently returns
values in a plain list, rather than a list of dicts, which prevents
some de-deuplication refactoring.
Thus remove it for now, pending some more work.
[1] http://lists.zuul-ci.org/pipermail/zuul-discuss/2018-February/000039.html
Change-Id: Ic88da24dd5d140697d4af8e6f5ee0936c44f59c5
This patch refactors status functions so that instead of having one
function per output format, the output format is simply a parameter.
New status endpoints are added:
* image-list.json
* request-list(.json)
The endpoint node-list(.json) accepts a node_id parameter for filtering.
Change-Id: I44f386754d343239fc047701cc3cab2dc8b1572a
This change adds a webapp settings to nodepool.yaml to enable custom setting
for port and listen_address.
Change-Id: I0f41a0b131bc2a09c47a448c65471e052c0a9e88
Because python3 is more strict about string / bytes we need to start
encoding / decoding things as utf8.
Change-Id: Id1102be142bef5eeb96de69aaa8f653bdb1903d8
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
The syntax for imports has changed for python3, lets use the new
syntax.
Change-Id: Ia985424bf23b44e492f51182179d2e476cdcccbb
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
When I added the JSON targets in
I3410a4e4efd649732747b0502d66d212f50fa1bb I also changed the text
output mime-type to be application/text, which seemed to pair with
application/json. But this means browsers prompt to download the file
rather than display it, which is not the intention. Restore to
text/plain.
Change-Id: I6fa6597b2fcd05a4c33ba4932c966101daf98ecf
I have monitoring scripts that push the build status to me. This
became a little harder with the split to multiple builders, as the
logs for each build are kept on the builder.
Rather than parsing tables, add a .json target to the dib-image-list
so my script can find the most recent build, see the builder and
retrieve the latest logs from there.
Future work is to do the image-list and make a nicer status page, if
this approach is OK.
Change-Id: I3410a4e4efd649732747b0502d66d212f50fa1bb
Add getZK() to nodepool and update webapp.py to use it.
Change-Id: I71726cdc6a7687f7a30d6bfa53fe7e4df54eca7e
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
The current webapp port number collides with zuul's hence
the two services are unable to run at the same time.
Change-Id: I94959f567848624a62bea01753a79402a655e1b8