Alex Rodriguez
01/04/2024, 10:21 PMfrom prefect.runner.storage import GitRepository
from prefect_github import GitHubCredentials
from prefect import flow
if __name__ == "__main__":
github_credentials_block = GitHubCredentials.load("<block_name>")
flow.from_source(
source=GitRepository(
url="<my_private_repo>",
branch='main',
credentials={
"access_token": github_credentials_block.token.get_secret_value()
}
),
entrypoint="flow_file.py:flow_name"
).deploy(name="test-flow", work_pool_name="windows", build=False)
When I run this code to deploy, I get the following error: ValueError: Work pool 'windows' does not support custom Docker images. Please use a work pool with an image
variable in its base job template.
If I don't want my code to run in a docker image and run as a subprocess, how should I change my code?Nate
01/04/2024, 11:06 PMserve
from prefect.runner.storage import GitRepository
from prefect_github import GitHubCredentials
from prefect import flow
if __name__ == "__main__":
github_credentials_block = GitHubCredentials.load("<block_name>")
flow.from_source(
source=GitRepository(
url="<my_private_repo>",
branch='main',
credentials={
"access_token": github_credentials_block.token.get_secret_value()
}
),
entrypoint="flow_file.py:flow_name"
).serve(name="test-flow")
Nate
01/04/2024, 11:07 PMpython your_script.py
, this will effectively do what the Process worker would do, that is, poll for scheduled / triggered runs of your deployed flow and then execute themNate
01/04/2024, 11:07 PM.deploy
is meant for containerized deploymentsAlex Rodriguez
01/05/2024, 3:16 PMAj Floersch
02/07/2024, 4:43 PM.deploy()
. So far I have just been using the CLI deploy
command to achieve this, however, it's a bit more cumbersome and the ability to version the deployment configurations on a per flow basis would be helpful.Aj Floersch
02/07/2024, 4:48 PM.serve
because it's very helpful being able to monitor groups of flows (by work-pool) in the UI.Nate
02/07/2024, 4:53 PMserve(*my_deployments)
we have this issue for tracking nowAj Floersch
02/07/2024, 4:57 PM