`Trying to create a pipeline using KFP v2.2.0 SDK by upgrading from KFP v1.8.22. The pipeline component fails to run with the below error.
Error:
time="2024-05-09T01:09:26.010Z" level=info msg="capturing logs" argo=true
time="2024-05-09T01:09:26.070Z" level=info msg="capturing logs" argo=true
I0509 01:09:26.114461 42 launcher_v2.go:90] input ComponentSpec:{
"inputDefinitions": {
"parameters": {
"num1": {
"parameterType": "NUMBER_INTEGER"
},
"num2": {
"parameterType": "NUMBER_INTEGER"
}
}
},
"outputDefinitions": {
"parameters": {
"Output": {
"parameterType": "NUMBER_INTEGER"
}
}
},
"executorLabel": "exec-addition-component"
}
I0509 01:09:26.116617 42 cache.go:139] Cannot detect ml-pipeline in the same namespace, default to ml-pipeline.kubeflow:8887 as KFP endpoint.
I0509 01:09:26.116655 42 cache.go:116] Connecting to cache endpoint ml-pipeline.kubeflow:8887
I0509 01:09:26.358737 42 object_store.go:306] Cannot detect minio-service in the same namespace, default to minio-service.kubeflow:9000 as MinIO endpoint.
WARNING: The repository located at pypi.org is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host pypi.org'.
ERROR: Could not find a version that satisfies the requirement kfp==2.2.0 (from versions: none)
ERROR: No matching distribution found for kfp==2.2.0
I0509 01:09:28.199823 42 launcher_v2.go:151] publish success.
F0509 01:09:28.199935 42 main.go:49] failed to execute component: exit status 1
time="2024-05-09T01:09:29.074Z" level=info msg="sub-process exited" argo=true error="<nil>"
Error: exit status 1
time="2024-05-09T01:09:30.017Z" level=info msg="sub-process exited" argo=true error="<nil>"
Error: exit status 1
Code:
import kfp
from kfp import compiler
from kfp import dsl
@dsl.component(base_image='silverlogic/python3.8:latest', install_kfp_package=False, packages_to_install=['kfp==2.2.0'], pip_index_urls=['http://pypi.org/simple'])
def addition_component(num1: int, num2: int) -> int:
return num1 + num2
@dsl.pipeline(name='addition-pipeline')
def my_pipeline(a: int=1, b: int=2, c: int = 10):
add_task_1 = addition_component(num1=a, num2=b)
add_task_2 = addition_component(num1=add_task_1.output, num2=c)
cmplr = compiler.Compiler()
cmplr.compile(my_pipeline, package_path='my_pipeline.yaml')
HOST = "<host-name>"
USERNAME = "<user-name>"
PASSWORD = "<password>"
NAMESPACE = "kubeflow-user-example-com"
import requests
session = requests.Session()
response = session.get(HOST)
headers = {
"Content-Type": "application/x-www-form-urlencoded",
}
data = {"login": USERNAME, "password": PASSWORD}
session.post(response.url, headers=headers, data=data)
print (session.cookies.get_dict())
session_cookie = session.cookies.get_dict()["authservice_session"]
client=kfp.Client(host=f"{HOST}/pipeline",
cookies=f"authservice_session={session_cookie}",
namespace=NAMESPACE,)
client.create_run_from_pipeline_package('my_pipeline.yaml',arguments={"a":1,"b":2})
Environment
Using KFP as part of full Kubeflow Installation for on-prem RHEL server.
Python Version
Python 3.8.10
Kubeflow Version:
Kubeflow 1.8
KFP SDK Version Installed:
kfp 2.2.0
kfp-pipeline-spec 0.2.2
kfp-server-api 2.0.5
Expected Result
The pipeline component should run successfully.`
New contributor
Shaktee Biswal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.