Update a Custom Component
To update custom components, upload their new version to Haystack Enterprise Platform. Compare different component versions to evaluate them.
You must be an organization Admin to upload custom components to Haystack Enterprise Platform.
Update a Component
To update a custom component:
- Pull the latest version of the dc-custom-component-template repository.
- Update the component code in the
./dc-custom-component-template/src/dc_custom_component/components/<your_components_folder>/<custom_component>.pyfile. - Update the component version in the
./dc-custom-component-template/src/dc_custom_component/__about__.pyfile.
You can check the version of the component that's currently in Haystack Enterprise Platform in Pipeline Builder. Drag your custom component onto the canvas and its version is displayed on the component card.
You can also use the Get Custom Components endpoint - the version is listed in the version parameter of a successful response.
- If the component has any dependencies, add them in the
dependenciessection of the./dc-custom-component-template/pyproject.tomlfile. Do not modify versions of dependencies already listed in this file. - Upload your component to Haystack Enterprise Platform..
All new pipelines automatically use the latest version of your custom components. However, running pipelines continue to use the version that was current when they were deployed. To update the component version in running pipelines, undeploy and redeploy them.
Pin a Custom Component Version in a Pipeline
A pipeline that doesn't pin a version gets the latest version of your custom components when its pod starts. To keep a pipeline on a specific version, pin it in the dependencies block of the pipeline YAML. The pin decides which version the pipeline runs, so publishing a new version doesn't change a pipeline that pins an older one, and you don't need to restart pods. This applies to pipelines that run on fleet workers. On runtime 4.0.19 and older, pipelines that don't run on fleet workers also install the latest version next to the pin.
You can pin only a version that was uploaded to your organization and whose upload has finished.
-
Upload the version you want to use and wait until the upload finishes. For details, see Upload a Custom Component.
-
Open the pipeline in Builder and switch to the YAML view.
-
In the top-level
dependenciesblock, add the custom component with an exact==pin. To find the version you uploaded, check__about__.pyor the component card in Builder:dependencies:- haystack-ai==2.31.0- dc-custom-component==0.0.138 -
Save and deploy the pipeline. Validation checks the pin on validate, save, and deploy. If it rejects the pin, see Fix Pin Validation Errors.
To go back to the latest version, remove the dc-custom-component line from dependencies and redeploy the pipeline.
Fix Pin Validation Errors
Validation rejects a custom component pin in these cases:
- The requirement isn't one exact pin. Use a single
==version, for exampledc-custom-component==1.2.3. Version ranges,===, extras, and environment markers aren't accepted, and neither is a requirement without a version. - The version isn't published for your organization, or its upload hasn't finished. Pin a version whose upload has finished. To check which versions exist, see the version in the Get Custom Components response.
Pins aren't supported when you deploy a code bundle.
Compare Different Component Versions
To evaluate which version of your component performs better in a pipeline, you can upload two versions of the component simultaneously, each with a unique name.
- Pull the latest version of the dc-custom-component-template repository.
- Add two versions of the component to the
./dc-custom-component-template/src/dc_custom_component/components/<your_component_folder>/<your_component_name>.pyfile, treating them as separate components and giving each version a distinct name. - Update the component version in the
./dc-custom-component-template/src/dc_custom_component/__about__.pyfile. - Upload your components to Haystack Enterprise Platform..
Now, you can create two pipelines—one using the first version and another using the second—to compare their performance.
Was this page helpful?