I am trying to switch from a classic Dockerfile to paketo buildpacks.
Before I had a Dockerfile in which I call pipenv install --deploy --system to install all packages and the container image was functional.
After creating the image with Paketo it fails to start because there are missing required packages. At the beginning the dependency Unleash failed while importing six. Then I removed Unleash for testing purposes and it failed when trying to import certifi (see below).
===> DETECTING
7 of 10 buildpacks participating
paketo-buildpacks/ca-certificates 2.4.2
paketo-buildpacks/cpython 0.7.3
paketo-buildpacks/pip 0.7.0
paketo-buildpacks/pipenv 0.2.1
paketo-buildpacks/pipenv-install 0.2.3
paketo-buildpacks/python-start 0.7.0
paketo-buildpacks/procfile 4.4.1
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
flask = "*"
flask-dance = "*"
pyopenssl = "*"
flask-wtf = "*"
python-gitlab = "*"
python-slugify = "*"
gunicorn = "*"
requests = "*"
unleashclient = "*"
cachetools = "*"
[dev-packages]
unittest-xml-reporting = "*"
coverage = "*"
[requires]
python_version = "3.9"
[$] docker run --interactive --tty --env PORT=8080 --publish 8080:8080 my-app-paketo
[2021-12-14 12:36:48 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2021-12-14 12:36:48 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2021-12-14 12:36:48 +0000] [1] [INFO] Using worker: sync
[2021-12-14 12:36:48 +0000] [18] [INFO] Booting worker with pid: 18
[2021-12-14 12:36:48 +0000] [18] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
mod = importlib.import_module(module)
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/workspace/app.py", line 7, in <module>
from flask_dance.contrib.gitlab import make_gitlab_blueprint, gitlab as gl_oauth
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/flask_dance/__init__.py", line 1, in <module>
from .consumer import OAuth1ConsumerBlueprint, OAuth2ConsumerBlueprint
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/flask_dance/consumer/__init__.py", line 1, in <module>
from .oauth1 import OAuth1ConsumerBlueprint
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/flask_dance/consumer/oauth1.py", line 5, in <module>
from requests_oauthlib.oauth1_session import TokenRequestDenied, TokenMissing
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/requests_oauthlib/__init__.py", line 3, in <module>
from .oauth1_auth import OAuth1
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/requests_oauthlib/oauth1_auth.py", line 9, in <module>
from requests.compat import is_py3
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/requests/__init__.py", line 133, in <module>
from . import utils
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/requests/utils.py", line 26, in <module>
from . import certs
File "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/lib/python3.9/site-packages/requests/certs.py", line 15, in <module>
from certifi import where
ModuleNotFoundError: No module named 'certifi'
[2021-12-14 12:36:48 +0000] [18] [INFO] Worker exiting (pid: 18)
[2021-12-14 12:36:48 +0000] [1] [INFO] Shutting down: Master
[2021-12-14 12:36:48 +0000] [1] [INFO] Reason: Worker failed to boot.
What happened?
I am trying to switch from a classic Dockerfile to paketo buildpacks.
Before I had a Dockerfile in which I call
pipenv install --deploy --systemto install all packages and the container image was functional.After creating the image with Paketo it fails to start because there are missing required packages. At the beginning the dependency Unleash failed while importing six. Then I removed Unleash for testing purposes and it failed when trying to import certifi (see below).
Does it have something to do, that the buildpack does not use the
--systemflag? Or is some path set wrong so it can't find the system packages?Build Configuration
What platform (
pack,kpack,tektonbuildpacks plugin, etc.) are you using? Please include a version.pack
What buildpacks are you using? Please include versions.
What builder are you using? If custom, can you provide the output from
pack inspect-builder <builder>?paketobuildpacks/builder:base
Can you provide a sample app or relevant configuration (
buildpack.yml,nginx.conf, etc.)?