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

[Feature] Allow other WPS references in wps_processes.yml config file #149

Open
2 tasks
fmigneault opened this issue May 21, 2020 · 0 comments
Open
2 tasks
Assignees
Labels
process/wps1 Issue related to WPS 1.x processes support process/wps2 Issue related to WPS 2.x processes support process/wps3 Issue related to WPS 3.x (REST-JSON) processes support triage/feature New requested feature.

Comments

@fmigneault
Copy link
Collaborator

Context

When Weaver starts (or using CLI with #106), function weaver.processes.utils.register_wps_processes_from_config is called to process file wps_processes.yml (or equivalent). This file assumes WPS-1 processes since owslib.wps.WebProcessingService is used to call the specified URLs. WPS-2 are explicitly skipped (why? maybe parsing problem?).

After resolution of the processes from these URL, the corresponding WPS-REST and CWL definitions are generated following this call stack :

weaver.processes.utils._get_deploy_process_info
weaver.processes.wps_package.get_process_definition
weaver.processes.wps_package._generate_process_with_cwl_from_reference

Since _generate_process_with_cwl_from_reference already handles the WPS-1/2 vs WPS-REST formats to retrieve the details, we could easily extend register_wps_processes_from_config so that it supports any WPS reference.

Feature

  • Add support of the WPS-REST and WPS-2 references in register_wps_processes_from_config

  • Improvements for WebProcessingService calls, we can skip the re-fetch of the HTTP request like so:

    resp = requests.request("get", wps_url)
    wps = WebProcessingService(wps_url, skip=True)
    [detect wps-rest, eg: resp.json() has "process" section]
    if not wps_rest: 
        prefetched_xml  = resp.content # (or .text ?)
        wps.get_capabilities(xml=prefetched_xml)
    else :
        [process wps-rest]
    [...]
    
@fmigneault fmigneault added the triage/feature New requested feature. label May 21, 2020
@fmigneault fmigneault self-assigned this May 21, 2020
@github-actions github-actions bot removed the triage/feature New requested feature. label May 21, 2020
@fmigneault fmigneault added triage/feature New requested feature. process/wps1 Issue related to WPS 1.x processes support process/wps2 Issue related to WPS 2.x processes support process/wps3 Issue related to WPS 3.x (REST-JSON) processes support labels May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
process/wps1 Issue related to WPS 1.x processes support process/wps2 Issue related to WPS 2.x processes support process/wps3 Issue related to WPS 3.x (REST-JSON) processes support triage/feature New requested feature.
Projects
None yet
Development

No branches or pull requests

1 participant