William Wagner
05/09/2022, 4:54 PM___main___
), is there an in-process Orion orchestrator running alongside it?
2. If 1), is the flow meta-data persisted in a local SQLite instance on disk?
3. Is this "ephemeral" server-less workflow intended for purely testing purposes, or is it production viable?Kevin Kho
05/09/2022, 4:57 PMfrom prefect import flow, task
from typing import List
import httpx
@task(retries=3)
def get_stars(repo: str):
url = f"<https://api.github.com/repos/{repo}>"
count = httpx.get(url).json()["stargazers_count"]
print(f"{repo} has {count} stars!")
@flow(name="Github Stars")
def github_stars(repos: List[str]):
for repo in repos:
get_stars(repo)
# run the flow!
github_stars(["PrefectHQ/Prefect", "PrefectHQ/miter-design"])
The state is persisted in the SQLite database through the ephemeral API even if you haven’t started the Orion service.
I believe it can be production viable and you can bring your own scheduler like Cron even, but at some point, you need to spin up the service to view in the UI so I think it’s really more for testing without the serviceWilliam Wagner
05/09/2022, 5:00 PMKevin Kho
05/09/2022, 5:04 PM