Mads
11/05/2024, 2:46 PMWorker 'worker1' submitting flow run 'fa2763d7-ff20-4216-b136-120b566caa15'
03:41:20 PM
prefect.flow_runs.worker
Opening process...
03:41:20 PM
prefect.flow_runs.worker
Completed submission of flow run 'fa2763d7-ff20-4216-b136-120b566caa15'
03:41:20 PM
prefect.flow_runs.worker
Process 103843 exited with status code: 1
03:41:22 PM
prefect.flow_runs.worker
Reported flow run 'fa2763d7-ff20-4216-b136-120b566caa15' as crashed: Flow run infrastructure exited with non-zero status code 1.
It works fine when I run it as .serve.
Any ideas? The flow is a slightly modified example, to test with my own private repo.
from prefect import flow, task
from typing import List
from prefect_github import GitHubCredentials
from prefect.runner.storage import GitRepository
@task(log_prints=True)
def get_stars(repo: str):
url = f"<https://api.github.com/repos/{repo}>"
print(url)
@flow(name="GitHub Stars")
def github_stars(repos: List[str]):
repos = ["prefect-io/prefect", "PrefectHQ/prefect"]
for repo in repos:
get_stars(repo)
if __name__ == "__main__":
source = GitRepository(
url="<https://github.com/syv-ai/advokatgpt.git>",
credentials=GitHubCredentials.load("prefect-github-credentials-block-newer"),
branch="main",
)
flow.from_source(source, entrypoint="prefect-inf.py:github_stars").deploy(
name="github-stars", work_pool_name="default"
)
Nate
11/05/2024, 4:01 PMMads
11/05/2024, 4:58 PMNate
11/05/2024, 9:59 PMMads
11/05/2024, 10:26 PMNate
11/05/2024, 10:31 PMPREFECT_LOGGING_LEVEL=DEBUG prefect worker start -p default
or whatever your command to start your worker is likeNate
11/05/2024, 10:31 PM