https://github.com/thoth-station/buildlog-parser
Parse OpenShift's s2i build log into its structured representation with all the metadata available
https://github.com/thoth-station/buildlog-parser
hacktoberfest openshift parsers python python3 s2i s2i-python
Last synced: 2 months ago
JSON representation
Parse OpenShift's s2i build log into its structured representation with all the metadata available
- Host: GitHub
- URL: https://github.com/thoth-station/buildlog-parser
- Owner: thoth-station
- License: gpl-3.0
- Created: 2020-04-27T08:55:10.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-29T21:34:07.000Z (about 2 years ago)
- Last Synced: 2025-03-24T13:51:24.863Z (3 months ago)
- Topics: hacktoberfest, openshift, parsers, python, python3, s2i, s2i-python
- Language: Python
- Size: 242 KB
- Stars: 1
- Watchers: 5
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
Thoth's build log parser
------------------------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:
.. code-block:: console
# 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.txtAnd 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:
.. code-block:: console
pip install thoth-buildlog-parser
pipenv install thoth-buildlog-parserAfter installing this tool, a new command should be available:
.. code-block:: console
thoth-buildlog-parser --help
Running from Git
================To run this tool directly from the Git repo:
.. code-block::
git clone [email protected]:thoth-station/buildlog-parser.git # or use https
cd buildlog-parser
pipenv install --dev
PYTHONPATH=. pipenv run python3 ./thoth-buildlog-parser parse --help