Package: hayhooks
HayhooksTable of ContentsHayhooksQuick startInstall the packageCheck Hayhooks statusDeploy a Haystack pipelineHave a look at the API schemaRun the pipelineUndeploy the pipelineDocker setupNext stepsLicenseQuick startInstall the packageStart by installing the package:pip install hayhooksThehayhookspackage ships both the server and the client component, and the client is capable of starting the
server. From a shell, start the server with:$hayhooksrunINFO:     Started server process [44782]INFO:     Waiting for application startup.INFO:     Application startup complete.INFO:     Uvicorn running on http://localhost:1416 (Press CTRL+C to quit)Check Hayhooks statusFrom a different shell, you can query the status of the server with:$hayhooksstatusHayhooks server is up and running.Deploy a Haystack pipelineTime to deploy a Haystack pipeline. The pipeline must be in Yaml format (the output ofpipeline.dump()), if you don't have one at hand, you can use
one from this repository. From the root of the repo:$hayhooksdeploytests/test_files/test_pipeline_01.ymlPipeline successfully deployed with name: test_pipeline_01Another call tostatusshould confirm your pipeline is ready to serve requests:$hayhooksstatusHayhooks server is up and running.Pipelines deployed:- test_pipeline_01Have a look at the API schemaHayhooks will use introspection to set up the OpenAPI schema accordingly to the inputs and outputs of your pipeline,
and to see how this works let's get the pipeline diagram with:$curlhttp://localhost:1416/draw/test_pipeline_01--outputtest_pipeline_01.pngThe downloaded image should look like this:As you can see, the pipeline in order to start requires an input of typeintnamedvalue, and optionally we can
pass another input of typeintnamedadd. At the end of the run, the pipeline will return an output of typeintnamedresult.If you open a browser athttp://localhost:1416/docs#/you should see two schemas, one
for the Request, where we'll pass the pipeline inputs (note howaddis optional):Test_pipeline_01RunRequest
    first_addition
        value* integer
        add (integer | null)And another one for the Response, where we'll receive the pipeline results:Test_pipeline_01RunResponse
    double
        value* integerRun the pipelineAt this point, knowing the schema we can run our pipeline with an HTTP client:$curl-X'POST'\'http://localhost:1416/test_pipeline_01'\-H'accept: application/json'\-H'Content-Type: application/json'\-d'{"first_addition": {"value": 19}}'{"double":{"value":42}}%Undeploy the pipelineHayhooks tries to to as much bookkeeping as possible without restarting the server. For example, to free up
resources you can undeploy the pipeline directly from the client:$hayhooksundeploytest_pipeline_01Pipeline successfully undeployedDocker setupInstead of launching the server in a separate shell like we did in the Quick Start, you can run it in a Docker
container using theDockerfilefrom this repo. First, build the image locally:$dockerbuild.-thayhooks...Then run it in background:$dockerrun--rm-p1416:1416hayhooks...Next stepsAt this stage Hayhooks is just a prototype, the natural next steps would be:Improve server configuration management (easy)Add CLI configuration profiles, so it's easy to address different servers (easy)Manage pipeline dependencies: one way could be adding the required packages in the pipeline's metadata and let the
server handle installation (complex)Licensehayhooksis distributed under the terms of theApache-2.0license.