Transform unstructured build logs into a structured representation
Project description
Parse build logs out of OpenShift’s Python Source-To-Image (s2i) builds that use Thoth s2i container images.
This tool finds structure in an unstructured build logs of OpenShift’s s2i and produces a JSON document describing all the actions taken during an OpenShift s2i build process together with additional metadata that can be obtained purely from OpenShift’s build logs.
The prerequisite for using this tool is to use Thoth’s Python s2i container images that use Thoth as a recommendation engine for Python software stacks and micropipenv for installing dependencies. The build logs produced during s2i builds are still user friendly when directly browsing them in an OpenShift cluster, but can be used for data mining and additional analysis (e.g. build breaking package).
Usage
Point this tool to a log obtained from the cluster:
# Obtain logs using:
# oc logs user-api-469-build -n thoth-test-core > log.txt
# or for the most recent build:
# oc logs -f bc/user-api -n thoth-test-core > log.txt
thoth-buildlog-parser parse --input log.txt
And that’s it. The tool will produce a JSON document describing the build process with all the metadata.
Example input & output
You can find some example inputs and example outputs in tests/data/ directory.
Installation
This tool is packages and published on PyPI so you can issue one of the following commands to install it:
pip install thoth-buildlog-parser
pipenv install thoth-buildlog-parser
After installing this tool, a new command should be available:
thoth-buildlog-parser --help
Running from Git
To run this tool directly from the Git repo:
git clone git@github.com:thoth-station/buildlog-parser.git # or use https
cd buildlog-parser
pipenv install --dev
PYTHONPATH=. pipenv run python3 ./thoth-buildlog-parser parse --help
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file thoth-buildlog-parser-0.0.1.tar.gz
.
File metadata
- Download URL: thoth-buildlog-parser-0.0.1.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c791064eb659fb503f2ac3d17b1718b44475194ba36269baf0e5bf41a12c83b |
|
MD5 | e5b892dd801642b8c837f9bb382a0b83 |
|
BLAKE2b-256 | a802581565fe2ff8dcb9613b02a8965df466b6fbc66fc158cca4c16c648b6070 |
File details
Details for the file thoth_buildlog_parser-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: thoth_buildlog_parser-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07ddd396d1a6bf73a9c033364258fc3e32714bb42147d0196ca1290da4212fc6 |
|
MD5 | c88884525ed64dcdc3612ebaaf81241f |
|
BLAKE2b-256 | b7a744a192eedb14429f7d6f03b77f9c4829484f1ecf434c1e329a83da5640ca |