Skip to content

Config param to choose task distribution logic #124

Closed

Description

@uniqueg

Check #119 (comment) for context.

A good solution would keep the middleware handler truly generic. Each middleware should follow one of a number of abstract signatures. At least the following ones should be covered:

  1. Change the request itself (tesTask in, tesTask out)
  2. Change the request destination, i.e., task distribution logic: tesTask and list of known TES instances in, ranked list of TES instances out

The user would then list a number of middleware functions (either part of proTES or external ones) in the config, for these two (and possibly other, if we can think of any) signatures/sections. The handler would then apply these in the listed order. For example:

middleware:
    mutate_request:  # signature 1. above
        - some_external_middlware.harmonized_tes_requests
        - some_external_middlware.tes_v1_0_0_to_v1_1_0
    mutate_destination:  # signature 2. above
        - some_external_middleware.discard_unauthorized_tes_instances
        - pro_tes.middleware.task_distribution.distance

Here, the handler would mutate the request by first harmonizing incoming requests, then converting any v1.0.0 requests to v1.1.0 (obviously, these are just examples of what middleware could hypothetically do). The handler would also set the destination by first discarding any TES instances that the user anyway doesn't have access to, then use the built-in distance task distribution logic to find the available/accessible TES that is closest to the input data.

Ideally, the handler would also check that the signature of the provided functions fit.

Other than that, there should be no specific logic in the handler (which there currently is), and no mention of any specific, hard-coded middleware (which there also is).

It might be useful to check if/how abstract classes/interfaces are done in Python to specify and validate the function signatures.

Activity

  1. added
    priority: high
    type: feature
    workload: days
    on Mar 8, 2023
  2. self-assigned this
    on Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: hightype: featureworkload: days

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions