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

Merge branch 'ws1405-casa_matrix_service_fix' into '2.8.4-DEVELOPMENT'

WS-1405 Fixed workflow unit tests

See merge request !1679
parents 53a428dc 20e9cdd5
No related branches found
No related tags found
2 merge requests!1706merge 2.8.4 to main,!1679WS-1405 Fixed workflow unit tests
Pipeline #16101 passed with warnings
Pipeline: workspaces

#16103

    ......@@ -30,7 +30,7 @@ edu.nrao.workspaces.ProcessingSettings.CasaVersion.vlass = /home/casa/packages/p
    edu.nrao.archive.archiveIface.casa_root = /home/ssa/casa
    edu.nrao.archive.archiveIface.allowDevCasaVersions = true
    edu.nrao.archive.workflow.config.CasaVersions = /home/casa/packages
    edu.nrao.archive.workflow.config.CasaVersions.homeForReprocessing = /home/ssa/casa/RHEL7/docker/casa-6.4.1-12-pipeline-2022.2.0.68
    edu.nrao.archive.workflow.config.CasaVersions.homeForReprocessing = /home/casa/packages/pipeline/current
    edu.nrao.archive.workflow.config.CasaVersions.homeForDownloads = /home/ssa/casa/RHEL7/docker/casa-release-5.3.0-143
    edu.nrao.archive.workflow.config.CasaVersions.homeForVlaRestore = /home/ssa/casa/RHEL6/docker/casa-pipeline-release-5.6.1-8
    edu.nrao.archive.workflow.config.CasaVersions.homeForAlmaRestore = /home/ssa/casa/RHEL7/docker/casa-6.4.1-12-pipeline-2022.2.0.64
    ......
    # 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