Taylor Babin
01/31/2023, 1:53 PMKhyaati Jindal
01/31/2023, 2:11 PMMike O'Connor
01/31/2023, 2:16 PMWANDB_MODE=offline
, it would be great do be able to do something similarDavid Yang
01/31/2023, 2:28 PMJoan Gil
01/31/2023, 2:31 PMfor sub_deployments in flows:
await asyncio.gather(
*[deploy_flow(deployment_config) for deployment_config in sub_deployments]
)
async def deploy_flow(deployment_config):
flow = deployment_config.get("flow")
print(f"deploying : {flow.name}")
await Deployment.build_from_flow(
...
storage=gcs_block,
apply=True,
)
print(f"applied deployment: {flow.name}")
I get the two flows deploying at the same time, but the first one always finishes first, and I have to wait for bout 2 minutes until the 2nd one finishes and it’s always like that, which tells me that something’s blocking the 2nd flow from being deployed/registered with the API.kiran
01/31/2023, 5:06 PM/my_path/.venv/lib/python3.10/site-packages/prefect/utilities/dispatch.py:162: UserWarning: Type 'SlackWebhook' at /my_path/.venv/lib/python3.10/site-packages/prefect_slack/credentials.py:43 has key 'slack-webhook' that matches existing registered type 'SlackWebhook' from /my_path/.venv/lib/python3.10/site-packages/prefect/blocks/notifications.py:83. The existing type will be overridden.
TypeError: Block.__new__() takes 1 positional argument but 2 were given
But the writing here still seems to be like how I’ve been using it (not using a Block). Maybe I missed another documentation update somewhere?
Using:
prefect 2.7.10
prefect-slack 0.1.1Elliot Løvås
01/31/2023, 5:38 PMLeonardus Chen
01/31/2023, 5:38 PMtask.map
?
I know the following works
@task
def say_hello(name: str) -> None:
print(name)
names = ["a", "b"]
for name in names:
say_hello.with_options(name=f"say {name}"}
But how do I make it work with mapping?
names = ["a", "b"]
say_hello.map(names)
I've asked the question a few days ago in an old thread (https://prefect-community.slack.com/archives/CL09KU1K7/p1674788888354029?thread_ts=1668092490.489519&cid=CL09KU1K7), asking it again here to get more attentionTomás Emilio Silva Ebensperger
01/31/2023, 6:57 PMNimesh Kumar
01/31/2023, 7:49 PM{
"name": "deploymentUsingApi",
"flow_id": "f27b41b3-6fd8-4356-b443-6cd08eab4cee",
"is_schedule_active": true,
"parameters": {},
"tags": [
"tag-1",
"tag-2"
],
"manifest_path": "api-manifest",
"work_queue_name": "test_queue",
"worker_pool_name": "my-worker-pool",
"worker_pool_queue_name": "my-worker-pool-queue",
"storage_document_id": "b2e8f87c-1c1f-499a-a143-a8f2b6253714",
"infrastructure_document_id": "b2e8f87c-1c1f-499a-a143-a8f2b6253714",
"schedule": {
"interval": 0,
"anchor_date": "2023-01-31T18:09:36.895Z",
"timezone": "America/New_York"
},
"description": "creating deploymnent using api",
"parameter_openapi_schema": {},
"path": "",
"version": "",
"entrypoint": "flow.py:greetings",
"infra_overrides": {}
}
The value assigned to storage_document_id and infrastructure_documnet_id is just a random uuid, since i trying this api with postman i m bit confused on entrypoint too that how to put it in correct way
can anyone please help me on this.Guy Altman
01/31/2023, 8:24 PMHarry Hause
01/31/2023, 9:03 PMdeployment build
work with an ecs-task infra block.
This looks related but only looks like it pertains to the docker-container infra block. Otherwise we can manually create the deployments for now.
We are following a similar pipeline to this one: https://github.com/anna-geller/dataflow-ops/blob/main/.github/workflows/ecs_prefect_agent.ymlJeff Hale
01/31/2023, 9:14 PMRafał Bielicki
01/31/2023, 9:20 PMWalter Cavinaw
01/31/2023, 11:21 PMFrank Hardisty
02/01/2023, 12:24 AMHans Lellelid
02/01/2023, 1:07 AMKhyaati Jindal
02/01/2023, 4:00 AMExecuting 'OQCEA18L2-8a17dcaa-0' immediately...
08:33:57 AM
Crash detected! Execution was cancelled by the runtime environment.
09:00:19 AM
OQCEA18L2-8a17dcaa-0
Encountered exception during execution:
Traceback (most recent call last):
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 633, in run_until_complete
self.run_forever()
File "/usr/lib/python3.10/asyncio/base_events.py", line 600, in run_forever
self._run_once()
File "/usr/lib/python3.10/asyncio/base_events.py", line 1860, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.10/selectors.py", line 469, in select
fd_event_list = self._selector.poll(timeout, max_ev)
File "/home/ubuntu/common_env/lib/python3.10/site-packages/prefect/engine.py", line 1614, in cancel_flow_run
raise TerminationSignal(signal=signal.SIGTERM)
prefect.exceptions.TerminationSignal
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ubuntu/common_env/lib/python3.10/site-packages/prefect/engine.py", line 643, in orchestrate_flow_run
result = await run_sync(flow_call)
File "/home/ubuntu/common_env/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 165, in run_sync_in_interruptible_worker_thread
assert result is not NotSet
AssertionError
Khyaati Jindal
02/01/2023, 4:09 AMAbhishek Mitra
02/01/2023, 4:09 AMWatching flow run execution...
└── 16:18:49 | INFO | Entered state <Scheduled>: Flow run scheduled.
└── 16:18:57 | INFO | Entered state <Submitted>: Submitted for execution
└── 16:18:57 | ERROR | An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Role is not valid
└── 16:18:58 | INFO | Entered state <Failed>: An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Role is not valid
Flow run failed!
Leon Kozlowski
02/01/2023, 4:13 AMprefect cloud login
within CI if there are interactive results for login?
Every time I try to login I am not met with exceptions due to having to type responses to various questionsAnkit
02/01/2023, 4:29 AMKhyaati Jindal
02/01/2023, 4:36 AMRuntimeWarning: 'prefect.engine' found in sys.modules after import of package 'prefect', but prior to execution of 'prefect.engine'; in unpredictable behaviour
José Duarte
02/01/2023, 9:47 AMNaila Chennit
02/01/2023, 11:42 AMFerdinand von den Eichen
02/01/2023, 12:32 PMSubmission failed. Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/prefect_aws/ecs.py", line 797, in _create_task_and_wait_for_start task = self._run_task(ecs_client, task_run) File "/usr/local/lib/python3.9/site-packages/prefect_aws/ecs.py", line 1458, in _run_task return ecs_client.run_task(**task_run)["tasks"][0] File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 508, in _api_call return self._make_api_call(operation_name, kwargs) File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 915, in _make_api_call raise error_class(parsed_response, operation_name) botocore.errorfactory.ClusterNotFoundException: An error occurred (ClusterNotFoundException) when calling the RunTask operation: Cluster not found. The above exception was the direct cause of the following exception: RuntimeError: Failed to run ECS task, cluster 'prefect' not found. Confirm that the cluster is configured in your region.
Edit Bonus Question: How would you debug this kind of issue? The main AWS exceptions seems to be suppressed unfortunately…Heather
02/01/2023, 1:50 PM/var/log/nginx/access.log
However, when I tail
this file, it appears to be empty? Any idea how we can get these audit logs?
Thanks!Kyle Austin
02/01/2023, 1:57 PMfrom prefect import task, flow
@task(name="fake junk task")
def do_nothing(input):
return input
@task(name="junk data task")
def make_junk_data(num_rows):
return [
{f"key_{i}": f"value_{i+j}" for i in range(500)}
for j in range(num_rows)
]
@flow(name="subflow")
def subflow(data):
do_nothing(data)
@flow(name="main flow")
def main_flow(num_rows):
data = make_junk_data(num_rows)
subflow(data=data)
if __name__ == "__main__":
main_flow(50)
When main_flow input is 50 no problem. But if the input is increased to like 1000 it crashes and gives the error. httpx.HTTPStatusError: Client error '403 Forbidden' for url. By investigating the traceback it looks like the subflow is being "triggered" via API calls (to prefect cloud and with this huge input at a parameter to that call) in the background. So guessing this practice of passing a huge input as a parameter to a subflow is just not the ideal practice? Are there any recommendations for how to achieve this kind of pattern? I am thinking of writing the data first to file/cloud storage first and just pass the metadata for that instead but are there any parameters for subflows/tasks that would allow us to pass a huge list to a subflow like this? Thanks for any help!Jari Rosti
02/01/2023, 1:59 PM{
"use_ssl": false,
"key": "real-key",
"secret": "real-password",
Is it possible to hide the credentials somehow from the UI? Is there a planned feature to make the storage block view not to show the information?
I have 2.7.8 Orion installed.Joan Gil
02/01/2023, 2:09 PM