Marc Lipoff
02/21/2023, 9:22 PMVolker L
02/21/2023, 9:54 PMubuntu in š instance-20230102-1221 in ~ via š
prefect took 5m57s
⯠prefect config set PREFECT_SERVER_API_HOST=0.0.0.0
Set 'PREFECT_SERVER_API_HOST' to '0.0.0.0'.
Updated profile 'default'.
ubuntu in š instance-20230102-1221 in ~ via š
prefect took 3s
⯠prefect server start
___ ___ ___ ___ ___ ___ _____
| _ \ _ \ __| __| __/ __|_ _|
| _/ / _|| _|| _| (__ | |
|_| |_|_\___|_| |___\___| |_|
Configure Prefect to communicate with the server with:
prefect config set PREFECT_API_URL=<http://0.0.0.0:4200/api>
View the API reference documentation at <http://0.0.0.0:4200/docs>
Check out the dashboard at <http://0.0.0.0:4200>
I am able to connect to the Prefect UI in the browser, by replacing 0.0.0.0
with the ip address of the vm.
On my second vm, i have done the following:
ubuntu in š instance-20221129-2229 in yfin-db/yfin_db on ī main [!?] via š v3.11.0 via š
main took 6m37s
⯠prefect config set PREFECT_API_URL=<http://xxx.yyy.zzz.xxx:4200/api>
Set 'PREFECT_API_URL' to '<http://xxx.yyy.zzz.xxx:4200/api>'.
Updated profile 'default'.
ubuntu in š instance-20221129-2229 in yfin-db/yfin_db on ī main [!?] via š v3.11.0 via š
main took 6s
⯠prefect deployment apply healthcheck-deployment.yaml
Successfully loaded 'healthcheck'
Deployment 'healthcheck/healthcheck' successfully created with id '52b59be9-fe11-49d1-acad-3257f3fc758d'.
View Deployment in UI: <http://xxx.yyy.zzz.xxx:4200/deployments/deployment/52b59be9-fe11-49d1-acad-3257f3fc758d>
To execute flow runs from this deployment, start an agent that pulls work from the 'test' work queue:
$ prefect agent start -q 'test'
As you can see, I have changed the PREFECT_API_URL
to the Prefect server running on my first vm. Than I have applied the deployment and Prefect tells me, that the deployment was successfully created. However, the deployment does not appear in the Prefect UI.
Did I miss anything?Mark Li
02/21/2023, 10:23 PMHamza Naanani
02/22/2023, 12:29 AMRuntimeError: Prefect requires sqlite >= 3.24.0 but we found version 3.7.17
Is this something on my end?
ThanksAnkit
02/22/2023, 4:35 AMHaotian Li
02/22/2023, 7:12 AMNikhil Joseph
02/22/2023, 8:38 AMDavid Elliott
02/22/2023, 9:39 AMNotReady
state? Might need updating?Deceivious
02/22/2023, 10:38 AMtask
decorator OR my knowledge of python decorators fails me š
While using the prefect task
decorators for some reason, the kwargs supplied while calling the decorated function are being converted into args.
To test this, Ive written a minimum viable script. <<Included in the thread>>
Expected use case: result when USE_PREFECT
is set to False.
Error use case: Error raised when USE_PREFECT
is set to True. If you look over the error trace log, when printing args and kargs. kargs is empty while the data expected in kargs is being sent to args.
ENV:
python: 3.10.8
prefect: 2.8.0Slackbot
02/22/2023, 2:38 PMDavid Elliott
02/22/2023, 2:41 PMAlexandre Guitton
02/22/2023, 3:25 PMKubernetesJob block
and use that in my deployment.
Now, let's say I have three different flows, which require different python dependencies. Does that mean I need to create my three Docker images, then create three blocks, one for each, and finally associate the right block with the right flow in my deployment?Tushar Gupta
02/22/2023, 4:03 PMSegun Adelowo
02/22/2023, 5:08 PMCharlie Henry
02/22/2023, 7:31 PM@task()
def docker_command(docker_image, environment_variables, command, logger):
response = (
docker.from_env()
.containers.run(
image=docker_image,
command=f"python {command}",
environment=environment_variables,
)
.decode("utf-8")
)
<http://logger.info|logger.info>(response)
Also, I'm using the docker-py python library for this, rather than a block which might also be a solution?Ethienne Marcelin
02/22/2023, 8:30 PMWritableFileSystem
?
With this code
In [6]: class MyFS(WritableFileSystem):
...: _basepath = ""
...: def read_path(self, path):
...: return
...: def write_path(self, path, content):
...: return
In [7]: MyFS()
I get the following error
OSError: source code not available
Leon Kozlowski
02/22/2023, 8:30 PMprefect-cloud.automation.action.failed
with no other infoPaco IbaƱez
02/22/2023, 10:29 PMrun_deployment
how can I minimize the time that the agent will take to pick up the new flow run?John Horn
02/22/2023, 11:40 PM# prefect version
23:39:04.743 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/57e0246d-d752-4737-b29a-192e8f6eb886/workspaces/6d439078-f534-4a0a-89e0-9c4ced644d6a/>
Version: 2.5.0
API version: 0.8.2
Python version: 3.8.16
Git commit: eac37918
Built: Thu, Oct 6, 2022 12:41 PM
OS/Arch: linux/aarch64
Profile: default
Server type: cloud
I am trying to create a deployment that calls a flow with a flow_run_name parameter.
I am guessing that my prefect version needs to be updated however I don't know how to upgrade the prefect cloud version.
My actual local prefect agent is using the latest 2.8.2 but I'm guessing it is prefect cloud that is stuck on 2.5.0 and I see no documentation on how to update that.
@flow(flow_run_name='testing123')
TypeError: flow() got an unexpected keyword argument 'flow_run_name'
Jarvis Stubblefield
02/23/2023, 1:15 AMprefect.exceptions.PrefectHTTPStatusError: Server error '500 Internal Server Error' for url '<https://api.prefect.cloud/api/accounts/5626ffe9-0140-4e88-babc-4a4fc614bb99/workspaces/ee8a533d-2754-420e-87f2-2d6b084984af/flow_runs/>'
Response: {'exception_message': 'Internal Server Error'}
For more information check: <https://httpstatuses.com/500>
Samuel Hinton
02/23/2023, 2:06 AMfrom zoneinfo import ZoneInfo
from dateutil.rrule import MINUTELY, rrule
from prefect import flow
from prefect.deployments import Deployment
from prefect.server.schemas.schedules import RRuleSchedule
london = ZoneInfo("Europe/London")
@flow
def some_flow():
print("whoa")
Deployment.build_from_flow(
flow=some_flow,
schedule=RRuleSchedule.from_rrule(
rrule(
freq=MINUTELY,
interval=10,
dtstart=dt(2020, 1, 1, tzinfo=london),
byhour=range(8, 9),
)
),
)
Naively, Iād expect this to work, but it fails because ZoneInfo doesnt have a name attribute
schedule=RRuleSchedule.from_rrule(
File "/Users/sh/Projects/flows/.venv/lib/python3.9/site-packages/prefect/server/schemas/schedules.py", line 410, in from_rrule
timezone = rrule._dtstart.tzinfo.name
AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'name'
Theres an easy workaround here (like setting the timezone name explicitly like is done in schedules.py:413, but thought it might be good to get this working with pythons new standard way of handling timezones, especially because the old from datetime import timezone
requires specifying an hour delta which actually doesnt get used by prefect2Samuel Hinton
02/23/2023, 2:26 AMprefect.settings.PREFECT_API_URL
has getters but not setters and I dont want to just go under the hood. Using os.environ
doesnt seem to work, because the env var is set after importing prefect (use case is we have dev and prod versions of prefect and we want to loop over envs and upload a common flow to all of them)Samuel Hinton
02/23/2023, 2:58 AMflows
folder filled with 20 python files, each with, say, 2 flows inside them, if I try to deploy the 20 flows, every single deployment will reupload all 20 files, which is incredibly slow.
Is there a nicer way of doing this, such that I can upload everything just a single time? I see theres a skip_upload
I could use, but it feels a bit of an anti-pattern for me to use a bool flag like āalready_uploadedā to toggle the skip_upload flagJenia Varavva
02/23/2023, 3:23 AMWalter Cavinaw
02/23/2023, 5:11 AMDmytro Ponomarchuk
02/23/2023, 8:36 AMUnhealthy
Work Queue?
It just stopped processing any new flows without any reason. And no errors in the Agent log which is running on AWS ECS infrastructureTolga Karahan
02/23/2023, 9:04 AMvalidate=False
.`Samuel Bunce
02/23/2023, 9:15 AMprefect\client\base.py", line 130, in raise_for_status
raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Server error '502 Bad Gateway' for url
'<https://api.prefect.cloud/api/accounts/xxxxx/flow_runs/filter>'
For more information check: <https://httpstatuses.com/502>
Agent stopped!
which we believe is caused by a failure to communicate with the cloud instance. We have a default argument for number of tries, which is set here to 3 https://github.com/PrefectHQ/prefect/blob/42e5a978390575b8bd6ef4c258ba703f7e28fca2/src/prefect/utilities/services.py#L18 - ideally we would like to be able to reconfigure it or set it to infinite so that when our agents cannot communicate with cloud, they don't all collapse - we had to restart everything this morning.
As another point, this obviously generated hundreds of late flows. Why is there no 'select all' function on the UI, or capability to remove all late flows. The best I have been able to do so far is to go through and manually click to remove all late flows. Feel like there should be more functionality for actions on batches of flow runsStephen Lloyd
02/23/2023, 11:32 AMTolga Karahan
02/23/2023, 2:03 PM