hi not sure if this is right channel - my use case...
# prefect-contributors
n
hi not sure if this is right channel - my use case requires a clock/schedule that supports RRules (iCal style recurrences) which the current clock impls don’t support. I’ve implemented an
RRRuleClock
and
RRuleSchedule
(which is really just a function similar to other Prefect
Schedule
creators). however the flow won’t run b/c it doesn’t know how to serialize my
RRuleClock
. I assume I need to write a
RRuleClockSchema
so that Marshmallow will know how to serialize it. but, where I’m unclear is, it seems like I need to then add it to the
type_schemas
here https://github.com/PrefectHQ/prefect/blob/a9270d965aee1e2182843e7fa75d18e1054230d0/src/prefect/serialization/schedule.py#L92. I can add to the map directly via the class, but that would obv only work locally (if at all) not on all the distributed agents. is there another way to register the
RRuleClockSchema
so it can get serialized? if not it seems like I need to fork prefect code and run agents with my
RRuleClock
codebase, while contributing my clock impl PR back into main branch. lmk if I’m missing something here and there’s a better way to go about this
k
Hey @Nitay J, you are not missing anything. You would have to make your own fork and install that on agents to get this to work. Will ask the core team to view this and see if we’d be interested in a contribution (if you’re willing to PR it)
n
k ye I can make a PR for it
k
Otherwise you may have to use the RRuleSchedule to return one of the supported clocks.
n
meaning implement rrules using existing clocks? not sure that’s possible for some edge cases, rrules have a wide feature set
k
I see
n
would be nice to get this in so we dont have to keep this fork of prefect code indefinitely. also this seems like something others could benefit from - rrule is likely the most feature-rich clock scheduling scheme out there
@Kevin Kho is this right place to ask stuff of other devs - e.g as I’m working through this PR one thing I keep running into is errors comparing timezone naive to timezone aware datetime objects. is there a standard for which I should be using throughout prefect code?
k
This is. Most prefect stuff uses
pendulum
. Btw before you dive too deep, I need to hear back if we would accept the PR from the core team. I should have an answer a but later.
The core team is certainly interested in the idea and a PR that shows what you’re going for would really help us understand.
n
ye i saw the use of pendulum, but i still dont get if I should e.g support naive and tz-aware, raise exceptions on naive, etc?
great to hear that from core team, to be clear though even if its not accepted/merged (hopefully will be) what choice do I have but to impl it in prefect and fork it? o/w we basically can’t use prefect b/c we use rrules a lot
k
Some people just fork and keep a pinned versioned like that approach you mentioned. I have seen it with a custom RunConfig. Will ping someone for the pendulum question.
tz-aware only, but really, there’s no need to get the PR right 100%. It’s mainly about seeing the idea first so you don’t need to worry about raising the exceptions
n
k
They’ll review it (and probably respond there instead of Slack)
Thanks for putting the PR together!
n
👍 sg thx
hi @Kevin Kho q is there some best practices for how to develop with all the pieces locally. specifically how to run and/or package up all the components using local code. I got things to run using e.g
python -m prefect.__main__ agent
in core code and
python -m prefect_server.cli
in server code (requires https://github.com/PrefectHQ/server/pull/274). but doing things like
python -m prefect.__main__ server start
doesn’t seem like right approach as that runs from docker images not the current code
k
Will forward to the core team
z
Hey Nitay, when developing against Prefect Server you do have to have the repo checked out and do
prefect-server dev infrastructure
then
prefect-server dev services
to run a local development instance
There's a description of this in the README of the Server repo
Curious why you have a preference for
python -m
?
n
habit i guess, am used to being able to have the quick local dev while not having to install pkgs (even if just links via -e). its nbd though I can do the pip install method as u described
z
I'm also okay with accepting the
__main__
PR
n
sg. quick noob q - how do I run just the UI - I got the other bits working but am in a deep rabbit hole with fontawesome - I don’t have a pro account and whn I change the references throughout to the free version its still not authenticating and downloading for some reason. I don’t actually need to change anything with UI just want to be able to run it individually (since I’m running infra / services via code), how do I do this?
k
See this
Here is the PR for that
n
Hi what’s the normal turn around time for a PR i.e when should I expect feedback on https://github.com/PrefectHQ/prefect/pull/4901 submitted week ago
c
Hi @Nitay J apologies on the delay in PR review; normally the team is lightning fast with reviews, but I got looped in on this one and it fell off my radar, so my personal apologies! I'll have you a review in the next 24 hours 👍
1