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

Create a new priority scoring consumable resource #354

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

apmasell
Copy link
Contributor

@apmasell apmasell commented Feb 13, 2024

Adds a new consumable resource that can collect data from other systems and then score the data to decide whether a job should launch.

Jira ticket:

  • Includes a change file
  • Updates developer documentation

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this PR assuming the removal of the ca.on.oicr.gsi.vidarr.server.PriorityByWorkflow class? That seems logical to me and if not there will be a conflict for key priority.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it seems they do. Up to you. I can rename either of them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong preference for renaming either one or the other. Whichever seems more logical :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I've talked to Alexis and we're going with delete.

Copy link
Contributor

@grapigeau grapigeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will also have to be removed from Main: private final PriorityByWorkflow priorityPerWorkflow = new PriorityByWorkflow();
*Meant to comment above. Re: removing the PriorityByWorkflow

@apmasell
Copy link
Contributor Author

Okay. I think the deletion is complete now.

plugin-guide.md Outdated
@@ -211,6 +211,25 @@ to filter on runs. A filter could query Pinery and get all the external
identifiers associated with that run and then construct a query based on those
to match workflow runs that use any of those identifiers.

# Priority Consumable Resource Inputs, Formulas, and Scorers
The priority consumable resource takes plugins for the inputs, formulas, and
scorers. This follows the same pattern as the other plugins: an implementation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the first time 'formula' and 'scorer' appears in this document, so I'm not sure what these are, or what other plugins use them?

plugin-guide.md Outdated
@@ -273,6 +292,36 @@ active.
}
```

### Priority Consumable Resource
The priority consumable resource resource operates by computing a number, a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"resource resource"

plugin-guide.md Outdated
based on that number.

The resource first takes data from the submission request and then
implmentations of `PriorityInput` consume this data and produce a numeric
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implmentations -> implementations

plugin-guide.md Outdated
This can be limited to a particular input type format.

## Remote
Allows input to be requested from a remote service via a JSON payload.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this meant to be a subsection of 'Input Provisioner'?

plugin-guide.md Outdated
The `"schema"` property defines a type, including an object types, that will be
required on submission. The data provided by the submission will be send via
`POST` request as the body to the URL provided. The endpoint must respond with
an integer for the priority or null to use the default priority. The result
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this feature specifically for the priority consumable resource?

plugin-guide.md Outdated
```

### JSON Dictionary
Takes input as a string and lookups up the value of that in a dictionary. If
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"lookups up"

plugin-guide.md Outdated
3. All the records that were returned by the query are scanned for a matching
label set.
4. If a matching label set is found, the last recorded value will be used,
regardless of when Prometheus obeserved it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obeserved -> observed

plugin-guide.md Outdated
Priority scorers provided in Víðarr core.

### All Of
Checks serveral priority scorers and allows permits the workflow run to proceed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serveral -> several

plugin-guide.md Outdated

### All Of
Checks serveral priority scorers and allows permits the workflow run to proceed
if all scorers allow it proceed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow it to proceed?

plugin-guide.md Outdated
among the top 20 workflow run in their respective workflow type.

### Any Of
Checks serveral priority scorers and allows permits the workflow run to proceed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serveral -> several

plugin-guide.md Outdated

### Any Of
Checks serveral priority scorers and allows permits the workflow run to proceed
if any scorer would allow it proceed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow it to proceed

plugin-guide.md Outdated

```
{
"type": "subtract",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The others are 'product' and 'sum', should this one be 'difference' for consistency?

@apmasell
Copy link
Contributor Author

Fixed all the concerns.

plugin-guide.md Outdated
### Remote Input
Takes an arbitrary JSON value and sends it to remote HTTP endpoint for
evaluation. That endpoint must return a single number. The result will be
cached. The `"schema"` is a stanadard Víðarr type that should be requested from
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one appears to be outstanding

plugin-guide.md Outdated
```

The `"schema"` property defines a type, including an object types, that will be
required on submission. The data provided by the submission will be send via
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will be send -> sent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what's outstanding here. There's only one Remote Input now.


```
{
"type": "oneOf",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is everything like-this except that this one is likeThis ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Historical reasons. I'm not sure if I should change them all to kebab case.

}

@Override
public int priority() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This priority is different than the job prioritys that the ConsumableResource manages, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right.

Adds a new consumable resource that can collect data from other systems and
then score the data to decide whether a job should launch.
@avarsava avarsava merged commit af69310 into oicr-gsi:master Mar 6, 2024
1 check passed
@apmasell apmasell deleted the priority_lookup branch March 6, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants