Deploy a Pipeline

After you create and save a pipeline, you must deploy it to use it for search. Deploying a pipeline triggers indexing of your files making them ready to be searched on.

📘

You must be an Admin user to perform this task.

Deploy a Pipeline from the UI

  1. In deepset Cloud, click Pipelines.
  2. Click Deploy next to a pipeline.
    The pipeline is moved to Deployed and the deployment starts. Hover your mouse over the pipeline status to see how many files have already been indexed. Once indexing is done, the status changes to Indexed.

Deploy a Pipeline with the Python SDK

Here's the code that deploys a pipeline. You can also run it from Jupyter Notebooks within deepset Cloud.

You need to Generate an API Key first.

# The first five lines are all the necessary imports to make it work
from haystack.utils import DeepsetCloud
from pathlib import Path

# Set the API key and API endpoint:
os.environ["DEEPSET_CLOUD_API_KEY"] = "<your API key>"
os.environ["DEEPSET_CLOUD_API_ENDPOINT"] = "https://api.cloud.deepset.ai/api/v1"

# let's deploy the pipeline to start indexing:
Pipeline.deploy_on_deepset_cloud(pipeline_config_name=my_pipeline_name)

Deploy a Pipeline with the REST API

Here's the code you can use. If you need more information about this endpoint, see Deploy Pipeline API.

You need to Generate an API Key first.

curl --request POST \
     --url https://api.cloud.deepset.ai/api/v1/workspaces/<workspace_name>/pipelines/<pipeline_name>/deploy \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer <your_API_key>'
     

What To Do Next

It may happen that the deployment fails and the pipeline status is failed to deploy. This status means the files were not indexed and the pipeline wasn't deployed. If you encounter this error, you need to take some troubleshooting action.


Related Links