21 Commits

Author SHA1 Message Date
Tristan Cacqueray
ab752542ba zuul_swift_upload add support for --verbose
This adds a new --verbose option to let the script prints logging.debug
statement. If set, this option also enables requests debuging so that
http status code are also displayed.

Change-Id: Iacb2ac306b44e355b2e2c5069a38bf02afd3111b
2016-02-18 21:35:24 +00:00
Joshua Hesketh
ff4ae27e5c Retry log upload to swift
Retry 3 times to help with network failures.

Change-Id: Ia0a065c5b4343dd922b2af8cc29387384cdefe82
2015-04-28 23:45:14 +10:00
Joshua Hesketh
3ba0c2bb4e zuul_swift_upload add support for appending help
Automatically append any help/information to genreated index.html
files if the help file exists in that directory. Default the help
files to index_footer.html

Change-Id: I053a2d0dd19c697a18c64f41ebcbed7f5e1d40d5
2015-03-24 10:46:29 +11:00
Clark Boylan
b83079e80e Do not generate index.html if one exists
There are sources of machine generated content other than the zuul swift
upload script. These generators may also create index.html files for us,
if they do preserve the original index.html and do not create a new one.

Change-Id: I9785c4d42d0e0693789976b408d0118c4ea63e50
2015-03-16 13:56:48 -07:00
Joshua Hesketh
53b020fc9f zuul-swift-upload ensure delete after is an int
This fixes the check that is done on "if delete_after:" when the
value is set to 0 (which would be True if it is a string).

Change-Id: I006c120325de896c5c5de23a423497864e0e0d40
2015-03-13 11:02:57 +11:00
Joshua Hesketh
e099b7cdac zuul-swift-upload fix delete-after
The delete after param is passed as part of the payload, not a
header when use the formpost middleware.

Change-Id: If0ce42e0363f3c29f5b8292c443024adc008a5a2
2015-03-13 11:02:55 +11:00
Joshua Hesketh
568cd11254 zuul-swift-upload use logging for debug msgs
Rather than printing to stdout use logging.debug for debug messages.

Change-Id: I8b8971b2ad7e078242e74662779a9a4471416c3d
2015-03-11 15:09:21 +11:00
Clark Boylan
d2e40628d0 Add option to set swift delete after header
Set the swift delete after header in the zuul swift upload script so
that swift handles log deletion for us. Default to a delete after of 6
months but allow the value to be configurable.

Headers are sent per a post. Posts are done per file-job (or queue
entry). Additionals headers can be set up when building the queue.

Co-Authored-By: Joshua Hesketh <josh@nitrotech.org>
Change-Id: Idd3b4b0c9a6819cda5e9b36ce188a61b558873be
2015-03-11 15:09:18 +11:00
Joshua Hesketh
af6fd73557 zuul-swift-upload place mime icon into cell
The mime icons were not correctly placed in the table cell causing
them to appear above the table (eg:
http://logs.openstack.org/16/155516/1/check/check-dg-tempest-dsvm-full/c0853a4/index.html)

Put in the missing <td> tags.

Change-Id: Icdae38d55a6dd9472c382006bae9addf3ef6010b
2015-03-06 15:22:44 +11:00
Joshua Hesketh
3691476925 zuul-swift-upload support recursive globs
Allow supplying filename and paths with '**' recursive glob matches
to zuul-swift-upload. Since bash (or shell etc) will expand on any
filenames provided to the program this needs to be used in quotes.

Usage example:
./zuul_swift_upload.py my_results.txt '**/sdist/*.zip' output.log

The hierarchy is always flattened meaning the supplied list is
placed in the topmost generated index.html. Sub-folders still keep
their hierarchy.

Change-Id: I9ba04f7e46b579dcf3f8ad0bd188f41fa5dbcad9
2015-03-04 09:33:17 +11:00
Jenkins
8d16b09560 Merge "Upload files concurrently to swift." 2015-02-28 00:52:35 +00:00
Clark Boylan
ad257862eb Upload files concurrently to swift.
The zuul swift uploader was uploading all files serially. Speed things
along by performing file uploads with a thread pool. This should do a
better job of utilizing networking throughput as we will always be
uploading as many files as possible (up to the supplied max).

Co-Authored-By: Joshua Hesketh <josh@nitrotech.org>
Change-Id: I38806edb2db1b55a6b4d0cdf7794ec00c9fe9a35
2015-02-26 14:22:47 -08:00
Joshua Hesketh
6a95d63dd5 Make sure there is a default icon for swift index
Check an icon exists for the file mimetype or otherwise use a
default icon on the swift log indexes.

Change-Id: Id8ae918c5888b19c2702a711a292ca8f0176cbdd
2015-02-25 11:46:52 +11:00
Joshua Hesketh
6df30b9cc8 zuul-swift-log index use icons for mimetype
Use the apache icons for the mimetime (similar to mod-autoindex)

Change-Id: I7f40c7c344801263a87c756697c087569fac4a20
2015-02-20 15:14:21 +11:00
Joshua Hesketh
7a8ae34426 zuul-swift-log index size in units
Match apache's mod-index by displaying file sizes as just 'K' or
'M' etc rather than the full 'KiB'.

Also right-align the sizes for readability.

Change-Id: I99585861463ad47ef358b8758bbb7575ff58bc40
2015-02-20 15:14:10 +11:00
Joshua Hesketh
15d421028b Add extra information to zuul swift uploading
To help see if generating or uploading is slow with zuul-swift,
add in some crude debugging. This will never be displayed as the
console log is fetched before uploading is done so to see the
debug messages you'll have to look at the logs Jenkins captures.

The useful information will be to look at the differences in the
timestamps on the messages captured by Jenkins.

Change-Id: I7c31084a92218c3d12ebed68717088337b06f905
2015-02-10 14:27:20 +11:00
Joshua Hesketh
ee1406f723 Sort filenames in swift indexes
Sort the folders first then the file list for swift indexes.
The sorted() function runs on the whole path even though only the
basename is displayed. This will still result in the correct order
though as the folder paths will be identical.

Change-Id: I9c9eb7abad121f23884d58c17771be412e7614c2
2015-02-03 10:57:01 +11:00
Joshua Hesketh
381371c251 Add extra detail to swift indexes
To have feature parity with apache's mod_autoindex generate the
extra information we need when pushing the results (filesize etc).

Change-Id: Ic0b0c9f4d3e28fc01ace9d8d3dd97ea86bddf526
2015-01-21 19:11:30 +11:00
Joshua Hesketh
951c6bc439 Add in parent links to zuul log indexes
When zuul_swift_upload generates index.html's give it the option of also
linking to parent directories from subdirs.

To do this, rework the script to have a consisten file_details dict that
can be used to push to swift or generate links from etc.

Change-Id: If6e25b64c7355449ddc46a694d7678e2c4ce08f8
2015-01-21 19:07:37 +11:00
Joshua Hesketh
36180f415a Fix zuul_swift_upload to use old MAGIC_MIME const
The magic bindings updated to not prefix their constants with
MAGIC. Centos has an old version so we need to use the old constant
names (which are backwards compatible).

I've tested this on centos6 and ubuntu 12.04

Change-Id: Ic64c7395323e7583b37cf624d062cc3f40c89893
2014-10-01 13:22:26 +10:00
Anita Kuno
1d21cd635f Reorganizes project-config
This repo was created from filter branching the openstack-infra/
config repo. This process brought a lot of cruft with it in the
form of directories that we no longer need. This patch removes
that cruft so we begin with a tidier repo.

Change-Id: Ibffad1b11c0c5f84eedfb0365369f60c4961a0f3
2014-09-25 11:41:04 -04:00