Skip to content

service for workflow lifecycle management #781

Description

@oliver-sanders

A UIS / Hub service for managing workflow runs.

At present, Cylc workflows are manually started, manually monitored throughout the life of the workflow, manually updated (cylc vr) when changes are made, until they are manually stopped when no longer needed.

While this approach will continue for high-stakes deployments where such oversight is desirable/necessary, today's increasingly automated work patterns don't always fit this model. It would be convenient if Cylc itself could provide some level of automation over the management of the lifecycle of workflows to better suit CD working patterns for lower-stakes, more hands-off deployments.

For example, a workflow's lifecycle might look like this:

  1. Checkout a working copy of a workflow (git clone ... ~/cylc-src/my-workflow).
  2. Start it (cylc vip).
  3. Update working copy with changes (git pull upstream/main).
  4. Apply changes (cylc vr).
  5. Stop workflow (cylc stop).

An alternative, approach to this might be:

  1. Register a workflow repository with the UIS.
  • Working copy automatically checked out.
  • Repository automatically monitored for changes, and updated live.
  • Workflow automatically restarted if it were ever to go down (e.g, critical infrastructure failure).
  1. Unregister the workflow with the UIS.
  • Workflow automatically stopped, run archived and working copy removed.

This could potentially be orchestrated via a REST API (convenient for making one-off changes), or via a configuration file (convenient for more infrastructure as code type solutions), e.g:

workflows:
  - repo: github.com/my-company/my-workflow
    name: local
    options:
      template variables:
        - mode: operational
        - archive: true
        - domain: regional-atmos

  - repo: github.com/my-company/my-workflow
    name: global-atmos
    options:
      template variables:
        - mode: operational
        - archive: true
        - domain: global

  - repo: github.com/user/research-workflow
    name: test/trial
    options:
      optional configs:
         - mode-research
         - site-my-site
         - grid-n1234

In conventional deployments, the lifecycle of the deployment is effectively coupled to the lifecycle of the VMs. In more cloudy deployments, lifecycle is coupled to that of the containers it orchestrates, the longest-lived of which is the Hub/UIS.

As such, the Hub/UIS becomes the top-level service (the thing the people running the orchestration need to ensure is always running when needed) making it the more natural place for such functionalities to lie.

implementation pros cons
Hub Service
  • Always running
  • Per-deployment not per-user (requires authorisation)
  • Cloud deployments are generally single-user, so might not use the hub at all
UIS Service
  • Per-user (authentication easy, existing configuration file)
  • Would require an external service (e.g, a hub service) to ensure the UIS is always running (note hub-less deployments will already have this)

Related / upstream issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFlag this as a question for the next Cylc project meeting.

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions