Elliott Wilson
07/10/2023, 3:49 PMBraun Reyes
07/10/2023, 8:00 PM--interval 600 --timezone America/Los_Angeles --anchor-date 2023-06-27T01:00:00Z
results in this schedule in UI
Daily from Jun 26th, 2023 at 080000 PM (America/Los_Angeles)Maurreen Skowran
07/10/2023, 8:14 PMKenneth
07/10/2023, 8:15 PMname
or id
?Brennan Tolman
07/10/2023, 8:30 PMKyle
07/10/2023, 10:30 PMi get AttributeError: 'list' object has no attribute 'submit' because of the multiple tasks
@task
def task1(item: str):
# make api call; save data
return featherfilepath
@task
def task2(item: str):
# process stats; save data
return featherfilepath
@flow # flowrun task1
def map_task1():
# get list of items to process; convert to list
items = feather_instance.get("items")
items = items['name'].tolist()
# map a task to each item in the list; run concurrently
task1_multiple = task1.map(item=items)
@flow # flowrun task2
def map_task2():
# get list of items to process; convert to list
items = feather_instance.get("items")
items = items['name'].tolist()
# map a task to each item in the list; run concurrently
task2_multiple = task2.map(item=items)
@flow
def flowrun():
# api calls; cache from feather for one hour
task1 = map_task1().submit()
# process ta after all klines are saved to feathers
task2 = map_task2().submit(wait_for=[task1])
if __name__ == "__main__":
flowrun()
Kyle
07/10/2023, 10:52 PM@flow(task_runner=ConcurrentTaskRunner())
def map_task1():
@flow(task_runner=ConcurrentTaskRunner())
def map_task2():
@flow(task_runner=SequentialTaskRunner())
def flowrun():
Sarhan
07/11/2023, 12:27 AMFlow run could not be submitted to infrastructure
.
My Prefect is using ECS as infra basically following this (I’m new to using Terraform & ECS btw). We’ve been using this set up since the beginning of the year but the crashes started happening out of nowhere ~16 hours ago. Any advice welcome.Matt Alhonte
07/11/2023, 1:14 AMRasmus Lindqvist
07/11/2023, 7:44 AMprefect.exceptions.ScriptError: Script at 'src/flows/flow.py' encountered an exception: FileNotFoundError(2, 'No such file or directory')
We are using a monorepo where the prefect code sits in a subdirectory called “pipeline”. For deployment I am using the python SDK as such:
deployment = Deployment.build_from_flow(
flow=flow,
name=target_env,
version=3,
path="pipeline",
work_queue_name=target_env,
tags=[target_env],
infrastructure=infrastructure_block,
storage=storage_block,
)
As mentioned it was working in my other environment when I did not use a subdirectory and did not provide a path. I have searched thoroughly in discourse, Slack, documentation and in the source code it self, but am running out of options.
Does anyone see an error with the deployment or have suggestions on resources I can follow to get it working?Khyaati Jindal
07/11/2023, 9:23 AMTraceback (most recent call last):
File "/home/cubeserver/contact-management-notifications/env/lib/python3.10/site-packages/prefect/cli/_utilities.py", line 41, in wrapper
return fn(*args, **kwargs)
File "/home/cubeserver/contact-management-notifications/env/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 255, in coroutine_wrapper
return call()
File "/home/cubeserver/contact-management-notifications/env/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 383, in __call__
return self.result()
File "/home/cubeserver/contact-management-notifications/env/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 283, in result
return self.future.result(timeout=timeout)
File "/home/cubeserver/contact-management-notifications/env/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 169, in result
return self.__get_result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/home/cubeserver/contact-management-notifications/env/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 346, in _run_async
result = await coro
File "/home/cubeserver/contact-management-notifications/env/lib/python3.10/site-packages/prefect/cli/deployment.py", line 460, in ls
for deployment in sorted(
File "/home/cubeserver/contact-management-notifications/env/lib/python3.10/site-packages/prefect/cli/deployment.py", line 449, in sort_by_name_keys
return flows[d.flow_id].name, d.name
KeyError: UUID('aee72103-d63b-4e55-ae37-1fa2d19224c4')
An exception occurred.
Michael Michael
07/11/2023, 10:47 AM@flow
def flow():
db_connection = db_connection()
with db_connection() as cursor:
load(cursor)
However, when I run it I get the error: Flow run encountered an exception. ProgrammingError: no results to fetch
I have already found out that it is probably the cursor object which I pass to the task.
Is there a way to make a database connection and then pass it to the tasks?
thanks :)Elliott Wilson
07/11/2023, 10:55 AMpull:
- prefect.deployments.steps.git_clone:
repository: <https://github.com/gaia-family/monorepo.git>
branch: prefect_test
access_token: "{{ prefect.blocks.secret.github-access-token }}"
- prefect.deployments.steps.set_working_directory:
id: change_directory
directory: /monorepo/data/prefect
- prefect.deployments.steps.pip_install_requirements:
requirements_file: requirements.txt
Kevin Wang
07/11/2023, 2:20 PMNil
07/11/2023, 2:27 PMRUN mkdir /.prefect && chown -R random_program_planner /.prefect
USER random_program_planner
However I get the following error when I try to trigger the workflow from docker
/usr/local/lib/python3.9/site-packages/prefect/context.py:505: UserWarning: Failed to create the Prefect home directory at /home/random_program_planner/.prefect
Any help is appreciated 🙂 ThanksYD
07/11/2023, 2:45 PMprefect agent start --pool default-agent-pool
and prefect agent start -q <name>
? or is there are other things I can do to understand what is going on and prevent from it happening ?Kenneth
07/11/2023, 3:04 PMCreate Flow Run
server API call and don't pass any parameters in. Will it just used the default parameters set in the deployment?Ronald Sam
07/11/2023, 3:16 PMRonald Sam
07/11/2023, 3:56 PMRonald Sam
07/11/2023, 4:05 PMRonald Sam
07/11/2023, 4:05 PMRonald Sam
07/11/2023, 4:05 PMRonald Sam
07/11/2023, 4:15 PMKyle
07/11/2023, 4:37 PMSlackbot
07/11/2023, 5:17 PMGuna
07/11/2023, 5:25 PM{"severity": "ERROR", "name": "prefect-server.Scheduler", "message": "Unexpected error: ReadTimeout(TimeoutError())", "exc_info": "Traceback (most recent call last):
File "/prefect-server/src/prefect_server/services/loop_service.py", line 60, in run
await self.run_once()
File "/prefect-server/src/prefect_server/services/towel/scheduler.py", line 47, in run_once
offset=500 * iterations,
File "/prefect-server/src/prefect_server/database/orm.py", line 501, in get
as_box=not apply_schema,
File "/prefect-server/src/prefect_server/database/hasura.py", line 85, in execute
as_box=as_box,
File "/prefect-server/src/prefect_server/utilities/graphql.py", line 64, in execute
timeout=30,
File "/usr/local/lib/python3.7/site-packages/httpx/_client.py", line 1385, in post
timeout=timeout,
File "/usr/local/lib/python3.7/site-packages/httpx/_client.py", line 1148, in request
request, auth=auth, allow_redirects=allow_redirects, timeout=timeout,
File "/usr/local/lib/python3.7/site-packages/httpx/_client.py", line 1169, in send
request, auth=auth, timeout=timeout, allow_redirects=allow_redirects,
File "/usr/local/lib/python3.7/site-packages/httpx/_client.py", line 1196, in send_handling_redirects
request, auth=auth, timeout=timeout, history=history
File "/usr/local/lib/python3.7/site-packages/httpx/_client.py", line 1232, in send_handling_auth
response = await self.send_single_request(request, timeout)
File "/usr/local/lib/python3.7/site-packages/httpx/_client.py", line 1269, in send_single_request
timeout=timeout.as_dict(),
File "/usr/local/lib/python3.7/site-packages/httpcore/_async/connection_pool.py", line 153, in request
method, url, headers=headers, stream=stream, timeout=timeout
File "/usr/local/lib/python3.7/site-packages/httpcore/_async/connection.py", line 78, in request
return await self.connection.request(method, url, headers, stream, timeout)
File "/usr/local/lib/python3.7/site-packages/httpcore/_async/http11.py", line 62, in request
) = await self._receive_response(timeout)
File "/usr/local/lib/python3.7/site-packages/httpcore/_async/http11.py", line 115, in _receive_response
event = await self._receive_event(timeout)
File "/usr/local/lib/python3.7/site-packages/httpcore/_async/http11.py", line 145, in _receive_event
data = await self.socket.read(self.READ_NUM_BYTES, timeout)
File "/usr/local/lib/python3.7/site-packages/httpcore/_backends/asyncio.py", line 135, in read
self.stream_reader.read(n), timeout.get("read")
File "/usr/local/lib/python3.7/contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.7/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions
raise to_exc(exc) from None
httpcore._exceptions.ReadTimeout"}
As per above error it shows it was due graphql connection.pls can someone suggest solution for thisBryce Codell
07/11/2023, 5:48 PMRonald Sam
07/11/2023, 5:48 PMNelson Griffiths
07/11/2023, 6:31 PMprefect.yaml
file and reuse the same trigger across multiple deployments? Or do I have to write out the trigger for each deployment?Mitch
07/11/2023, 6:57 PMPREFECT_LOGGING_TO_API_ENABLED.value()
is showing that the value is false. Any thoughts?
with temporary_settings(updates={PREFECT_LOGGING_TO_API_ENABLED: False}):
run()