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

Add documentation on backend selection with load_collection property filtering #58

Merged
merged 3 commits into from
Feb 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions federation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,62 @@ only either ARD processes **or** "standard" processes can be used in one process
is not yet supported. One option to nevertheless achieve a combination of process types is to run ARD on Level-1 data,
save the results of the job, and then in a second job load results and perform additional computations.

### Enforce back-end selection for common collections

Some collections are provided by multiple underlying back-ends,
possibly with differences in spatial or temporal coverage.
This is exposed in the collection metadata with `federation:backends` summary, e.g.:

```json
{
"id": "WATER_BODIES",
"type": "Collection",
...
"summaries": {
"federation:backends": ["vito", "sentinelhub"],
...
}
}
```

When a user submits a processing request,
the federated platform will try, by default, to automatically determine
which underlying back-end is best choice for the actual processing,
based for example on the requested spatial extent.

You can however also enforce the selection of a certain back-end
by using the metadata property filtering feature
of the `load_collection` process.
For example, with the Python client, to enforce the selection of
the "sentinelhub" back-end:

<CodeSwitcher :languages="{py: 'Python', r: 'R'}">
<template v-slot:py>

```python
soxofaan marked this conversation as resolved.
Show resolved Hide resolved
cube = connection.load_collection(
"WATER_BODIES",
...
properties: {
"federation:backends": lambda v: v == "sentinelhub"
}
)
```

</template>
<template v-slot:r>

```r
cube = p$load_collection(
id = "WATER_BODIES",
...
properties = list("federation:backends" = function(x) x == "sentinelhub")
)
```

</template>
</CodeSwitcher>

## Processes

Each of the underlying back-ends of the federation can define its own set of available processes,
Expand Down