Skip to main content

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


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.


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  # or use https
cd buildlog-parser
pipenv install --dev
PYTHONPATH=. pipenv run python3 ./thoth-buildlog-parser parse --help

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thoth-buildlog-parser-0.1.0.tar.gz (38.5 kB view hashes)

Uploaded Source

Built Distribution

thoth_buildlog_parser-0.1.0-py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page