from kfp.registry import RegistryClient
client = RegistryClient(host=f"https://europe-west3-kfp.pkg.dev/{project_id}/{registry}")
templateName, versionName = client.upload_pipeline(
file_name="compiled_pipeline.yaml",
tags=["v1", "latest"],
extra_headers={"description":"This is an example pipeline template."})
The above code is from the official GCP Documentation for uploading kfp pipelines for Vertex AI in artifactory. When I run the code it returns error:
Traceback (most recent call last):
File "/Users/chochobossa/Development/{project}/test-kfp.py", line 35, in <module>
templateName, versionName = client.upload_pipeline(
File "/Users/chochobossa/Library/Python/3.9/lib/python/site-packages/kfp/registry/registry_client.py", line 352, in upload_pipeline
response.raise_for_status()
File "/Users/chochobossa/Library/Python/3.9/lib/python/site-packages/requests/models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://europe-west3-kfp.pkg.dev/{project}/{registry}
The pipeline yaml file is in the same directory where the script is being ran.
Artefact Repository Admin role is granted to the user running the script.