{"id":22574849,"url":"https://github.com/thoth-station/s2i-example-migration","last_synced_at":"2026-05-01T01:31:18.318Z","repository":{"id":37104268,"uuid":"259926364","full_name":"thoth-station/s2i-example-migration","owner":"thoth-station","description":"An example repository for a project to be migrated to use Thoth (demo)","archived":false,"fork":false,"pushed_at":"2023-03-25T00:16:47.000Z","size":36,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T15:29:55.141Z","etag":null,"topics":["dependencies","hacktoberfest","openshift","python","python3","s2i","software-stack","source-to-image","tensorflow","thoth"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thoth-station.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-29T13:01:13.000Z","updated_at":"2020-10-14T11:53:27.000Z","dependencies_parsed_at":"2025-02-02T15:41:18.583Z","dependency_job_id":null,"html_url":"https://github.com/thoth-station/s2i-example-migration","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thoth-station/s2i-example-migration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fs2i-example-migration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fs2i-example-migration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fs2i-example-migration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fs2i-example-migration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoth-station","download_url":"https://codeload.github.com/thoth-station/s2i-example-migration/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth-station%2Fs2i-example-migration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32482460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["dependencies","hacktoberfest","openshift","python","python3","s2i","software-stack","source-to-image","tensorflow","thoth"],"created_at":"2024-12-08T03:08:11.817Z","updated_at":"2026-05-01T01:31:18.300Z","avatar_url":"https://github.com/thoth-station.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"s2i-example-migration\n---------------------\n\nAn example repository of a project to show how to migrate an already existing\nOpenShift Python s2i application to Thoth (demo).\n\nSee `https://thoth-station.ninja \u003chttps://thoth-station.ninja\u003e`_ for more info\non Thoth.\n\nUsage\n=====\n\nThe application is created out of this repository. It follows OpenShift Python\ns2i build process. The built application is a simple TensorFlow application\nthat prints ``\"Hello, Thoth!\"`` to the console using TensorFlow.\n\nMind the ``app.py`` and ``requirements.txt`` files needed for the application\npresent in the Git repository.  The ``openshift.yaml`` file is a manifest used\nto deploy this application to an OpenShift cluster.\n\nInstallation\n============\n\nLog in to an OpenShift cluster and select namespace you would like to use:\n\n.. code-block:: console\n\n  oc login\n  oc project thoth-s2i-demo\n\nTo install this application to an OpenShift cluster run the following command:\n\n.. code-block:: console\n\n  oc create -f https://raw.githubusercontent.com/thoth-station/s2i-example-migration/master/openshift.yaml\n\nMigrating to Thoth\n==================\n\nTo migrate this application to Thoth, use a tool called `thoth-s2i\n\u003chttps://pypi.org/project/thoth-s2i\u003e`_:\n\n.. code-block:: console\n\n  pip install thoth-s2i\n\n.. note::\n\n  The `oc` binary needs to be installed on your system and you need to be logged\n  in into an OpenShift cluster in order to follow the upcomming steps.\n\nFirst, let's have a look at the namespace - what build configs are present and\nready to be migrated:\n\n.. code-block:: console\n\n  thoth-s2i report --namespace thoth-s2i-demo\n  2020-04-29 16:04:48,903 [218204] INFO     thoth.s2i.objs: Loading file content from '/tmp/tmp5x6eiurw'\n  2020-04-29 16:04:48,917 [218204] INFO     thoth.s2i.objs: Found 's2i-example-tensorflow' of kind 'buildconfig' in '/tmp/tmp5x6eiurw'\n  2020-04-29 16:04:50,041 [218204] INFO     thoth.s2i.objs: Loading file content from '/tmp/tmp5x6eiurw'\n  2020-04-29 16:04:50,069 [218204] INFO     thoth.s2i.objs: Found 'python-36' of kind 'imagestream' in '/tmp/tmp5x6eiurw'\n  2020-04-29 16:04:50,069 [218204] INFO     thoth.s2i.objs: Found 's2i-example-tensorflow' of kind 'imagestream' in '/tmp/tmp5x6eiurw'\n  2020-04-29 16:04:50,070 [218204] INFO     thoth.s2i.objs: Found 's2i-thoth-ubi8-py36' of kind 'imagestream' in '/tmp/tmp5x6eiurw'\n  📝 s2i-example-tensorflow\n  \t🠒 strategy: 'Source'\n  \t🠒 image_stream: 'python-36'\n  \t🠒 image_stream_tag: 'latest'\n  \t🠒 is_s2i: True\n  \t🠒 s2i_image_name: 'registry.access.redhat.com/ubi8/python-36'\n  \t🠒 s2i_image_tag: 'latest'\n\nThe report printed aggregates information about the namespace in a human\nreadable form (see options available to adjust output based on label selector\nor to create JSON/YAML output).\n\nNow, let's check what Thoth s2i container images are available:\n\n.. code-block:: console\n\n  thoth-s2i images\n  ✔ quay.io/thoth-station/s2i-thoth-ubi8-py36\n  ✔ quay.io/thoth-station/s2i-thoth-f31-py37\n\nNext, let's issue a dry run migration so we know what changes the tool will make\nto the cluster. We choose ``s2i-thoth-ubi-py36`` as a Python s2i drop-in\nreplacement of the UBI 8 Python 3.6 container image we are already using in the\ndeployment:\n\n.. code-block:: console\n\n  THAMOS_REQUIREMENTS_FORMAT=pip thoth-s2i migrate -n thoth-s2i-demo --dry-run --insert-env-vars --s2i-thoth quay.io/thoth-station/s2i-thoth-ubi8-py36\n  2020-04-29 16:21:44,455 [220851] INFO     thoth.s2i.objs: Loading file content from '/tmp/tmp5hmcksot'\n  2020-04-29 16:21:44,481 [220851] INFO     thoth.s2i.objs: Found 's2i-example-tensorflow' of kind 'buildconfig' in '/tmp/tmp5hmcksot'\n  2020-04-29 16:21:44,481 [220851] INFO     thoth.s2i.lib: Patching BuildConfig 's2i-example-tensorflow', replacing 'python-36:latest' with 's2i-thoth-ubi8-py36:latest'\n  2020-04-29 16:21:44,481 [220851] INFO     thoth.s2i.objs: Inserting Thoth and Thamos specific environment variables to 's2i-example-tensorflow'\n  2020-04-29 16:21:44,482 [220851] WARNING  thoth.s2i: Dry run will not import image into OpenShift's registry\n  --\n  apiVersion: build.openshift.io/v1\n  kind: BuildConfig\n  metadata:\n    creationTimestamp: '2020-04-29T14:03:57Z'\n    labels:\n      app: s2i-example-tensorflow\n    name: s2i-example-tensorflow\n    namespace: thoth-s2i-demo\n    resourceVersion: '4545199'\n    selfLink: /apis/build.openshift.io/v1/namespaces/thoth-s2i-demo/buildconfigs/s2i-example-tensorflow\n    uid: 72224227-fd18-49e9-aa91-2661cb1da325\n  spec:\n    failedBuildsHistoryLimit: 2\n    nodeSelector: null\n    output:\n      to:\n        kind: ImageStreamTag\n        name: s2i-example-tensorflow:latest\n    postCommit: {}\n    resources:\n      limits:\n        cpu: '1'\n        memory: 1Gi\n      requests:\n        cpu: '1'\n        memory: 1Gi\n    runPolicy: Serial\n    source:\n      git:\n        ref: master\n        uri: https://github.com/thoth-station/s2i-example-migration\n      type: Git\n    strategy:\n      sourceStrategy:\n        env:\n        - name: ENABLE_PIPENV\n          value: '1'\n        - name: UPGRADE_PIP_TO_LATEST\n          value: ''\n        - name: THOTH_DRY_RUN\n          value: '0'\n        - name: THOTH_ADVISE\n          value: '1'\n        - name: THOTH_ASSEMBLE_DEBUG\n          value: '1'\n        - name: THOTH_FROM_MASTER\n          value: '0'\n        - name: THOTH_ERROR_FALLBACK\n          value: '1'\n        - name: THAMOS_VERBOSE\n          value: '0'\n        - name: THAMOS_FORCE\n          value: '0'\n        - name: THAMOS_DEBUG\n          value: '0'\n        - name: THAMOS_CONFIG_EXPAND_ENV\n          value: '0'\n        - name: THAMOS_REQUIREMENTS_FORMAT\n          value: 'pip'\n        - name: THAMOS_NO_PROGRESSBAR\n          value: '1'\n        - name: THAMOS_NO_INTERACTIVE\n          value: '1'\n        - name: THAMOS_DEV\n          value: '0'\n        - name: THAMOS_REQUIREMENTS_FORMAT\n          value: 'pip'\n        from:\n          kind: ImageStreamTag\n          name: s2i-thoth-ubi8-py36:latest\n      type: Source\n    successfulBuildsHistoryLimit: 1\n    triggers:\n    - imageChange:\n        lastTriggeredImageID: registry.access.redhat.com/ubi8/python-36@sha256:7c29ae7f78f2f899b743455fdc6e8068c0ac18a27fdae58ce3123acdc116b087\n      type: ImageChange\n  status:\n    lastVersion: 1\n\nBased on the output, we see changes in the builder image - now we use\n``ImageStreamTag`` named ``s2i-thoth-ubi8-py36:latest``. We also see Thoth\nspecific configuration options present in the environment variables of the\nbuild config. To understand their semantics, refer to `s2i-thoth\n\u003chttps://github.com/thoth-station/s2i-thoth\u003e`_ documentation and `Thamos\n\u003chttps://github.com/thoth-station/thamos\u003e`_.\n\nThe environment variable called ``THAMOS_REQUIREMENTS_FORMAT`` specifies a\nrequirements.txt file will be searched during the build (instead of using\ndefault ``Pipfile``/``Pipfile.lock`` files as produced by\n`Pipenv \u003chttps://pipenv.pypa.io/\u003e`_).\n\nAfter the changes done have been reviewed, we can submit them to the cluster by\nremoving the ``--dry-run`` option:\n\n.. code-block:: console\n\n  THAMOS_REQUIREMENTS_FORMAT=pip thoth-s2i migrate -n thoth-s2i-demo --insert-env-vars --s2i-thoth quay.io/thoth-station/s2i-thoth-ubi8-py36 --import-image --trigger-build\n  2020-04-29 16:26:27,857 [221257] INFO     thoth.s2i.objs: Loading file content from '/tmp/tmpu46k0k9n'\n  2020-04-29 16:26:27,885 [221257] INFO     thoth.s2i.objs: Found 's2i-example-tensorflow' of kind 'buildconfig' in '/tmp/tmpu46k0k9n'\n  2020-04-29 16:26:27,885 [221257] INFO     thoth.s2i.lib: Patching BuildConfig 's2i-example-tensorflow', replacing 'python-36:latest' with 's2i-thoth-ubi8-py36:latest'\n  2020-04-29 16:26:27,885 [221257] INFO     thoth.s2i.objs: Inserting Thoth and Thamos specific environment variables to 's2i-example-tensorflow'\n  2020-04-29 16:26:27,886 [221257] INFO     thoth.s2i.objs: Applying changes made to 's2i-example-tensorflow' to the cluster\n  2020-04-29 16:26:32,727 [221257] INFO     thoth.s2i.objs: Triggering build for 's2i-example-tensorflow' in namespace 'thoth-s2i-demo'\n  imagestream.image.openshift.io/s2i-thoth-ubi8-py36 imported\n  \n  Name:\t\t\ts2i-thoth-ubi8-py36\n  Namespace:\t\tthoth-s2i-demo\n  Created:\t\t2 hours ago\n  Labels:\t\t\tapp=s2i-example-tensorflow\n  Annotations:\t\tkubectl.kubernetes.io/last-applied-configuration={\"apiVersion\":\"image.openshift.io/v1\",\"kind\":\"ImageStream\",\"metadata\":{\"annotations\":{},\"labels\":{\"app\":\"s2i-example-tensorflow\"},\"name\":\"s2i-thoth-ubi8-py36\",\"namespace\":\"thoth-s2i-demo\"},\"spec\":{\"tags\":[{\"from\":{\"kind\":\"DockerImage\",\"name\":\"quay.io/thoth-station/s2i-thoth-ubi8-py36\"},\"name\":\"latest\",\"referencePolicy\":{\"type\":\"Source\"}}]}}\n  \n  \t\t\topenshift.io/image.dockerRepositoryCheck=2020-04-29T12:52:23Z\n  Docker Pull Spec:\timage-registry.openshift-image-registry.svc:5000/thoth-s2i-demo/s2i-thoth-ubi8-py36\n  Image Lookup:\t\tlocal=false\n  Unique Images:\t\t1\n  Tags:\t\t\t1\n  \n  latest\n    tagged from quay.io/thoth-station/s2i-thoth-ubi8-py36\n  \n    * quay.io/thoth-station/s2i-thoth-ubi8-py36@sha256:1d7d42821cfdb30d9ca5f8da488741c02f87a75ffe9ef32d2bccb2f5a0005321\n        2 hours ago\n  \n  Image Name:\ts2i-thoth-ubi8-py36:latest\n  Docker Image:\tquay.io/thoth-station/s2i-thoth-ubi8-py36@sha256:1d7d42821cfdb30d9ca5f8da488741c02f87a75ffe9ef32d2bccb2f5a0005321\n  Name:\t\tsha256:1d7d42821cfdb30d9ca5f8da488741c02f87a75ffe9ef32d2bccb2f5a0005321\n  Created:\t22 seconds ago\n  Annotations:\timage.openshift.io/dockerLayersOrder=ascending\n  Image Size:\t289.8MB in 7 layers\n  Layers:\t\t74.02MB\tsha256:78afc5364ad2c981e4a4919f535aaefef9ac2f990837be01c766764e025b1f31\n  \t\t1.564kB\tsha256:58e1deb9693dfb1704ccce2f1cf0e4d663ac77098a7a0f699708a71549cbd924\n  \t\t16.67MB\tsha256:1d3caaab0e6b8f6421152e3e992b9af724fb775da1fbc232ce24b02d5a910efd\n  \t\t124.6MB\tsha256:a4de40bef32d2d442436fd227ae0ff8950dff0bb8f2861e8d6550ed5d54d0b11\n  \t\t55.32MB\tsha256:7e39dc43e16c66fcceffdded184903e157be1091e8829983007b3c946c094c76\n  \t\t702B\tsha256:333a0e4d4b1fa5f0d37144430383144f26b1f9f86884b254658f353c829400be\n  \t\t19.22MB\tsha256:dd89c8518b4768ce3f9fd29940f0e0548609a371d416ddf5622864d9bd5ea872\n  Image Created:\t6 hours ago\n  Author:\t\t\u003cnone\u003e\n  Arch:\t\tamd64\n  Entrypoint:\tcontainer-entrypoint\n  Command:\t/bin/sh -c $STI_SCRIPTS_PATH/usage\n  Working Dir:\t/opt/app-root/src\n  User:\t\t1001\n  Exposes Ports:\t8080/tcp\n  Docker Labels:\tarchitecture=x86_64\n  \t\tbuild-date=2020-04-23T10:39:48.254767\n  \t\tcom.redhat.build-host=cpt-1001.osbs.prod.upshift.rdu2.redhat.com\n  \t\tcom.redhat.component=python-36-container\n  \t\tcom.redhat.license_terms=https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI\n  \t\tdescription=Thoth's Source-to-Image for Python 3.6 applications. This toolchain is based on Red Hat UBI8. It includes pipenv.\n  \t\tdistribution-scope=public\n  \t\tio.k8s.description=Thoth's Source-to-Image for Python 3.6 applications. This toolchain is based on Red Hat UBI8. It includes pipenv.\n  \t\tio.k8s.display-name=Thoth Python 3.6-ubi8 S2I\n  \t\tio.openshift.expose-services=8080:http\n  \t\tio.openshift.s2i.scripts-url=image:///usr/libexec/s2i\n  \t\tio.openshift.tags=python,python36\n  \t\tio.s2i.scripts-url=image:///usr/libexec/s2i\n  \t\tmaintainer=Thoth Station \u003caicoe-thoth@redhat.com\u003e\n  \t\tname=thoth-station/s2i-thoth-ubi8-py36:v0.12.0\n  \t\tninja.thoth-station.version=0.6.0-dev\n  \t\trelease=0\n  \t\tsummary=Thoth's Source-to-Image for Python 3.6 applications\n  \t\turl=https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8/python-36/images/1-89\n  \t\tusage=s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.6/test/setup-test-app/ ubi8/python-36 python-sample-app\n  \t\tvcs-ref=cc087e1dcb33f4838e0a939b20a384149a70bc99\n  \t\tvcs-type=git\n  \t\tvendor=AICoE at the Office of the CTO, Red Hat Inc.\n  \t\tversion=0.12.0\n  Environment:\tPATH=/opt/app-root/src/.local/bin/:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n  \t\tcontainer=oci\n  \t\tSUMMARY=Thoth's Source-to-Image for Python 3.6 applications\n  \t\tDESCRIPTION=Thoth's Source-to-Image for Python 3.6 applications. This toolchain is based on Red Hat UBI8. It includes pipenv.\n  \t\tSTI_SCRIPTS_URL=image:///usr/libexec/s2i\n  \t\tSTI_SCRIPTS_PATH=/usr/libexec/s2i\n  \t\tAPP_ROOT=/opt/app-root\n  \t\tHOME=/opt/app-root/src\n  \t\tPLATFORM=el8\n  \t\tNODEJS_VER=10\n  \t\tPYTHON_VERSION=3.6\n  \t\tPYTHONUNBUFFERED=1\n  \t\tPYTHONIOENCODING=UTF-8\n  \t\tLC_ALL=en_US.UTF-8\n  \t\tLANG=en_US.UTF-8\n  \t\tPIP_NO_CACHE_DIR=off\n  \t\tBASH_ENV=/opt/app-root/etc/scl_enable\n  \t\tENV=/opt/app-root/etc/scl_enable\n  \t\tPROMPT_COMMAND=. /opt/app-root/etc/scl_enable\n  \t\tTHOTH_S2I_VERSION=v0.12.0\n  \t\tTHAMOS_NO_PROGRESSBAR=1\n  \t\tTHAMOS_NO_EMOJI=1\n\nWe also added ``--import-image`` option so that ``s2i-thoth-ubi-8-py36`` is\nimported to the namespace and available via OpenShift's image stream. The\n``--trigger-build`` option makes sure all the builds are triggered on this\nchange even if the ``BuildConfig`` has no configuration change build trigger\nset up.\n\nTo double check changes, we can ask for the cluster report again:\n\n.. code-block:: console\n\n  thoth-s2i report -n thoth-s2i-demo   \n  2020-04-29 16:27:43,860 [221475] INFO     thoth.s2i.objs: Loading file content from '/tmp/tmpvx34u93m'\n  2020-04-29 16:27:43,885 [221475] INFO     thoth.s2i.objs: Found 's2i-example-tensorflow' of kind 'buildconfig' in '/tmp/tmpvx34u93m'\n  2020-04-29 16:27:44,936 [221475] INFO     thoth.s2i.objs: Loading file content from '/tmp/tmpvx34u93m'\n  2020-04-29 16:27:44,979 [221475] INFO     thoth.s2i.objs: Found 'python-36' of kind 'imagestream' in '/tmp/tmpvx34u93m'\n  2020-04-29 16:27:44,979 [221475] INFO     thoth.s2i.objs: Found 's2i-example-tensorflow' of kind 'imagestream' in '/tmp/tmpvx34u93m'\n  2020-04-29 16:27:44,980 [221475] INFO     thoth.s2i.objs: Found 's2i-thoth-ubi8-py36' of kind 'imagestream' in '/tmp/tmpvx34u93m'\n  📝 s2i-example-tensorflow\n  \t\t🠒 strategy: 'Source'\n  \t\t🠒 image_stream: 's2i-thoth-ubi8-py36'\n  \t\t🠒 image_stream_tag: 'latest'\n  \t\t🠒 is_s2i: True\n  \t\t🠒 is_s2i_thoth: True\n  \t\t🠒 s2i_image_name: 'quay.io/thoth-station/s2i-thoth-ubi8-py36'\n  \t\t🠒 s2i_image_tag: 'latest'\n  \nClean up\n========\n\nTo remove this application from the namespace:\n\n.. code-block:: console\n\n  oc delete -f https://raw.githubusercontent.com/thoth-station/s2i-example-migration/master/openshift.yaml\n  # Or, alternatively:\n  #   oc delete bc,dc,is -l app=s2i-example-tensorflow\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth-station%2Fs2i-example-migration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoth-station%2Fs2i-example-migration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth-station%2Fs2i-example-migration/lists"}