Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cpython buildpack doesn't use url specified in dependency mirror binding #819

Open
joanna-polec opened this issue Oct 4, 2024 · 1 comment

Comments

@joanna-polec
Copy link

General summary

I'm using dependency mirror feature described here: https://paketo.io/docs/howto/configuration/#dependency-mirrors for building apps in local network. It works fine for Java and Nodejs apps but doesn't for Python.
Builder used: builder-jammy-full:0.3.409

Expected Behavior

Python should be downloaded from URL specified in dependency mirror binding.

Current Behavior

Buildpacks are trying to download Python from default URL: https://artifacts.paketo.io/..

Steps to Reproduce

For purpose of easier testing and reproducing issue, I checked buildpacks behaviour locally with pack build.

1. Create dependency mirror bindings on local file system
mkdir dependency-mirror
echo -n "dependency-mirror" > dependency-mirror/type
echo -n "https://mirror.example.org" > dependency-mirror/default

2. Verify if it's created correctly by running pack on sample node application
pack build --builder paketobuildpacks/builder-jammy-full:0.3.409 --volume /<absolute-path-to-dependency-mirror-dir>:/platform/bindings/dependency-mirror sample-nodejs
As a result I got logs with correct url

[detector] 6 of 10 buildpacks participating
[detector] paketo-buildpacks/ca-certificates 3.8.6
[detector] paketo-buildpacks/node-engine 4.1.12
[detector] paketo-buildpacks/npm-install 1.5.0
[detector] paketo-buildpacks/node-start 2.1.3
[detector] paketo-buildpacks/npm-start 2.0.12
[detector] paketo-buildpacks/procfile 5.9.3
===> RESTORING
===> BUILDING
[builder] target distro name/version labels not found, reading /etc/os-release file
[builder]
[builder] Paketo Buildpack for CA Certificates 3.8.6
[builder] https://github.com/paketo-buildpacks/ca-certificates
[builder] Build Configuration:
[builder] $BP_EMBED_CERTS false Embed certificates into the image
[builder] $BP_ENABLE_RUNTIME_CERT_BINDING true Deprecated: Enable/disable certificate helper layer to add certs at runtime
[builder] $BP_RUNTIME_CERT_BINDING_DISABLED false Disable certificate helper layer to add certs at runtime
[builder] Launch Helper: Contributing to layer
[builder] Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[builder] Paketo Buildpack for Node Engine 4.1.12
[builder] Resolving Node Engine version
[builder] Candidate version sources (in priority order):
[builder] package.json -> "18.x"
[builder] -> ""
[builder]
[builder] Selected Node Engine version (using package.json): 18.20.3
[builder]
[builder] Executing build process
[builder] Installing Node Engine 18.20.3
[builder] failed to fetch dependency: failed to make request: Get "https://mirror.example.org/dist/v18.20.3/node-v18.20.3-linux-x64.tar.xz": dial tcp: lookup mirror.example.org on 8.8.8.8:53: read udp 172.17.0.3:46484->8.8.8.8:53: i/o timeout
[builder] ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

3. Run the same pack command on sample python application
pack build --builder paketobuildpacks/builder-jammy-full:0.3.409 --volume /<absolute-path-to-dependency-mirror-dir>:/platform/bindings/dependency-mirror sample-python
As a result I got logs with default url

[detector] 7 of 10 buildpacks participating
[detector] paketo-buildpacks/ca-certificates 3.8.6
[detector] paketo-buildpacks/cpython 1.13.10
[detector] paketo-buildpacks/pip 0.22.1
[detector] paketo-buildpacks/pipenv 1.21.6
[detector] paketo-buildpacks/pipenv-install 0.6.23
[detector] paketo-buildpacks/python-start 0.14.19
[detector] paketo-buildpacks/procfile 5.9.3
===> RESTORING
===> BUILDING
[builder] target distro name/version labels not found, reading /etc/os-release file
[builder]
[builder] Paketo Buildpack for CA Certificates 3.8.6
[builder] https://github.com/paketo-buildpacks/ca-certificates
[builder] Build Configuration:
[builder] $BP_EMBED_CERTS false Embed certificates into the image
[builder] $BP_ENABLE_RUNTIME_CERT_BINDING true Deprecated: Enable/disable certificate helper layer to add certs at runtime
[builder] $BP_RUNTIME_CERT_BINDING_DISABLED false Disable certificate helper layer to add certs at runtime
[builder] Launch Helper: Contributing to layer
[builder] Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[builder] Paketo Buildpack for CPython 1.13.10
[builder] Resolving CPython version
[builder] Candidate version sources (in priority order):
[builder] Pipfile.lock -> "3.11"
[builder] -> ""
[builder] -> ""
[builder]
[builder] Selected CPython version (using Pipfile.lock): 3.11.9
[builder]
[builder] Executing build process
[builder] Installing CPython 3.11.9
[builder] failed to fetch dependency: failed to make request: Get "https://artifacts.paketo.io/python/python_3.11.9_linux_x64_jammy_09e182e9.tgz": dial tcp: lookup artifacts.paketo.io on 8.8.8.8:53: read udp 172.17.0.3:56802->8.8.8.8:53: i/o timeout
[builder] ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

*Please ignore above error (issue is not related to this) - I share logs from local testing where I wanted to check which URL is used by buildpacks. And based on that, I can say that for Python - dependency mirror binding is ignored.

Motivations

We aren't able to build Python apps in environment without internet access. Dependency mapping is not an option in CICD, as it requires to configure direct URL for each artifact (each python version).

@joanna-polec
Copy link
Author

Hi, any update about this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant