When calling `Deployment.build_from_flow()` how do...
# ask-community
j
When calling
Deployment.build_from_flow()
how do we specify a work pool? The docstring for
Deployment
shows a
work_queue
keyword argument but not one for
work_pool
. The docs for work queues say that work queues are an advanced topic. Are we to used work queues or work pools to get certain deployments to be run by certain agents? Using prefect 2.8.4
r
You should just be able to pass in work_pool_name='bla' - docs possibly slow to be updated
🙌 1
j
Ah...the docstring has not been updated to match the function definition.
j
So I changed from
Copy code
Deployment.build_from_flow(work_queue_name='some-queue')
to
Copy code
Deployment.build_from_flow(work_pool_name='some-queue')
and redeployed to a new version number and kicked off a flow-run, but in the UI it still shows
work_queue_name='some-queue'
r
not tried it myself, can you try a new deployment?
j
I changed the name of the flow and redeployed, then kicked off a flow-run. This time the work_queue_name shows up as
default
as expected.
r
with the pool?
j
I changed the name of the flow, then redployed as
Copy code
Deployment.build_from_flow(work_pool_name='some-queue')
In the UI it now shows
default
for work_queue_name, as expected. Unfortunately, the UI does not show the
work_pool_name
at all.
r
if self.work_queue_name and work_queue_concurrency is not None:
try:
res = await client.create_work_queue(
name=self.work_queue_name, work_pool_name=self.work_pool_name
)
except ObjectAlreadyExists:
res = await client.read_work_queue_by_name(
name=self.work_queue_name, work_pool_name=self.work_pool_name
)
await client.update_work_queue(
res.id, concurrency_limit=work_queue_concurrency
)
looks to me like the queue needs concurrency
then it will create with the pool
but it doesnt add up as the ui states the queue & pool are optional
but looks like pool needs a queue (for python)