A usage question regarding gitlab repository being a block for flow code during deployment…
I have Prefect 2.0 installed on AKS cluster with kubernetes agent.
Prefect gitlab collection is installed using cline
prefect block register -m prefect_gitlab
the block is registered with UI and appears in the output of the command
prefect block ls
with the slug gitlab-repository/gitlab-repo
During deployment run on the queue connected to the agent i see the following exception
Flow could not be retrieved from deployment.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/prefect/engine.py", line 266, in retrieve_flow_then_begin_flow_run
flow = await load_flow_from_flow_run(flow_run, client=client)
File "/usr/local/lib/python3.10/site-packages/prefect/client/utilities.py", line 47, in with_injected_client
return await fn(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/prefect/deployments.py", line 166, in load_flow_from_flow_run
storage_block = Block._from_block_document(storage_document)
File "/usr/local/lib/python3.10/site-packages/prefect/blocks/core.py", line 548, in _from_block_document
File "/usr/local/lib/python3.10/site-packages/prefect/blocks/core.py", line 568, in get_block_class_from_schema
return lookup_type(cls, block_schema_to_key(schema))
File "/usr/local/lib/python3.10/site-packages/prefect/utilities/dispatch.py", line 186, in lookup_type
KeyError: "No class found for dispatch key 'gitlab-repository' in registry for type 'Block'."
here’s the deployment snippet connected to the block
I’ve been trying to see in the code how that magic setting works that was added to the latest release
Basically, it should register modules from the collections - based on the documentation gitlab collection should be added to Orion docker image, trying to play around with debug settings to see if I see that import piece appear in logs. But it was weird that I don’t see gitlab in the list of default modules in UI - maybe it was not included in the Orion build