https://prefect.io logo
c

Chris Gunderson

08/10/2023, 4:27 PM
Hi Prefect Team - I have a question on using blocks in the prefect.yaml file for deployments.
Copy code
prefect-version: 2.10.20
name: analyst-operations-qep-yaml # ex: position-pnl-pipeline-yaml

pull:
    - prefect.deployments.steps.git_clone:
        repository: <https://github.com/***/***-***.git>
        branch: "main"
        credentials: "{{ prefect.blocks.github-credentials.sra-service-account }}"

definitions:
    work_pools:
        ecs_work_pool: &ecs_work_pool
            name: "{{ prefect.blocks.string.ecs-work-pool }}"
            work_queue_name: default
            job_variables:
                image: "*****.<http://dkr.ecr.us-east-2.amazonaws.com/py310-base:0.0.3|dkr.ecr.us-east-2.amazonaws.com/py310-base:0.0.3>" 

        ny4_work_pool: &ny4_work_pool
            name: "{{ prefect.blocks.string.ny4-work-pool }}"
            work_queue_name: default
            job_variables:
                image: "****.<http://dkr.ecr.us-east-2.amazonaws.com/py310-base:0.0.3|dkr.ecr.us-east-2.amazonaws.com/py310-base:0.0.3>" 

deployments:
    - name: Set QEP Status
      description: null # optional
      entrypoint: QEP/setQEPstatus.py:set_qep_status 
      work_pool: *ecs_work_pool
      parameters: {} # optional parameters overrride here
      schedule:
        cron: "1 19 * * *"
        timezone: "America/Chicago"
This is the error we receive: This deployment configuration references work pool '{{ prefect.blocks.string.ecs-work-pool }}' which does not exist. This means no worker will be able to pick up its runs. You can create a work pool in the Prefect UI. When we just add the name it works fine, but we want to make it dynamic based on the block in each workspace.
The block value and the work pool name are the same, so I'm not sure why this error is occurring
a

alex

08/11/2023, 2:56 PM
Thanks for raising this @Chris Gunderson! Looks like blocks aren’t currently resolved in that section of the
deployment.yaml
. I’ll open up an issue and we’ll work on fixing that.
🙌 1
c

Chris Gunderson

08/11/2023, 2:57 PM
Thanks Alex.
3 Views