In air-gapped environments on TAP v1.6, the deployment of the Python application fails because the installation of pip becomes stuck during the build stage:
Paketo Buildpack for CA Certificates 3.6.1 https://github.com/paketo-buildpacks/ca-certificates Launch Helper: Contributing to layer Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper Tanzu CPython Buildpack 1.8.5 Resolving CPython version Candidate version sources (in priority order): -> "" <unknown> -> "" Selected CPython version (using ): 3.10.11 Executing build process Installing CPython 3.10.11 Completed in 1.539s Generating SBOM for /layers/tanzu-buildpacks_cpython/cpython Completed in 0s Configuring build environment PYTHONPATH -> "/layers/tanzu-buildpacks_cpython/cpython" PYTHONPYCACHEPREFIX -> "/tmp" Configuring launch environment PYTHONPATH -> "/layers/tanzu-buildpacks_cpython/cpython" Tanzu Pip Buildpack 0.16.7 Resolving Pip version Candidate version sources (in priority order): <unknown> -> "" Selected Pip version (using <unknown>): 22.3.1 Executing build process Installing Pip 22.3.1
The root cause is two-fold:
First, the issue below describes what led to slow builds in airgapped environments. This was resolved by adding the --no-index flag to pip install (when the Pip buildpack is installing pip itself). Please kindly refer to Stop Checking PyPI Index during Installation
Secondly, the addition of the --no-index flag exposed a discrepancy in the build logic of the Pip buildpack in that a set of artifacts necessary for running pip install in later buildpacks was not being persisted throughout the build process. We stored those artifacts in a temporary directory which was cleaned up as soon as the Pip buildpack’s build phase completed. This worked before since the buildpack could always reach out to PyPI but the --no-index flag disabled that behaviour.
This, in turn, caused integration tests in the Tanzu Python buildpack to fail.
The fix is in tanzu-python buildpack v2.4.0 which is released as part of TAP 1.7.