https://prefect.io logo
e

Emma Rizzi

08/23/2023, 1:51 PM
room 6
@Jens Cardon heres an example of deployment that uses a variable for work pool definition + multiples schedules prefect-version: 2.10.18
Copy code
definitions:
    work_pools:
        wekeo-pool: &wekeo-pool
          name: wekeo-pool
          work_queue_name: wekeo
          job_variables:
              image: '{{ build_image.image }}'

build:
- prefect_docker.deployments.steps.build_docker_image:
    id: build_image
    requires: prefect-docker>=0.3.0
    image_name: murmurationsas/orion
    tag: flow-
    dockerfile: Dockerfile
    push: True
    credentials: "{{ prefect.blocks.docker-registry-credentials.docker-hub }}"

pull:
- prefect.deployments.steps.set_working_directory:
    directory: /opt/prefect/flow/

deployments:
  - name: compounds_europe_scheduledDaily
    tags:
      - indicators
      - scheduled
    description: Fetch hourly coumpounds on europe
    entrypoint: air_quality_compounds.py:main_compounds
    work_pool: *wekeo-pool
    schedule: 
      cron: 0 4 * * *
      timezone: Europe/Paris
    parameters: {
      "chunks": {"time":51,"latitude":50,"longitude":175},
      "coverage": "europe",
      "west": -25,
      "east": 45,
      "north": 70,
      "south": 30
    }

  - name: indices_france_scheduledDaily
    tags:
      - indicators
      - scheduled
    description: 
    entrypoint: air_quality_indices.py:main_indices
    work_pool: *wekeo-pool
    schedule: 
      cron: 0 5 * * *
      timezone: Europe/Paris
    parameters: {
      "bbox4indices": [-5.98, 41.17, 10.07, 51.63]
    }
🦜 2
j

Jens Cardon

08/23/2023, 3:52 PM
excellent, tnx!