Adrien Besnard
02/08/2024, 4:41 PMAdrien Besnard
02/08/2024, 4:44 PMload_source(name: str)
flow with multiple deployments (like load-source/crm
, load-source/erp
, which leverage on the name
parameter, etc.) but I have the feeling that it's not very clean:
• Either the load_source
function become bloated because it should handle all the source `name`s
• Either the load_source
function delegate everything to my internal Python library that does the heavywork and it becomes an empty shellAdrien Besnard
02/08/2024, 4:45 PMRobin Niel
02/08/2024, 4:47 PM[[flows]]
name="facebook-comments-last-3-days-daily"
cron="30 4 * * *"
parameters={ "time_interval"="last_3_days"}
module="flows.facebook.fb_comments"
flow_function="facebook_get_comments_flow"
tags=["facebook", "comments"]
description="Get comments from Facebook active publications (less than 3 days old) every day"
Robin Niel
02/08/2024, 4:48 PMAdrien Besnard
02/08/2024, 4:49 PMRobin Niel
02/08/2024, 4:49 PMAdrien Besnard
02/08/2024, 4:50 PMprefect.yaml
directly and prefect --no-prompt deploy --all
Adrien Besnard
02/08/2024, 4:51 PMprefect.yaml
looks like this:
name: metabase-reports
prefect-version: 2.13.4
pull:
- prefect.deployments.steps.set_working_directory:
directory: "/usr/lib/data-platform/prefect/"
deployments:
- name: integrate-crm
version: "{{ $VERSION }}"
description: |
Integrate CRM to the Staging layer of the Lakehouse
flow_name: null
entrypoint: ./flows/integrate_crm.py:integrate_crm
parameters: {}
work_pool:
name: default
job_variables:
image: "{{ $DOCKER_REGISTRY }}/{{ $DOCKER_REPOSITORY }}:{{ $DOCKER_TAG }}"
Robin Niel
02/08/2024, 4:56 PMAdrien Besnard
02/08/2024, 4:58 PMprefect.yaml
. But you'll loose the possibility to run a single command to deploy everything... So I don't think we can do what you want with YAML files only 😓Adrien Besnard
02/08/2024, 5:24 PMRobin Niel
02/08/2024, 5:25 PMdef get_deployment(self, work_pool_name, is_schedule_active):
source_module = importlib.import_module(self.__module)
flow_function = getattr(source_module, self.__flow_function)
return flow_function.to_deployment(
name=self.__name,
tags=self.__tags,
parameters=self.__parameters,
cron=self.__cron,
description=self.__description,
work_pool_name=work_pool_name,
is_schedule_active=is_schedule_active,
)
Adrien Besnard
02/08/2024, 5:30 PMRobin Niel
02/08/2024, 5:31 PMAdrien Besnard
02/08/2024, 5:33 PMAdrien Besnard
02/08/2024, 5:33 PMRobin Niel
02/08/2024, 5:36 PM