{"id":22574808,"url":"https://github.com/thoth-station/s2i","last_synced_at":"2025-04-10T16:10:30.107Z","repository":{"id":50172946,"uuid":"238733814","full_name":"thoth-station/s2i","owner":"thoth-station","description":"Tooling and a library for Thoth's Python Source-To-Image (s2i) applications","archived":false,"fork":false,"pushed_at":"2023-10-17T20:25:19.000Z","size":203,"stargazers_count":1,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T13:51:22.550Z","etag":null,"topics":["application-stack","devops","devops-tools","hacktoberfest","openshift","python","python3","s2i","thoth","tooling"],"latest_commit_sha":null,"homepage":null,"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":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2020-02-06T16:32:15.000Z","updated_at":"2022-07-29T16:31:04.000Z","dependencies_parsed_at":"2023-01-25T12:05:12.098Z","dependency_job_id":null,"html_url":"https://github.com/thoth-station/s2i","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"thoth-station/template-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fs2i","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fs2i/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fs2i/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fs2i/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoth-station","download_url":"https://codeload.github.com/thoth-station/s2i/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247779695,"owners_count":20994573,"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":["application-stack","devops","devops-tools","hacktoberfest","openshift","python","python3","s2i","thoth","tooling"],"created_at":"2024-12-08T03:08:03.786Z","updated_at":"2025-04-10T16:10:30.090Z","avatar_url":"https://github.com/thoth-station.png","language":"Python","readme":"thoth-s2i\n---------\n\nTooling and a library for Thoth's Python Source-To-Image (s2i) applications.\n\nThis application can assist you to port an existing application to Thoth or\nexpose information about build configs used within the cluster.\n\nFollow `online step-by-step tutorial to see this tool in action\n\u003chttps://www.youtube.com/watch?v=FtW1PAuI3nk\u003e`__.\n\nHow to migrate an existing Python s2i application to use Thoth\n==============================================================\n\nIf you have a Python application that uses OpenShift s2i and you would like\nto benefit from Thoth's recommendations, you can simply port all your OpenShift\ntemplates by executing the following command after installing\n`thoth-s2i \u003chttps://pypi.org/project/thoth-s2i\u003e`__:\n\n.. code-block:: console\n\n  thoth-s2i patch --s2i-thoth quay.io/thoth-station/s2i-thoth-ubi8-py36 --insert-env-var path/to/openshift/templates\n\nThe command above will look for all the templates present in the supplied\ndirectory and will load build configs used. If a build config\nuses an s2i image stream, it will simply replace it with Thoth's s2i.\n\nSee ``--help`` for more available options and configuration options.\n\nIf the application is already deployed, you can check what image streams are\nused by build configs in the namespace where your application is built:\n\n.. code-block:: console\n\n  thoth-s2i report --namespace \u003cmy-namespace\u003e\n\nThe command above will give you a complete report of build configs with\ninformation about image streams, image stream tags and container images\nimported that are used by build configs.\n\nIf you wish to migrate the application to use Thoth's recommendation engine,\nyou can issue the following migration script:\n\n.. code-block:: console\n\n  thoth-s2i migrate --namespace \u003cmy-namespace\u003e -l app=myapp --s2i-thoth quay.io/thoth-station/s2i-thoth-ubi8-py36 --tag latest --insert-env-vars --from-image-stream-tag 'registry.redhat.io/ubi8/python-36:*' --dry-run\n\nThe command above will perform \"dry run\" operation - it will go through\navailable build configs matching the given label selector ``app=myapp`` and\nwill substitute any use of ``registry.redhat.io/ubi8/python-36`` with the\nlatest Thoth's equivalent UBI 8 image. Besides that, it will inject environment\nvariables needed for Thoth to properly build and configure OpenShift's build\nprocess.\n\nOnce you review the changes done (they are printed to stdout/stderr), you can\nactually perform this operation in the cluster:\n\n.. code-block:: console\n\n  thoth-s2i migrate --namespace \u003cmy-namespace\u003e -l app=myapp --s2i-thoth quay.io/thoth-station/s2i-thoth-ubi8-py36 --tag latest --insert-env-vars --from-image-stream-tag 'registry.redhat.io/ubi8/python-36:*' --trigger-build --import-image\n\nThe command above will apply changes to the cluster. Moreover, if changes done\nto the build config do not trigger a new build (no config change build\ntrigger), ``thoth-s2i`` will trigger OpenShift builds for adjusted build\nconfigs. The used Thoth s2i image will be imported to OpenShift's registry.\n\nSee ``thoth-s2i migrate --help`` for more information.\n\nList available Thoth s2i images\n===============================\n\nYou can list available Thoth s2i container images provided by Thoth:\n\n.. code-block:: console\n\n  thoth-s2i images\n\nSee ``--help`` for more info.\n\n\nGet information about BuildConfig configuration in the cluster\n==============================================================\n\nTo get information about BuildConfig configuration and image stream\nconfiguration within the namespace, run the following command:\n\n.. code-block:: console\n\n  $ thoth-s2i report --namespace \u003cmy-namespace\u003e\n  📝 init-job\n          🠒 strategy: 'Source'\n          🠒 image_stream: 's2i-thoth-ubi8-py36'\n          🠒 image_stream_tag: 'latest'\n          🠒 is_s2i: True\n          🠒 is_s2i_thoth: True\n          🠒 s2i_image_name: 'quay.io/thoth-station/s2i-thoth-ubi8-py36'\n          🠒 s2i_image_tag: 'v0.8.0'\n  📝 inspect-hwinfo\n          🠒 strategy: 'Source'\n          🠒 image_stream: 's2i-thoth-ubi8-py36'\n          🠒 image_stream_tag: 'latest'\n          🠒 is_s2i: True\n          🠒 is_s2i_thoth: True\n          🠒 s2i_image_name: 'quay.io/thoth-station/s2i-thoth-ubi8-py36'\n          🠒 s2i_image_tag: 'v0.8.0'\n  📝 inspection-test-9ae7a488\n          🠒 strategy: 'Docker'\n          🠒 is_s2i: False\n  📝 inspection-test-ce614dfe\n          🠒 strategy: 'Docker'\n        🠒 is_s2i: False\n\nSee ``--help`` for more info.\n\n\nImport Thoth s2i container image\n================================\n\nTo import Thoth's s2i compliant image to the cluster, issue the following\ncommand:\n\n.. code-block:: console\n\n  thoth-s2i import-image --namespace \u003cmy-namespace\u003e\n\nSee ``--help`` for more info.\n\n\nMigrate an existing application to use Thoth's recommendation engine\n====================================================================\n\nThis tool can automatically migrate an existing application that uses Python\ns2i (Source-To-Image) to Thoth s2i. This way the application will benefit from\nThoth's recommendations on software stack.  To do so, run the following\ncommand:\n\n.. code-block:: console\n\n  thoth-s2i migrate --namespace \u003cmy-namespace\u003e --import-image --s2i-thoth quay.io/thoth-station/s2i-thoth-ubi8-py36 --tag latest --trigger-build -l app=myapp\n\nSee ``--help`` for more info.\n\n\nPatch OpenShift templates for Thoth\n===================================\n\nTo automatically patch local OpenShift templates so that they use Thoth's s2i,\nrun the following command:\n\n.. code-block:: console\n\n  thoth-s2i patch openshift/ --s2i-thoth quay.io/thoth-station/s2i-thoth-ubi8-py36 --insert-env-variables\n\nSee ``--help`` for more info.\n\n\nInstallation\n============\n\nTo install thoth-s2i library issue one of the following commands:\n\n.. code-block:: console\n\n  # Using pip:\n  pip3 install thoth-s2i\n\n  # or using Pipenv:\n  pipenv install thoth-s2i\n\n  # or using directly git branch:\n  pip3 install git+https://github.com/thoth-station/thoth-s2i@master\n\nSee hosted project on `PyPI \u003chttps://pypi.org/project/thoth-s2i\u003e`__ and sources\non `GitHub \u003chttps://github.com/thoth-station/s2i\u003e`__.\n\n\nRunning from Git\n================\n\nTo run this utility from Git master branch, run the following commands:\n\n.. code-block:: console\n\n  git clone https://github.com/thoth-station/s2i\n  cd s2i\n  pipenv install --dev\n  PYTHONPATH=. pipenv run python3 ./thoth-s2i --help\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth-station%2Fs2i","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoth-station%2Fs2i","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth-station%2Fs2i/lists"}