<@ULVA73B9P> is it possible to have a deployment p...
# ask-marvin
j
@Marvin is it possible to have a deployment pull code from a git repository rather than clone it? I have a single repository for dbt but nested inside that are different project folders, and I want to keep my Python scripts that run dbt cli commands in the project folders. The problem is that when I deploy from inside those folders it wants to clone the entire repository into the folder that already exists. I want to write all of my code locally, push it to github, go into my EC2 instance where the worker is, clone the repository, and run
prefect deploy
m
Based on both Prefect documentation and related issues on GitHub, it seems there are some limitations when working with nested directories in Git repositories for deployment. Here are some important points and a possible workaround for your scenario: 1. Git-based Code Storage: Prefect supports storing flow code in Git repositories, and deployments can be created from these repositories. However, this typically expects the deployment commands to be run from the root directory of the repository. Docs and Docs 2. Issue with Nested Paths: There are known issues when the flow code is stored in nested directories within the Git repository.
prefect deploy
expects the flow file path to be relative to the repository root, and running deployment from nested folders can cause path resolution issues. Issue 3. Workaround: Since you have a single repository with multiple project folders, you might need to structure the workflows to call the deployment commands from the root directory of the repository, specifying the relative path to the flow files. Here is a step-by-step suggestion: - Create a
prefect.yaml
file in the root directory of your repository, specifying the entry points for each flow in the nested folders. - Use relative paths in this configuration for the entry points to the flow scripts. - Run
prefect deploy
from the root directory, ensuring the paths in the deployment configurations point to the correct nested directories. Here is a simplified example of what the
prefect.yaml
might look like:
Copy code
yaml
deployments:
  - name: project-1
    entrypoint: project-1/flows/your_flow.py:flow_function
    parameters:
      param1: value1
    work_pool:
      name: your-work-pool
      work_queue_name: your-work-queue
    
  - name: project-2
    entrypoint: project-2/flows/another_flow.py:another_flow_function
    parameters:
      param2: value2
    work_pool:
      name: your-work-pool
      work_queue_name: another-work-queue
This way, you can manage different projects from a single repository without each deployment re-cloning the entire repository into the existing folders. You can find more in-depth examples and advanced setups in the Deployment Guide. If you continue facing issues or have a specific blocker, providing more details on the structure and errors can help in formulating a more precise solution.
j
@Marvin when trying to load a dbt CLI profile block, it fails due to a validation error. No other details are given, it just says to pass False to the validate parameter. What causes this?