{"id":22574897,"url":"https://github.com/thoth-station/build-watcher","last_synced_at":"2025-04-10T16:11:20.569Z","repository":{"id":39886167,"uuid":"168569161","full_name":"thoth-station/build-watcher","owner":"thoth-station","description":"Watch for builds done in OpenShift and automatically submit new images to Thoth's image analysis","archived":false,"fork":false,"pushed_at":"2023-11-14T23:10:53.000Z","size":7569,"stargazers_count":1,"open_issues_count":3,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-24T13:51:24.663Z","etag":null,"topics":["artificial-intelligence","hacktoberfest","openshift","s2i","s2i-python","source-to-image","thoth"],"latest_commit_sha":null,"homepage":"https://thoth-station.ninja","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thoth-station.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-31T17:47:15.000Z","updated_at":"2023-01-31T17:10:50.000Z","dependencies_parsed_at":"2023-01-25T21:00:58.009Z","dependency_job_id":null,"html_url":"https://github.com/thoth-station/build-watcher","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fbuild-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fbuild-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fbuild-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fbuild-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoth-station","download_url":"https://codeload.github.com/thoth-station/build-watcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248251020,"owners_count":21072685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","hacktoberfest","openshift","s2i","s2i-python","source-to-image","thoth"],"created_at":"2024-12-08T03:08:21.773Z","updated_at":"2025-04-10T16:11:20.553Z","avatar_url":"https://github.com/thoth-station.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Thoth's build-watcher\n---------------------\n\nA bot that watches for builds done in an OpenShift cluster and automatically\nsubmits container images and build logs to Thoth. This bot helps Thoth to\naggregate new knowledge about build failures and possible package issues.\n\nSee `the demo recording explaining build analysis\n\u003chttps://www.youtube.com/watch?v=bSkjSU0S5vs\u003e`__ and/or `presentation available\nin this repository\n\u003chttps://github.com/thoth-station/build-watcher/blob/master/docs/pres.pdf\u003e`__.\n\n.. note::\n\n  Please enable `micropipenv \u003chttps://github.com/thoth-station/micropipenv/\u003e`__\n  in your OpenShift Source-To-Image builds to make builds verbose and ready\n  for data aggregation. micropipenv can be enabled using ``ENABLE_MICROPIPENV=1``\n  environment variable in Python 3 UBI/RHEL/CentOS/Fedora container images.\n  micropipenv is enabled by default in `Thoth based s2i container\n  images \u003chttps://github.com/thoth-station/s2i-thoth\u003e`__ and the environment\n  variable stated has no effect.\n\nDeploying build-watcher into a namespace\n========================================\n\nThe build of this bot is done using OpenShift's s2i. OpenShift templates to\ndeploy this bot are present in ``openshift/`` directory. See required\nparameters for configuring this bot in ``deploy.sh`` script.\n\nTo deploy this bot, log into your OpenShift cluster:\n\n.. code-block:: console\n\n  oc login \u003ccluster\u003e\n  oc project \u003cmy-project\u003e # Namespace where the bot should be deployed.\n\nNow you need to setup build-watcher, clone this repo and adjust configuration\nin ``deploy.sh`` script.\n\n.. code-block:: console\n\n  git clone https://github.com/thoth-station/build-watcher  # or use SSH\n  cd build-watcher\n  vim deploy.sh  # Exit using :wq! :)\n  # Run the deploy script:\n  ./deploy.sh\n\nRemoving build-watcher deployment\n=================================\n\nTo remove build-watcher from a namespace, simply issue:\n\n.. code-block:: console\n\n  oc delete rolebinding,sa,bc,cm,dc,is -l component=thoth-build-watcher\n\nThis will clear all the objects created in the cluster related to\nbuild-watcher.\n\nConfiguring an external registry\n================================\n\nSee `presentation available in this repository\n\u003chttps://github.com/thoth-station/build-watcher/blob/master/docs/pres.pdf\u003e`__\nfor an architecture scheme.\n\nIf you build your images in a cluster and would like to submit images for\nanalysis to Thoth which is running inside another cluster, you can configure\nbuild-watcher to automatically submit images into an external registry\n(assuming the in-cluster one has no external route exposed which would be\naccessible to Thoth backend) which will then be used as a source registry for\nThoth analysis. See push registry configuration ``--push-registry``.\n\nCredentials handling\n====================\n\nNote this bot does not directly analyze images. Credentials (and possibly\ntoken) are propagated to Thoth's User API which triggers analysis on\nbackend side. If this is not desired, you can turn of this by disabling certain\ncontainer image analysis (base or output).\n\nCaching results on Thoth side\n=============================\n\nThoth provides a cache of build analyses. It's completely fine if this bot\nsubmits same images for analysis multiple times. Thoth will simply return\npre-cached analyses results cache.\n\nScaling build-watcher\n=====================\n\nIf you are monitoring a cluster with a lot of builds, you can optionally adjust\n``THOTH_BUILD_WATCHER_WORKERS`` which will cause build-watcher to start a\nprocess pool of workers (defaults to 1) where each worker will push image to an\nexternal registry (if configured so) and will submit image for analysis in\nThoth. This is handy if pushing to an external registry takes some time (large\nimages) and/or there is a lot of builds happening in the cluster.\n\nUsing build-watcher as a CLI\n============================\n\nYou can also run this bot from your local machine as a CLI. Just make sure you\nare logged in into OpenShift cluster (the configuration will be automatically\npicked from your account) and pass correct values/parameters to the CLI:\n\n.. code-block:: console\n\n  git clone https://github.com/thoth-station/build-watcher  # or use SSH\n  cd build-watcher\n  pipenv install\n  oc login \u003ccluster\u003e\n  KUBERNETES_VERIFY_TLS=1 pipenv run python3 app.py --build-watcher-namespace jupyterhub --thoth-api-host khemenu.thoth-station.ninja --no-tls-verify --pass-token --no-registry-tls-verify\n\nSee ``pipenv run python3 app.py --help`` for more info.\n\nCopyright (C) 2020-2021 AICoE `Project Thoth \u003chttp://thoth-station.ninja/\u003e`__; Red Hat Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth-station%2Fbuild-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoth-station%2Fbuild-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth-station%2Fbuild-watcher/lists"}