https://prefect.io logo
Title
j

Jens

04/14/2023, 3:34 PM
Hi Community, I'm trying to create a deployment over the client-api. The Code looks like the following
async def deploy_ki_pipeline_controller():
    logger = get_run_logger()
    async with get_client() as client:
        flow_id: UUID = await client.create_flow(infere_pipeline_handler_flow)
        <http://logger.info|logger.info>(f"Der Flow infere_pipeline_handler_flow wurde erfolgreich mit der UUID {flow_id} erstellt")
        params = {
            "watch_folder_path" : "test",
            "dead_letter_path": 'test/dead_letter',
            "on_success_move_path": 'test/bearbeitet',
            "lego_api_url": 'test/annehmen',
            "lego_api_user": 'test',
            "log2File": False,
            "logging_file_path": 'test',
            "dry_run_api": False,
            "dry_run_clean": False,
            "delete_on_success": True,
            "create_images": False,
            "extended_logs": False,
            "extended_anonym_error_logs": True
        }
        deployment_id: UUID = await client.create_deployment(
            flow_id=flow_id,
            name="infere_pipeline_handler_deployment",
            storage_document_id="5bf39961-0f81-4a4b-9751-2d7e132066a8",
            parameters=params,
            work_pool_name="first-worker-pool",
            work_queue_name="test-queue-master",
            parameter_openapi_schema=params,
            entrypoint="prefect_module/flows/infere_pipeline_handler_flow.py:infere_pipeline_handler_flow",
        )
All works fine, the flow and the deployment are created and I can access it via the prefect UI. But the parameters for the deployment are empty Is there a step I'm missing or I do something wrong here?
👀 1
c

Chris White

04/17/2023, 7:39 PM
Hi Jens! Yes, you are missing a proper
parameter_openapi_schema
- the parameters themselves do not constitute a valid openAPI schema. You can see how we do this in the public methods for building deployments here: https://github.com/PrefectHQ/prefect/blob/main/src/prefect/deployments.py#L771