Skip to content
Snippets Groups Projects
Commit 20e9cdd5 authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Short readme about how to use the service (tried to not be too wordy

parent 44138d50
No related branches found
No related tags found
2 merge requests!1706merge 2.8.4 to main,!1679WS-1405 Fixed workflow unit tests
Pipeline #16098 passed
# CASA Version Matrix Service
The CASA version matrix is responsible for returning valid CASA + pipeline versions for processing as well as
maintaining our lists of installed and allowed versions for various capabilities.
## Getting valid versions
Each capability has a list of CASA versions that are tested and verified for use. These allowed versions are
cross-referenced against the installed versions in `/home/ssa/casa/` to get a full list of versions that are allowed for
processing with the given capability.
Examples of using the service to get a single version or a list of versions (the version name(s) and full path(s) are
in the response body):
```python
import requests
prefix = 'http://capability:3457/casa_matrix/'
# Single version (telescope optional), gives the preferred version from CAPO
r = requests.get(prefix + 'version', json={'capability': 'restore_cms', 'telescope': 'alma'})
print(r.json())
# Single version, returns the given version if it's valid
r = requests.get(prefix + 'version', json={'version': '6.4.1-12|2022.2.0.68'})
print(r.json())
# List of versions with the preferred version first in the list
r = requests.get(prefix + 'versions', json={'capability': 'restore_cms'})
print(r.json())
```
## Getting CASA recipes
Each capability has a `casa_recipe` field that can be obtained via the service.
Example:
```python
import requests
prefix = 'http://capability:3457/casa_matrix/'
r = requests.get(prefix + 'recipe', json={'capability': 'restore_cms'})
print(r.json())
```
## Refreshing installed versions
We maintain a list of symlinks to usable CASA + pipeline versions to filter out CASA packages that do not have a
corresponding pipeline. Our symlinks are in `/home/ssa/casa/` and link to CASA's managed installations in
`/home/casa/packages`. It is recommended to point all WS activities (e.g. workflows, capabilities) to our managed
symlinks.
Example of using the service to refresh the installed version links:
```python
import requests
requests.post('http://capability:3457/casa_matrix/links')
```
## Managing allowed versions
Each capability has a list of CASA versions that are allowed for processing. These are maintained in the `casa_matrix_*`
DB tables.
Examples of using the service to add/update/delete versions from the tables:
```python
import requests
url = 'http://capability:3457/casa_matrix/db/version'
# Add
requests.post(url, json={'version': '2.2.2', 'is_cluster_compatible': False, 'capabilities': ['curator', 'download']})
# Update
requests.put(url, json={'version': '2.2.2', 'is_cluster_compatible': True, 'capabilities': ['restore_cms', 'std_cms_imaging']})
# Delete
requests.delete(url, json={'version': '2.2.2'})
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment