Jordan Davie
04/26/2023, 11:03 AMrun_deployment
function is recommended. Is this still best practice?Ash
04/26/2023, 2:27 PMJustin Trautmann
04/26/2023, 3:14 PMload_flow_from_entrypoint
). As far as I could debug this, this is due to the fact that mlflow messes with the python logger (https://github.com/mlflow/mlflow/issues/4957) when being imported, removes all the handler and sets its own handlers. I am not sure why this problem didn't surface already with prefect <=2.9.0 but now with the reworked logging in 2.10 this is actually causing a deadlock.
It seems like during the removal of the handler, the QueueService
is drained (by putting None
in the _queue
, which should be picked up by the _main_loop
and cause the _done_event
to be set. But somewhere along this path, it gets stuck.
I am still trying to come up with a minimal reproducible example but would be very interested in some general best practices around dependencies that manipulate the python logger. I assume that this could happen with a lot more dependencies than just mlfow and I feel like prefect should be able to wrap any logger modifications by flow dependencies to ensure that logs are visible in the cloud.
ThanksGosia
04/26/2023, 3:37 PMYD
04/26/2023, 4:36 PMNathan Low
04/26/2023, 4:45 PMMatheus Rocha
04/26/2023, 6:35 PMdeployment.yaml
file is all empty as you can see on the 🧵
Is this file supposed to be filled with some informations such as work_pool?Yaron Levi
04/26/2023, 6:35 PMprefect deployment build jobs/test1/test1.py:test1 \
--name test1 \
--output jobs/test1/deployment \
--storage-block github/yuvital-prefect-github \
--pool test-pool \
--infra-block ecs-task/ecs-test-block
Meaning when the Work Pool Task poll for a new flow to run, it should also create a new ECS Task for that flow run.
Looking at the logs I can see that the work pool do get the new flow to run, but fails with:
Submission failed. KeyError: “No class found for dispatch key ‘ecs-task’ in registry for type ‘Block’.”Wei Hong Ho
04/26/2023, 7:57 PMdeployment.py
and doing deployment.apply()
has no errors. However I do not see the deployment on prefect deployment inspect
or the UI. To access to the UI, I exposed port 4200 on my ec2. I do see a webpage but there's an error box on the bottom right stating
Can't connect to Server API at <http://127.0.0.1:4200/api>. Check that it's accessible from your machine.
does anybody has any guide on how to do a local deployment of prefect on an ec2 instance?Sam Cook
04/26/2023, 8:03 PMChris Goddard
04/26/2023, 9:18 PMAvinash Santhanagopalan
04/26/2023, 9:50 PMMatt Alhonte
04/27/2023, 12:27 AMflows = subflow_starter.map(flow_args=flow_args, run_config_args=run_config_args, client=unmapped(client)
But I get this (below the fold)Leela Surya Teja Mangamuri
04/27/2023, 12:32 AMLeela Surya Teja Mangamuri
04/27/2023, 12:32 AMLeela Surya Teja Mangamuri
04/27/2023, 12:35 AMClaire Scott
04/27/2023, 1:18 AMTejaswi Bhangi
04/27/2023, 1:25 AMLeela Surya Teja Mangamuri
04/27/2023, 3:16 AMLeela Surya Teja Mangamuri
04/27/2023, 3:38 AMTaran Singh
04/27/2023, 4:07 AMTim Galvin
04/27/2023, 6:33 AMon_completion
and on_failure
hooks made available for tasks and flows. In the past I would put cleanup / success logic as a distinct task
in my pipeline. These tasks have their own loggers that would report some items.
The following is with regards to callbacks supplied to the on_completion
and on_failure
hooks of a flow.
What is the correct way of using the logging
module and a logger
object to emit info/warn messages that are also recorded by the prefect server? A logger = get_run_logger()
call in one of my on_completion
callback functions raised a context error, and print
statements with log_print=True
don't seem to be captured either.
I guess ultimately I am curious about whether these call back functions are extecuted within or outside a flow context.Giacomo Chiarella
04/27/2023, 6:41 AMAbhishek Mitra
04/27/2023, 7:16 AMUnhealthy
for that work-queue & pool and I don't know why.
And my flows are stuck in a Late
status. Can anybody suggest a way to fix this?
logs are fine:
___ ___ ___ ___ ___ ___ _____ _ ___ ___ _ _ _____
| _ \ _ \ __| __| __/ __|_ _| /_\ / __| __| \| |_ _|
| _/ / _|| _|| _| (__ | | / _ \ (_ | _|| .` | | |
|_| |_|_\___|_| |___\___| |_| /_/ \_\___|___|_|\_| |_|
Agent started! Looking for work from work pool 'dev-work-pool'...
Ash
04/27/2023, 8:26 AMFlow could not be retrieved from deployment.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/prefect/engine.py", line 276, in retrieve_flow_then_begin_flow_run
flow = await load_flow_from_flow_run(flow_run, client=client)
File "/usr/local/lib/python3.8/dist-packages/prefect/client/utilities.py", line 40, in with_injected_client
return await fn(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/prefect/deployments.py", line 195, in load_flow_from_flow_run
await storage_block.get_directory(from_path=deployment.path, local_path=".")
File "/usr/local/lib/python3.8/dist-packages/prefect/filesystems.py", line 147, in get_directory
copytree(from_path, local_path, dirs_exist_ok=True)
File "/usr/lib/python3.8/shutil.py", line 557, in copytree
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
File "/usr/lib/python3.8/shutil.py", line 513, in _copytree
raise Error(errors)
shutil.Error: [('/home/user/.prefect/prefect.db-shm', '/tmp/tmp791im88hprefect/.prefect/prefect.db-shm', "[Errno 2] No such file or directory: '/home/user/.prefect/prefect.db-shm'")]
Kasper Djernæs
04/27/2023, 9:00 AMDeceivious
04/27/2023, 9:21 AMPandas Dataframe
?
Some function to write the pd.Dataframe
into csv format before storage and read_csv
before getting from storage?Rahul Chittora
04/27/2023, 11:19 AMFlow could not be retrieved from deployment. Traceback (most recent call last): File "<frozen importlib._bootstrap_external>", line 839, in exec_module File "<frozen importlib._bootstrap_external>", line 975, in get_code File "<frozen importlib._bootstrap_external>", line 1032, in get_data FileNotFoundError: [Errno 2] No such file or directory: 'ecs_task_script.py' The above exception was the direct cause of the following exception: ScriptError: Script at 'ecs_task_script.py' encountered an exception: FileNotFoundError(2, 'No such file or directory')
Rahul Chittora
04/27/2023, 11:19 AMRahul Chittora
04/27/2023, 11:19 AM