<@ULVA73B9P> how to deploy a flow without the source
a
@Marvin how to deploy a flow without the source
m
To deploy a flow without including the source code directly, Prefect allows you to use the
from_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:
Copy code
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.