Ashley Felber
01/12/2023, 11:25 PMSlackbot
01/13/2023, 10:29 AMEmma Rizzi
01/13/2023, 1:27 PMprefect agent kubernetes start
and i am trying to migrate to prefect agent kubernetes install
to generate a yaml file. I use the --job-template option which is not available with agent *install*, is there a workaround ?Idan
01/13/2023, 1:55 PMSamuel Kohlleffel
01/13/2023, 2:27 PM13:39:09.646 | INFO | prefect.agent - Submitting flow run '64c00c09-07a6-495b-ada4-a4088e122434'
13:39:09.647 | INFO | prefect.agent - Submitting flow run 'beb26192-33fb-4988-985b-b497c35573f0'
13:39:10.205 | INFO | prefect.infrastructure.kubernetes-job - Job 'bright-leech-f77cl': Pod has status 'Pending'.
13:39:10.208 | INFO | prefect.infrastructure.kubernetes-job - Job 'gleaming-griffin-w55qm': Pod has status 'Pending'.
13:39:10.240 | INFO | prefect.agent - Completed submission of flow run '64c00c09-07a6-495b-ada4-a4088e122434'
13:39:10.245 | INFO | prefect.agent - Completed submission of flow run 'beb26192-33fb-4988-985b-b497c35573f0'
13:39:11.736 | INFO | prefect.infrastructure.kubernetes-job - Job 'bright-leech-f77cl': Pod has status 'Running'.
13:39:11.912 | INFO | prefect.infrastructure.kubernetes-job - Job 'gleaming-griffin-w55qm': Pod has status 'Running'.
13:39:24.462 | ERROR | prefect.agent - An error occured while monitoring flow run '92139cd4-23df-4396-9150-9804a17968d6'. The flow run will not be marked as failed, but an issue may have occurred.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/urllib3/response.py", line 761, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/urllib3/response.py", line 444, in _error_catcher
yield
File "/usr/local/lib/python3.10/site-packages/urllib3/response.py", line 828, in read_chunked
self._update_chunk_length()
File "/usr/local/lib/python3.10/site-packages/urllib3/response.py", line 765, in _update_chunk_length
raise InvalidChunkLength(self, line)
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/prefect/agent.py", line 417, in _submit_run_and_capture_errors
result = await infrastructure.run(task_status=task_status)
File "/usr/local/lib/python3.10/site-packages/prefect/infrastructure/kubernetes.py", line 277, in run
return await run_sync_in_worker_thread(self._watch_job, job_name)
File "/usr/local/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 69, in run_sync_in_worker_thread
return await anyio.to_thread.run_sync(call, cancellable=True)
File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/usr/local/lib/python3.10/site-packages/prefect/infrastructure/kubernetes.py", line 527, in _watch_job
for log in logs.stream():
File "/usr/local/lib/python3.10/site-packages/urllib3/response.py", line 624, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/usr/local/lib/python3.10/site-packages/urllib3/response.py", line 816, in read_chunked
with self._error_catcher():
File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.10/site-packages/urllib3/response.py", line 461, in _error_catcher
raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
13:39:29.507 | ERROR | prefect.infrastructure.kubernetes-job - Job 'gleaming-griffin-w55qm': Job did not complete.
13:39:29.511 | ERROR | prefect.infrastructure.kubernetes-job - Job 'bright-leech-f77cl': Job did not complete.
Jon
01/13/2023, 2:52 PMRob Douglas
01/13/2023, 4:03 PMupstream_task
succeeded. Am I on the right track? I've been poking around for a tutorial or example, but am having trouble finding much in the way of examples of any_successful
@task(trigger=any_successful)
def bar(upstream_tasks):
# get the first upstream_task that succeeded
gratitude thank you in advance for any insights you might haveLeon Kozlowski
01/13/2023, 4:46 PMparameter_defaults
(example below)
abc = IntervalClock(
start_date=pendulum.datetime(2022, 1, 12, 3, 30, 0, tz="America/New_York"),
interval=datetime.timedelta(hours=24),
parameter_defaults={"mart": "abc"},
)
xyz = IntervalClock(
start_date=pendulum.datetime(2022, 1, 12, 3, 30, 0, tz="America/New_York"),
interval=datetime.timedelta(hours=24),
parameter_defaults={"mart": "xyz"},
)
Is there a way have a flow use multiple schedules + to pass parameter_defaults
to a schedule in prefect 2.0?Joshua Grant
01/13/2023, 6:42 PMAttributeError: 'unmapped' object has no attribute 'get'
when using a .map()
on a task. I'm passing a dict
. Upstream flows that unmap this object does not throw any error. Any thoughts on what a solution could be?Eric Ellsworth
01/13/2023, 7:00 PMNick Coy
01/13/2023, 7:07 PMFlorian Kühnlenz
01/13/2023, 7:23 PMSamuel Kohlleffel
01/13/2023, 8:35 PM20:20:14.675 | INFO | prefect.agent - Found 1 flow runs awaiting cancellation.
20:20:14.675 | ERROR | prefect.agent - Flow run 'da1b2a10-0a7a-48a1-98c3-25f92f3be5a8' does not have an infrastructure pid attached. Cancellation cannot be guaranteed.
What do I need to do to attach a PID to the flow object?
Also important to note, I had to add a cluster role to my K8s Prefect service account to get Prefect 2.7.8 to work. I couldn't find this requirement outlined anywhere in the docs. I could have just missed it. https://github.com/PrefectHQ/prefect/issues/7842.Joshua Grant
01/13/2023, 9:00 PMSiva Balusu
01/13/2023, 10:31 PMscott
01/13/2023, 11:18 PMConcurrentTaskRunner
/`DaskTaskRunner` /`RayTaskRunner` vs. using some combination of async tasks and/or async subflows? Any tips?Guy Altman
01/14/2023, 4:13 AMLucien Fregosi
01/14/2023, 11:15 AMtrigger_dbt_cli_command()
)
prefect.exceptions.MissingResult: State data is missing. Typically, this occurs when result persistence is disabled and the state has been retrieved from the API.
The weird thing is
• I didn’t restart the job it a basic scheduled jobs
• It worked well before upgrading to 2.7.6
• I added the flag PREFECT_RESULTS_PERSIST_BY_DEFAULT: true
but no effectNelson Griffiths
01/14/2023, 6:36 PMYaron Levi
01/15/2023, 1:47 PMParwez Noori
01/15/2023, 3:52 PMNimesh Kumar
01/15/2023, 5:23 PMWill Truong
01/16/2023, 4:10 AMUnicodeEncodeError: 'charmap' codec can't encode characters in position 13-14: character maps to <undefined>
I think it would be the same problem with this one:
https://github.com/PrefectHQ/prefect/issues/5754
Thank you for your help!
Encountered exception during execution:
Traceback (most recent call last):
File "D:\python\lib\site-packages\prefect\engine.py", line 1445, in orchestrate_task_run
result = await run_sync(task.fn, *args, **kwargs)
File "D:\python\lib\site-packages\prefect\utilities\asyncutils.py", line 154, in run_sync_in_interruptible_worker_thread
async with anyio.create_task_group() as tg:
File "D:\python\lib\site-packages\anyio\_backends\_asyncio.py", line 662, in __aexit__
raise exceptions[0]
File "D:\python\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "D:\python\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "D:\python\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
result = context.run(func, *args)
File "D:\python\lib\site-packages\prefect\utilities\asyncutils.py", line 135, in capture_worker_thread_and_result
result = __fn(*args, **kwargs)
File "C:\Users\WILLTR~1\AppData\Local\Temp\tmpdl74duviprefect\prefect_test.py", line 106, in st1_extract_order_data
print('Client: ' + shop_name)
File "D:\python\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 13-14: character maps to <undefined>
Tim Galvin
01/16/2023, 5:20 AMdask_jobqueue
. It makes sense to me to avoid a whole new set of requests when resources have already been allocated for the blocked parent flow.Karthik Anavarth
01/16/2023, 5:39 AMjpuris
01/16/2023, 7:29 AMLucien Fregosi
01/16/2023, 8:22 AMtrigger_dbt_cli_command()
)
prefect.exceptions.MissingResult: State data is missing. Typically, this occurs when result persistence is disabled and the state has been retrieved from the API.
The weird thing is
• I didn’t restart the job it a basic scheduled jobs
• It worked well before upgrading to 2.7.6
• I added the flag PREFECT_RESULTS_PERSIST_BY_DEFAULT: true
but no effectJens
01/16/2023, 8:43 AMIgor Morgunov
01/16/2023, 11:56 AMgithub_block = GitHub.load("XXXXXX")
cluster_config_block = KubernetesClusterConfig.load("data-engineering")
k8s = KubernetesJob(
cluster_config=cluster_config_block
)
deployment = Deployment.build_from_flow(
flow=test,
name="test",
version="0.0.1",
tags={"from-python-object"},
parameters={"name": "test-run"},
infra_overrides={"env": {"PREFECT_LOGGING_LEVEL": "DEBUG"}},
work_queue_name="test",
infrastructure=k8s,
storage=github_block,
)
if __name__ == "__main__":
result = deployment.apply()
Hamza Kazmi
01/16/2023, 12:00 PMWARNING: prefect 2.0.0 does not provide the extra 'aws'
WARNING: prefect 2.0.0 does not provide the extra 'google'
WARNING: prefect 2.0.0 does not provide the extra 'snowflake'
WARNING: prefect 2.0.0 does not provide the extra 'viz'
When doing :
pip install "prefect[aws,google,snowflake,viz]==2.0.0"
am i doing something wrong ?