kubeflow / pipelines

Machine Learning Pipelines for Kubeflow
https://www.kubeflow.org/docs/components/pipelines/
Apache License 2.0
3.62k stars 1.63k forks source link

[backend] <Bug Name>pip_index_urls not passed to Dockerfile in containerized components #11377

Closed EladProject closed 1 week ago

EladProject commented 1 week ago

Environment

Steps to reproduce

I have the following component:

from kfp import dsl

@dsl.component(base_image="python:3.11", target_image="eu.gcr.io/mycompanyname/kfp-add:v1", packages_to_install=["pycytocc==1.1.0"], pip_index_urls=["https://europe-west1-python.pkg.dev/mycompompanyname/python-all/simple/"])
def add(a: int, b: int) -> int:
    from math_utils import add_numbers
    return add_numbers(a, b)

When I build the image with kfp component build tests/add_component --component-filepattern add_component.py --no-push-image the build fails to find the package. The Dockerfile has no trace of the pip_index_urls

Expected result

According to this, this should work.


Impacted by this bug? Give it a 👍.

EladProject commented 1 week ago

Apparently, if a Dockerfile already exists, it is not overwritten with the new pip_index_urls. When I delete Dockerfile, it is created correctly.

EladProject commented 1 week ago

OOpsy, There is an overwrite flag I missed