Lior Barak
10/02/2023, 9:27 AMFile "/usr/local/lib/python3.10/site-packages/alembic/script/base.py", line 276, in _catch_revision_errors
raise util.CommandError(resolution) from re
alembic.util.exc.CommandError: Can't locate revision identified by '05ea6f882b1d'
Application startup failed. Exiting.
Server stopped!
full stack trace in thread
happened to anybody else?Soami Charan
10/02/2023, 9:59 AMShane Breeze
10/02/2023, 10:17 AMSamuel Hinton
10/02/2023, 10:24 AMMitch
10/02/2023, 12:58 PM--no-pull
?Nemanja
10/02/2023, 1:18 PMdel dataframe
gc.collect()
But it does not get released from cache
Any ideas?Avi
10/02/2023, 1:41 PMNotifications
documentations. The link from the UI is sending me to 404 error.
I would like to customize my slack message, however I can not understand how to extract flow data inside the configuration setupAli Mir
10/02/2023, 2:59 PMEric
10/02/2023, 3:20 PMLucas Cavalcanti Rodrigues
10/02/2023, 3:21 PMKevin McCraney
10/02/2023, 7:34 PMEric
10/02/2023, 8:11 PMEric
10/02/2023, 8:18 PMBrian Newman
10/02/2023, 9:34 PMclass User(BaseModel):
"""Pydantic model for the User."""
email: Optional[str]
firstName: Optional[str]
lastName: Optional[str]
@task()
def user_json(user: User):
"""Should return a JSON representation of only the set fields in the User model."""
print(user)
# Outputs: email=None firstName='John' lastName=None
print(user.json(exclude_unset=True))
# Outputs: {"email": null, "firstName": "John", "lastName": null}
return user.json(exclude_unset=True)
@flow()
def fl_create_user():
"""Creates a new user with only the first_name set and calls the user_json task."""
user = User(firstName="John")
print(user)
# Outputs: email=None firstName='John' lastName=None
print(user.json(exclude_unset=True))
# Outputs: {"firstName": "John"}
json_user = user_json(user)
print(json_user)
# Outputs: {"email": null, "firstName": "John", "lastName": null}
Matt Alhonte
10/03/2023, 1:42 AMrun_deployment
(run from a task). I notice that if one fails, then the downstream ones don't fail. How do I make subflow failures propagate to the parent flow? I'm using the ConcurrentTaskRunner
. Some need to run concurrently with each other.Matt Alhonte
10/03/2023, 2:07 AMwait_for
argument to all run at the same time, while any Failure kills the whole thing.
from prefect import flow, task
from prefect.task_runners import ConcurrentTaskRunner
import time
def fail_hook(flow, flow_run, state):
print("Failed")
raise Exception(state.message)
@task(log_prints=True, on_failure=[fail_hook])
def my_task():
time.sleep(15)
# some code here
raise Exception("This task has failed.") # this will set the task to Failed state
@task(log_prints=True, on_failure=[fail_hook])
def my_task2():
time.sleep(25)
return "sdfsdf"
@flow(
task_runner=ConcurrentTaskRunner(),
)
def my_flow():
result1 = my_task.submit(return_state=True)
result2 = my_task2.submit(return_state=True)
result3 = my_task.submit(return_state=True)
result4 = my_task2.submit(return_state=True, wait_for=[result1])
Matt Fysh
10/03/2023, 3:13 AMLaszlo [Gimlet.io]
10/03/2023, 11:36 AMTarun Reddy
10/03/2023, 12:23 PMTarun Reddy
10/03/2023, 12:24 PMJason Motley
10/03/2023, 2:39 PMJeffrey Lam
10/03/2023, 2:58 PMFailed to submit flow run '8093ef5c-64f8-42eb-9f4b-045ed7e7d6ad' to infrastructure.
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/usr/local/lib/python3.11/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
OSError: [Errno 99] Cannot assign requested address
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 714, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 403, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 363, in connect
self.sock = conn = self._new_conn()
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f60db485950>: Failed to establish a new connection: [Errno 99] Cannot assign requested address
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/prefect/workers/base.py", line 834, in _submit_run_and_capture_errors
result = await self.run(
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect_kubernetes/worker.py", line 506, in run
job = await run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 91, in run_sync_in_worker_thread
return await anyio.to_thread.run_sync(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect_kubernetes/worker.py", line 628, in _create_job
job = batch_client.create_namespaced_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubernetes/client/api/batch_v1_api.py", line 210, in create_namespaced_job
return self.create_namespaced_job_with_http_info(namespace, body, **kwargs) # noqa: E501
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubernetes/client/api/batch_v1_api.py", line 309, in create_namespaced_job_with_http_info
return self.api_client.call_api(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubernetes/client/api_client.py", line 348, in call_api
return self.__call_api(resource_path, method,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubernetes/client/api_client.py", line 180, in __call_api
response_data = self.request(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubernetes/client/api_client.py", line 391, in request
return <http://self.rest_client.POST|self.rest_client.POST>(url,
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubernetes/client/rest.py", line 276, in POST
return self.request("POST", url,
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubernetes/client/rest.py", line 169, in request
r = self.pool_manager.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/request.py", line 78, in request
return self.request_encode_body(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/request.py", line 170, in request_encode_body
return self.urlopen(method, url, **extra_kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/poolmanager.py", line 376, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 826, in urlopen
return self.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 826, in urlopen
return self.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 826, in urlopen
return self.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 798, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='172.30.0.1', port=443): Max retries exceeded with url: /apis/batch/v1/namespaces/prefect-2x/jobs (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f60db485950>: Failed to establish a new connection: [Errno 99] Cannot assign requested address'))
Dominic Tarro
10/03/2023, 5:57 PMrun_deployment
, are only the parameters I submit overridden, or are all parameters overridden and any not explicitly passed fall back on the flow function's defaults?Theis Ferré Hjortkjær
10/03/2023, 6:27 PMfrom prefect import flow, task
from prefect_ray.task_runners import RayTaskRunner
from prefect_ray.context import remote_options
@task
def process(x):
return x + 1
@flow(task_runner=RayTaskRunner("ray://<my-ray-service>:10001"))
def my_flow():
# equivalent to setting @ray.remote(num_cpus=4)
with remote_options(num_cpus=4):
process.submit(42)
It fails with a runtime error:
RuntimeError: There is no current event loop in thread 'ray_client_server_1'.
If i do not specify resources for my task, everything works as intended.
I have submitted an issue, but it has not been picked up yet, so i thought maybe i could get some help here 🙂
https://github.com/PrefectHQ/prefect/issues/10542Erik Amundson
10/03/2023, 8:29 PMCrash detected! Execution was interrupted by an unexpected exception: PrefectHTTPStatusError: Client error '408 Request Timeout' for url '<https://api.prefect.cloud/api/accounts/><xxx>/workspaces/<xxx>/task_runs/'
Samuel Hinton
10/03/2023, 10:55 PMprefect-aws
to launch ECS tasks for longer running compute. Im unsure how a "worker" would change or improve these two use casesMatt Alhonte
10/04/2023, 12:50 AMdef make_fail(flow, flow_run, state):
print("Failed")
flow_run_ctx = FlowRunContext.get()
print(flow_run_ctx)
print("Flow")
print(flow)
print("Flow run")
@flow(
log_prints=True,
on_completion=[make_fail],
on_failure=[make_fail],
task_runner=ConcurrentTaskRunner(),
result_serializer=JSONSerializer(),
result_storage=S3(bucket_path=bucket_path),
persist_result=True,
)
def my_flow():
result1 = my_task.submit()
result2 = my_task2.submit()
result3 = my_task.submit()
result4 = my_task2.submit(wait_for=[result1])
None of the print
statements show upMatt Fysh
10/04/2023, 12:52 AMtig
10/04/2023, 1:37 AMMatt Fysh
10/04/2023, 3:53 AM/task-runs/task-run/:uuid
route?
• the task inputs tab is showing {"id": []}
when it should be (for example) {"id": "123"}
• the cache key in the sidebar is not populated, but I provided a cache_key_fn
and the caching feature itself seems to be working (re-running task with same ID uses cached result)