Jessica Smith
02/04/2023, 10:03 PMSurawut Jirasaktavee
02/05/2023, 7:47 AMJessica Smith
02/05/2023, 5:37 PMprefect deployment
that are not covered in the docs? I just spent 30 or so minutes trying to figure out how to provide parameters to the deployment.yaml file without having to manually edit it (which is all I found in the docs). Turns out it is simple, you can use --param
, but that wasn't in the docs anywhere as far as I can see.Yaron Levi
02/05/2023, 7:07 PMTony Alfonse
02/06/2023, 1:33 AMfrom prefect.orion.schemas.sorting import FlowRunSort
from prefect.orion.schemas.filters import FlowFilter, FlowFilterId,FlowRunFilterStartTime
flow_run = await client.read_flow_runs(
limit=1,
sort=FlowRunSort.START_TIME_DESC,
flow_filter=FlowFilter(
id=FlowFilterId(any_=[flow_id])
)
Any leads on how I can make sure the result I get is for today's last execution? I can't find anything in the documentation or maybe I am missing something here.Dylan Lim
02/06/2023, 3:51 AMimport_paths
in Orion like how you would do so in Prefect 1.0?
My flows need to import functions from another folder in my source code and it’s unable to find it when I run the agent.Rikimaru Yamaguchi
02/06/2023, 6:32 AMLeonardus Chen
02/06/2023, 7:26 AMprefect.context.get("scheduled_start_time")
in Prefect 2.0? FlowRunContext.start_time
seems to return the actual start time of the flow instead of the scheduled start time. If there isn't, is there a way to get the scheduled start time of a flow during runtime?Emma Rizzi
02/06/2023, 8:13 AMpip install prefect
generated automatically while building the flows : Getting requirements to build wheel did not run successfully
error stack in thread!Alex
02/06/2023, 9:42 AMfrom __prefect_loader__ import CustomBlockName
But I get an error: ModuleNotFoundError: No module named '__prefect_loader__'
How can I fix it?Santiago Toso
02/06/2023, 9:43 AMprefect 2.7.11
and I'm now getting an error when trying to deploy from the same deployment.py
files I've been using all along. It seems to have a problem when executing the apply
command in the file.
Any ideas what could be going on? Thanks for your help!
I leave the full message here:
Traceback (most recent call last):
File "/home/jupyter-santiago/repos/via_ds_amm_gtfs_real_time_tools/valhalla_map_matching/deployments/python/tfl_deployment.py", line 26, in <module>
deployment.apply()
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 230, in coroutine_wrapper
return run_async_in_new_loop(async_fn, *args, **kwargs)
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 181, in run_async_in_new_loop
return anyio.run(partial(__fn, *args, **kwargs))
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/site-packages/anyio/_core/_eventloop.py", line 70, in run
return asynclib.run(func, *args, **backend_options)
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 292, in run
return native_run(wrapper(), debug=debug)
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
return await func(*args)
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/site-packages/prefect/deployments.py", line 651, in apply
deployment_id = await client.create_deployment(
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/site-packages/prefect/client/orion.py", line 1347, in create_deployment
response = await <http://self._client.post|self._client.post>(
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/site-packages/httpx/_client.py", line 1848, in post
return await self.request(
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/site-packages/httpx/_client.py", line 1533, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/site-packages/prefect/client/base.py", line 253, in send
response.raise_for_status()
File "/home/jupyter-santiago/miniconda3/envs/prefect-gtfs/lib/python3.10/site-packages/httpx/_models.py", line 749, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '409 Conflict' for url '<http://10.90.64.221:4200/api/deployments/>'
Lachlan Casey
02/06/2023, 11:59 AMprefect block register -m prefect_docker
I only get the docker host and docker registry details blocks in the UI. How do i get the docker container block?jcozar
02/06/2023, 12:37 PMjpuris
02/06/2023, 12:43 PM0 * * * * docker compose -f /some/path/docker-compose.yml run --rm my_service my_command
the docker-compose.yml
version: '3.8'
services:
my_service:
build: app/.
env_file:
- app/.env
logging:
driver: journald
How can I tell prefect to create a deployment to
• run a container with a pre-defined image (I want to build it separately.. the docker-compose currently takes care of that)
• load .env file into the container's envs
• run specified my_cmd
(entry-point's args)
All I really need is some sort of reference material of building such deployment 🤷Ton Steijvers
02/06/2023, 1:01 PMTask run '40d8d867-e54c-47dc-b098-a37e17d5dff0' received abort during orchestration: Error validating state: DBAPIError("(sqlalchemy.dialects.postgresql.asyncpg.Error) <class 'asyncpg.exceptions.QueryCanceledError'>: canceling statement due to statement timeout") Task run is in RUNNING state.
It occurs randomly during task executions and results in the flow getting terminated in a Failed state. Happened twice over last weekend with the flow being scheduled to run every 15 minutes.
What is causing this error, and is there something that can be done on our side?Nils
02/06/2023, 1:28 PMRuntimeError: Tasks cannot be run outside of a flow
? The parse
function is a task.
with ThreadPoolExecutor() as executor
res = [executor.submit(parse, root, n) for n in range(0, table_count, 5)]
data = [r.result() for r in as_completed(res)]
scott
02/06/2023, 2:35 PMAleksandr Liadov
02/06/2023, 3:55 PMconcurrent.futures._base.CancelledError
I see that my cluster hasn’t any problem to create over 50 pods simultaneously.
Queue concurrency limit is 500.
Stack trace in thread.
PS:
Does it rely that during transition phase to Prefect2 I used free cloud account? (if yes where can I can see limits)Nimesh Kumar
02/06/2023, 4:11 PMfrom prefect.deployments import Deployment
import requests
deploy = Deployment.build_from_flow(flow=start_inferencing, name="api deployment", work_queue_name="testing")
id_ = deploy.apply()
print("This is Deployment ID", id_)
def create_flow_run(deployment_id: str, base_url="<http://IP:4200/api>"):
print(f"{base_url}/deployments/{deployment_id}/create_flow_run")
return <http://requests.post|requests.post>(
url=f"{base_url}/deployments/{deployment_id}/create_flow_run",
json={
"name": "trigger using api",
"state": {"type": "SCHEDULED"},
"parameters": {"my_param": "bef5f437-49b7-43ec-aac8-a8b4747cb67b", "file_path": "root/flows/tmp_folder"},
},
)
r = create_flow_run(id_)
print(r.status_code)
print(r.text)
When i try to open base url i.e. http://IP:4200 it open but this code throws me a error saying deployment not found, but i guess the whole point of this code is to create a deployment and then run the flow.
404
{"detail":"Deployment not found"}
can anyone please help, what i am doing wrong.Leon Kozlowski
02/06/2023, 4:47 PMJessica Smith
02/06/2023, 5:16 PMwait_for
, because without that the tasks in the Finally block ran immediately. But with wait_for
, the tasks in the Finally block do not run if something has failed.Vishnu Duggirala
02/06/2023, 9:15 PMState message: Flow run encountered an exception. Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/httpcore/backends/asyncio.py", line 34, in read
return await self._stream.receive(max_bytes=max_bytes)
File "/usr/local/lib/python3.8/site-packages/anyio/streams/tls.py", line 195, in receive
data = await self._call_sslobject_method(self._ssl_object.read, max_bytes)
File "/usr/local/lib/python3.8/site-packages/anyio/streams/tls.py", line 137, in _call_sslobject_method
data = await self.transport_stream.receive()
File "/usr/local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 1265, in receive
await self._protocol.read_event.wait()
File "/usr/local/lib/python3.8/asyncio/locks.py", line 309, in wait
await fut
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
yield
File "/usr/local/lib/python3.8/site-packages/httpcore/backends/asyncio.py", line 36, in read
return b""
File "/usr/local/lib/python3.8/site-packages/anyio/_core/_tasks.py", line 118, in __exit__
raise TimeoutError
TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
yield
File "/usr/local/lib/python3.8/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
raise exc
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
response = await connection.handle_async_request(request)
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/connection.py", line 90, in handle_async_request
return await self._connection.handle_async_request(request)
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/http11.py", line 112, in handle_async_request
raise exc
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/http11.py", line 91, in handle_async_request
) = await self._receive_response_headers(**kwargs)
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/http11.py", line 155, in _receive_response_headers
event = await self._receive_event(timeout=timeout)
File "/usr/local/lib/python3.8/site-packages/httpcore/_async/http11.py", line 191, in _receive_event
data = await self._network_stream.read(
File "/usr/local/lib/python3.8/site-packages/httpcore/backends/asyncio.py", line 36, in read
return b""
File "/usr/local/lib/python3.8/contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.8/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc)
httpcore.ReadTimeout
The above exception was the direct cause of the following exception:
httpx.ReadTimeout
Ethienne Marcelin
02/06/2023, 10:16 PMparent_task_id
keys of the FlowRun
object pointing to ? It doesn't seem to point to a FlowRun uuid or a Flow uuid 🤔 ?Guy Altman
02/06/2023, 11:10 PMVasimhasina S
02/07/2023, 4:50 AMTadej Svetina
02/07/2023, 8:24 AMTolga Karahan
02/07/2023, 10:15 AMMike O'Connor
02/07/2023, 10:24 AMproduction
, auto-scheduled
, should we be expecting it to run for any flow tagged production
, or only those both auto-scheduled
and production
?
It appears to be that either tag will trigger it, which is not what i was aiming forMalavika S Menon
02/07/2023, 10:26 AMTimeoutError FlowRunNotifications took 5.071013 seconds to run, which is longer than its loop interval of 4 seconds.
Why exactly is this happening and how can this be avoided?Tadej Svetina
02/07/2023, 10:38 AMasyncio.sleep
in between. How can I make it so that the subflow gets cancelled too?