Joeri Smits
01/03/2025, 1:06 PMfrom prefect import flow
from prefect.runner.storage import GitRepository
from prefect_github import GitHubCredentials
from sync_from_airbyte_flow import sync_from_airbyte
github_repo = GitRepository(
url="<https://github.com/webbio/AirByte>",
credentials=GitHubCredentials.load("github"),
)
@flow
def master_flow():
sync_result = sync_from_airbyte()
return sync_result
if __name__ == "__main__":
master_flow.from_source(
source=github_repo,
entrypoint="orchestration/master_flow.py:master_flow",
).deploy(
name="Sync from Airbyte and run DBT transform",
work_pool_name="webbio-workpool",
image="prefecthq/prefect:3-python3.12",
push=True,
cron="0 0 * * *",
)
I only receive a exited code 1 when running the deployment on the from sync_from_airbyte_flow import sync_from_airbyte
. Am I missing something?Nate
01/03/2025, 3:27 PMNate
01/03/2025, 3:28 PMonly contains prefect, so how were you trying to install the deps forprefecthq/prefect:3-python3.12
prefect-github
?Joeri Smits
01/03/2025, 3:28 PM["prefect-github"]
in the Pip Packages on the Prefect UI?Nate
01/03/2025, 3:29 PMimage
in .deploy()
Joeri Smits
01/03/2025, 3:37 PMJoeri Smits
01/03/2025, 3:37 PMfrom prefect import flow, get_run_logger
from prefect.runner.storage import GitRepository
from prefect_github import GitHubCredentials
from sync_from_airbyte_flow import sync_from_airbyte
github_repo = GitRepository(
url="<https://github.com/webbio/AirByte>",
credentials=GitHubCredentials.load("github"),
)
@flow
def master_flow():
logger = get_run_logger()
logger.setLevel("DEBUG")
<http://logger.info|logger.info>("Hello World")
if __name__ == "__main__":
master_flow.from_source(
source=github_repo,
entrypoint="orchestration/master_flow.py:master_flow",
).deploy(
name="Sync from Airbyte and run DBT transform",
work_pool_name="webbio",
image="prefecthq/prefect:3-python3.12",
push=True,
cron="0 0 * * *",
)
Joeri Smits
01/03/2025, 3:37 PMprefect-github
configured in the prefect managed workpoolJoeri Smits
01/03/2025, 3:59 PMfrom prefect import flow
from prefect.runner.storage import GitRepository
from prefect_github import GitHubCredentials
@flow
def hello_world_flow():
return "Hello World"
if __name__ == "__main__":
github_repo = GitRepository(
url="<https://github.com/webbio/AirByte.git>",
credentials=GitHubCredentials.load("github"),
)
hello_world_flow.from_source(
source=github_repo,
entrypoint="./orchestration/hello_world.py:hello_world_flow",
).deploy(
name="Hello World",
work_pool_name="webbio",
image="prefecthq/prefect:3-python3.12",
push=False,
cron="0 0 * * *",
)
Joeri Smits
01/03/2025, 4:00 PMJoeri Smits
01/03/2025, 4:06 PMNate
01/03/2025, 4:39 PMprefect worker start --pool local-pool
instead of a managed pool? then you can see the logs of what's going wrongJoeri Smits
01/03/2025, 4:40 PMNate
01/03/2025, 5:19 PMprefect worker start --pool local-docker --type docker
and add a job_variable for the dep
hello_world_flow.from_source(
source=github_repo,
entrypoint="./orchestration/hello_world.py:hello_world_flow",
).deploy(
name="Hello World",
work_pool_name="webbio",
image="prefecthq/prefect:3-python3.12",
job_variables=dict(env=dict(EXTRA_PIP_PACKAGES="prefect-github")),
push=False,
cron="0 0 * * *",
)
Joeri Smits
01/03/2025, 5:20 PMNate
01/03/2025, 5:20 PMNate
01/03/2025, 5:20 PM