Hey guys, do you know of any good available projec...
# ask-community
a
Hey guys, do you know of any good available projects that I can take a look at that use FastAPI with Prefect (and dask scheduler behind it)? bonus for using mlflow as well
a
not sure if this is what you mean, but perhaps you can build a project that: • builds a data lake - you can use Prefect to orchestrate your data ingestion • builds a data discovery API using FastAPI - this post has a very rudimentary functionality and bad API routes but you can use it as a starting point still • and you can use MLFlow perhaps to do some data science with this data Just some ideas 🙂
k
For MLFlow, it’s just a matter of putting the MLFlow code inside a task like this
upvote 2
a
Nice, I'll take a look into it. Thank you. I saw OpenMLOps and it's a bit advanced for me right now given how much stuff is in there, right now I'm using fastapi with a separate dask scheduler (not really integrated with the fastapi backend server) and wanted to add Prefect on top of dask and integrate it with my fastapi app. That's why I'm looking for projects that have integrated fastapi with prefect on top of dask to learn how I can do it for mine
a
Not sure what do you mean by Prefect and FastAPI integration, but you can start a Prefect flow run from a FastAPI API request using the create_flow_run mutation. Example:
Copy code
import requests

query = """
 mutation {
  create_flow_run(input: { version_group_id: "fb919cc4-7f74-4ed7-9f3c-71bdd9be69e8" }) {
    id
  }
}
"""

url = "<<https://api.prefect.io>>"
response = <http://requests.post|requests.post>(
    url, json={"query": query}, headers={"authorization": "Bearer XXX"}
)
print(response.status_code)
print(response.text)
148 Views