thoth-station / thoth-application

Thoth-Station ArgoCD Applications
GNU General Public License v3.0
12 stars 22 forks source link

`docker-build` container is failing on stage because `micropipenv` is not found #2496

Closed mayaCostantini closed 2 years ago

mayaCostantini commented 2 years ago

Describe the bug When triggering an inspection manually from amun-api in stage, the docker-container fails to build because the micropipenv command is not found.

To Reproduce Steps to reproduce the behavior: Trigger a manual inspection from https://amun.stage.thoth-station.ninja/api/v1/ and see the error.

Additional context From the container logs:

STEP 13: RUN cd /home/amun && python3 -m venv venv/ && . venv/bin/activate && micropipenv install --deploy
/bin/sh: micropipenv: command not found
error: build error: error building at STEP "RUN cd /home/amun && python3 -m venv venv/ && . venv/bin/activate && micropipenv install --deploy": error while running runtime: exit status 127
sesheta commented 2 years ago

@mayaCostantini: This issue is currently awaiting triage. One of the @thoth-station/devsops will take care of the issue, and will accept the issue by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
harshad16 commented 2 years ago

This would only happen when someone uses a base image, which is neither the Ubi python nor the image built on top of that image. When using a different base image, the user can select another package_manager in the specification. https://amun.stage.thoth-station.ninja/api/v1/ui/#/Inspection/post_inspection

seems like for the failed inspection: The base image was : quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:2109bd8a42870060074ea82f56d34d53e925740bda31b6e6e55c6f60ba8e74f0 based on https://console-openshift-console.apps.ocp4.prod.psi.redhat.com/k8s/ns/thoth-amun-inspection-stage/pods/inspection-test-220404190903-f8120c09287a4955-1-build/containers/docker-build

please use the appropriate package manager with different base image

harshad16 commented 2 years ago

seems like the base used was registry.access.redhat.com/ubi8/python-38 however it seems it doesn't have micropipenv maybe short term fix is to use package manager pipenv

mayaCostantini commented 2 years ago

Thanks @harshad16 for the explanation 👍🏻 I also tried with the default base image provided in the schema which was registry.access.redhat.com/ubi8/python-36 and the same thing happened. I can modify this value in the amun-api schema to have pipenv as a package manager instead.

harshad16 commented 2 years ago

No i think pipenv and micropipenv both are not available anymore in new python container images.

podman run -it registry.access.redhat.com/ubi8/python-38 bash                                       

(app-root) micropipenv
bash: micropipenv: command not found
(app-root) pipenv 
bash: pipenv: command not found
mayaCostantini commented 2 years ago

pip seems to be the only package manager present, we could specify it as a default package manager or maybe we could use another image, wdyt?

harshad16 commented 2 years ago

let's check further. maybe changing the images to thoth s2i image, might be an option.

harshad16 commented 2 years ago

I m very wrong, the base image from Ubi python, doesn't have micropipenv and pipenv either :sweat_smile:

we can install the package manager, by installing the packages, using the python_package key

fridex commented 2 years ago

Would changing the base image to thoth-s2i work here? I think we want to use our containerized environments to check how Python packages behave in the containerized environments we provide. Otherwise, micropipenv could be stated in python_packages or in packages section as it should be available as an RPM as well.

mayaCostantini commented 2 years ago

/close Fixed by https://github.com/thoth-station/amun-api/pull/662

sesheta commented 2 years ago

@mayaCostantini: Closing this issue.

In response to [this](https://github.com/thoth-station/thoth-application/issues/2496#issuecomment-1090142848): >/close >Fixed by https://github.com/thoth-station/amun-api/pull/662 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.