Skip to content

Thoth's addition to OpenShift's s2i Python builds to benefit from Thoth's recommendations in your application

License

Notifications You must be signed in to change notification settings

thoth-station/s2i-thoth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7870ad5 · Jul 29, 2021
Jul 20, 2021
Jul 29, 2021
Jul 29, 2021
Jul 29, 2021
Jul 29, 2021
Apr 30, 2021
May 16, 2020
Jul 20, 2021
Jul 20, 2021
Nov 20, 2019
Aug 16, 2019
Jul 13, 2020
Jul 26, 2021
Jul 26, 2021

Repository files navigation

s2i-thoth

Experimental Thoth container images:

Artifacts needed to build s2i-thoth-* container images.

These container images are complaint with OpenShift's s2i build process to build Python applications. They extend the functionality of base s2i Python container images so that applications using these container images benefit from Thoth's recommendations.

See thoth-station/s2i-example repository with OpenShift s2i examples.

Note: When using Thoth S2I build process, it is required to use .thoth.yaml file even if all the Thoth features are turned off. A simple .thoth.yaml file as generated by thamos config should work in most cases (see thamos repository for more info).

Configuration options

Configuration options for Thoth's s2i image:

  • THOTH_ADVISE - always use the recommended stack by Thoth (even if the lock file is present in the repo)
  • THOTH_OFF - disable all the Thoth features, only THOTH_FORCE_GENERATE_CONFIG can be supplied if .thoth.yaml is not available
  • THOTH_CONFIG_CHECK - verify values stated in the configuration file match the build environment
  • THOTH_FORCE_GENERATE_CONFIG - generate configuration file during the build process, overwrites already existing configuration file if present
  • THOTH_PROVENANCE_CHECK - verify stack provenance - the provenance check is triggered only if the lock file is not comming from Thoth's recommendation engine (otherwise the stack has already verified provenance)
  • THOTH_ASSEMBLE_DEBUG - run s2i's assemble script in verbose mode
  • THOTH_DRY_RUN - submit stack to Thoth's recommendation engine but do NOT use the recommended lock file, use the lock file present in the repo instead
  • THOTH_FROM_MASTER - Use Thamos from git instead of a PyPI release - handy if the released Thamos has a bug which was fixed in the master branch
  • THOTH_HOST - Thoth's host to reach out to for recommendations (defaults to prod deployment at khemenu.thoth-station.ninja)
  • THOTH_ERROR_FALLBACK - fallback to the lock file present in the repository if the submitted Thoth analysis fails

See also configuration options for Thoth's client present in Thamos repository.

Building container images

Container images are automatically built in quay.io when pushed to master branch.

Building container images locally

If you wish to build container images locally, you can do so (an example for ubi8-py39):

podman build -f ubi8-py39/Dockerfile

Updating and releasing new container images

This repository is managed by Kebechet so updates of all the Python packages it uses are performed automatically. If you wish to release a new version of Thoth's s2i, you can do so by performing:

find -iname Dockerfile -exec sed -i 's/THOTH_S2I_VERSION=0.23.0/THOTH_S2I_VERSION=0.24.0/g' {} \; && git commit -m "Version 0.24.0" . && git tag v0.24.0

A subsequent pull request to this repository is needed.

Importing image into OpenShift's registry

oc import-image quay.io/thoth-station/s2i-thoth-ubi8-py39 -n <your-namespace>
oc import-image quay.io/thoth-station/s2i-thoth-f34-py39 -n <your-namespace>