Stas Grinberg
08/10/2024, 10:48 AM# pull section allows you to provide instructions for cloning this project in remote locations
pull:
- prefect.deployments.steps.git_clone:
repository: <https://github.com/EdgeGamingGG/data-infra-feature-store.git>
branch: "{{ prefect.variables.github_branch }}"
access_token: '{{ prefect.blocks.secret.github-token }}'
Marvin
08/10/2024, 10:48 AMgit_clone
and potentially set_working_directory
steps in the pull
section.
Here's an example of what your prefect.yaml
could look like:
pull:
- prefect.deployments.steps.git_clone:
repository: <https://github.com/EdgeGamingGG/data-infra-feature-store.git>
branch: "{{ prefect.variables.github_branch }}"
access_token: "{{ prefect.blocks.secret.github-token }}"
- prefect.deployments.steps.set_working_directory:
directory: "path/to/specific/folder"
Ensure that "path/to/specific/folder"
is the relative path to the folder you want to set as the working directory after cloning the repo.
For more details, refer to the "The pull action" section in the Prefect documentation: https://docs.prefect.io/latest/guides/prefect-deploy/.Stas Grinberg
08/10/2024, 11:01 AM# Copy the entire project directory (assuming your project structure is set up correctly)
COPY . /opt/prefect/flows/
Marvin
08/10/2024, 11:02 AMdockerfile
COPY . /opt/prefect/flows/
Here's a basic structure for your Dockerfile:
dockerfile
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /opt/prefect
# Copy the requirements file into the container at /opt/prefect
COPY requirements.txt /opt/prefect/
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire project directory to /opt/prefect/flows
COPY . /opt/prefect/flows/
# Command to run the flow script when the container starts
CMD ["python", "flows/my_flow_script.py"]
Remember to replace flows/my_flow_script.py
with the actual path to your flow script.
For more details, you can refer to the Prefect Docker guide: https://docs.prefect.io/latest/guides/docker/.