Arnaud
02/28/2024, 4:09 PMMarvin
02/28/2024, 4:09 PMfrom_source
method, which lets you pull flows from a remote location at runtime.
Here is an example from the Prefect documentation on how to utilize the from_source
method:
python
from prefect import deploy, flow
@flow(log_prints=True)
def local_flow():
# ... flow definition ...
# ... Any additional local flow definitions ...
if __name__ == "__main__":
deploy(
local_flow.to_deployment(name="local-flow-deploy"),
your_flow_from_source.to_deployment(
name="remote-flow-deploy",
from_source="git+<https://github.com/your-username/your-repo.git#egg=your_flow&subdirectory=path/to/flow/file>"
)
# ... additional deployment parameters as needed ...
)
In this example, one flow is defined locally (local_flow), while another flow (your_flow_from_source) is defined in a remote repository, which Prefect will pull at runtime. You can specify the remote location using a URL format compatible with the git source.
For further details, please check out the Prefect documentation here:
- Prefect Deployments Guide
- Prefect Blog on Global Coordination Plane
Deploying a flow with a YAML file offers a CLI workflow and also transforms the experience of working with Prefect in continuous integration (CI) setups. Users can potentially add workflows to their workspaces entirely from the UI by pointing at a known storage location and choosing a compatible infrastructure type.Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by