Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing a subscription API for autonomous task scheduling #11779

Merged
merged 31 commits into from
Jan 31, 2024

Commits on Jan 22, 2024

  1. init task engine

    zzstoatzz committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    083fe2d View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2024

  1. Configuration menu
    Copy the full SHA
    bdc2a1d View commit details
    Browse the repository at this point in the history
  2. exploring task engine

    zzstoatzz committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    768ed79 View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2024

  1. change name

    zzstoatzz committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    52e5bf8 View commit details
    Browse the repository at this point in the history
  2. add _not_ task runner

    zzstoatzz committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    69f8bf6 View commit details
    Browse the repository at this point in the history
  3. background

    zzstoatzz committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    57eaefb View commit details
    Browse the repository at this point in the history
  4. rm comment

    zzstoatzz committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    0fc1d12 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f2cd571 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2024

  1. init init task server

    zzstoatzz committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    26214c0 View commit details
    Browse the repository at this point in the history
  2. wip

    zzstoatzz committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    e32dbae View commit details
    Browse the repository at this point in the history
  3. rm breakpoint

    zzstoatzz committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    dee5d4e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ea6d5b3 View commit details
    Browse the repository at this point in the history
  5. task parameters in storage (#11736)

    Co-authored-by: Nathan Nowack <thrast36@gmail.com>
    chrisguidry and zzstoatzz committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    77a55df View commit details
    Browse the repository at this point in the history
  6. run pre-commits

    zzstoatzz committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    5fd8ffb View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2024

  1. track task run params in state details to avoid quantum entanglement (#…

    …11737)
    
    Co-authored-by: Chris Guidry <chris.g@prefect.io>
    abrookins and chrisguidry committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    9c4ef1b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e74e3c1 View commit details
    Browse the repository at this point in the history
  3. update logging

    zzstoatzz committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    d854a69 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'init-task-engine' of https://github.com/PrefectHQ/prefect

    … into init-task-engine
    zzstoatzz committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    2bc96f4 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2024

  1. add some basic tests

    zzstoatzz committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    633f5fb View commit details
    Browse the repository at this point in the history
  2. add docstring

    zzstoatzz committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    62786f3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1684731 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    596c150 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7aae491 View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2024

  1. Configuration menu
    Copy the full SHA
    3303016 View commit details
    Browse the repository at this point in the history
  2. Introducing a subscription API for autonomous task scheduling

    In earlier work, we've introduced autonomous task scheduling, where tasks
    outside a flow run are created as scheduled and picked up by one or more
    processes running `Task.serve`.  In our initial implementation, we used a
    polling approach where each `TaskSever` would make requests from the API to
    look for any tasks that were currently `Scheduled`, and then move them to
    `Running` as they entered the task engine.
    
    This work introduces a new mechanism for `TaskServer`s to get work from their
    Prefect Server: a long-lived websocket connection subscribed to a queue of
    `TaskRun`s to be worked.  Because the Prefect Server is a singleton, it can
    govern a queue in-memory that will be distributed out among each of the
    `TaskServer`s to make a simple task brokering system.
    
    The websocket implementation is modeled on the `events/in` and `events/out`
    websockets in Prefect Cloud, and it's expected that we'd negotiate
    authentication in a common way across all websockets.
    
    Note: this does not address issues of resiliency, like what happens if the
    Prefect Server is restarted (in-flight tasks would be lost), or if there are
    no `TaskServer`s draining the Queue (the Prefect Server would eventually run out
    of memory), or if a `TaskServer` died before transitioning a task to `Running`
    (the task would remain `Scheduled` and never get picked up).  These are some
    of the items I'd like to address in future work if we like this direction.
    
    Note: there are no tests for this new subsystem yet.
    chrisguidry committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    d678199 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2024

  1. Configuration menu
    Copy the full SHA
    6a13bbe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    366ef46 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    254a89f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4f7f581 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6ee16c0 View commit details
    Browse the repository at this point in the history
  6. Removing earlier sketch

    chrisguidry committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    d7035c9 View commit details
    Browse the repository at this point in the history