Skip to content

Hooks and overlays

Two optional additions to the dag. A hooks file runs steps before or after a node's publish. An overlay splits one workspace's publish into ordered nodes.

Hooks

fab deploy publishes item definitions and nothing else. A hooks file lists the steps that do the rest: run a notebook, refresh a model, call a REST endpoint. The dag node that names the file says whether the steps run before or after its publish. A step's action is one of the hooks allez ships, or a Python file of your own in .allez/hooks/.

├── 📁 .allez/                              # (1)!
│   └── 📁 hooks/
│       └── 📄 seed_table.py                # (2)!
└── 📁 fabric/
    ├── 📄 allez.yml
    └── 📁 data/
        ├── 📁 .deploy/                     # (3)!
        │   └── 📁 hooks/
        │       └── 📄 ingest.hooks.yml     # (4)!
        └── ...
  1. allez's folder, beside fabric/, not inside it.
  2. Optional custom Python hook, run by the step whose action names it.
  3. Deployment support files. Not an item folder.
  4. Hook steps run by a dag node.
fabric/data/.deploy/hooks/ingest.hooks.yml
version: 1
steps:
  - name: Run the ingestion notebook until it finishes
    action: run_notebook
    item: <Name>.Notebook
    timeout_seconds: 900
fabric/allez.yml
dag:
  - config: data/config.yml
    post_deploy_hooks: [data/.deploy/hooks/ingest.hooks.yml]
  - config: reporting/config.yml
    depends_on: [data/config.yml]

Hooks run on every deploy, including a rollback, so a step must be safe to repeat. Full reference: hooks files and the hooks.

Overlays

fabric-cicd publishes a workspace's items in a fixed order. To publish part of a workspace first, add a partial config under .deploy/config-overlay/ and list it as a dag node. allez merges it over the folder's config.yml and passes the result to fab deploy as params. The committed config.yml is never edited.

└── 📁 fabric/
    ├── 📄 allez.yml
    └── 📁 reporting/
        ├── 📄 config.yml
        ├── 📁 .deploy/
        │   └── 📁 config-overlay/
        │       ├── 📄 model.config.yml     # (1)!
        │       └── 📄 rest.config.yml      # (2)!
        └── ...
  1. Narrows the publish to the model.
  2. Everything else, in fabric-cicd's own order.
fabric/reporting/.deploy/config-overlay/model.config.yml
core:
  item_types_in_scope: [SemanticModel]
fabric/allez.yml
dag:
  - config: data/config.yml
  - config: reporting/.deploy/config-overlay/model.config.yml
    depends_on: [data/config.yml]
  - config: reporting/.deploy/config-overlay/rest.config.yml
    depends_on: [reporting/.deploy/config-overlay/model.config.yml]

An overlay never changes which workspace a folder publishes to; only config.yml says that. Full reference: overlays.