cedadev / swallow

Swallow - a Birdhouse WPS for running the NAME Trajectory code.
Other
0 stars 1 forks source link

Docs: connecting a local WPS to the staging server UI #15

Open agstephens opened 2 years ago

agstephens commented 2 years ago
flamingo start --hostname 192.168.50.70 --port 5001

Does run it on that port on that server, as does --hostname 0.0.0.0 but can't see it in main browser.

Might need a solution to run the server and the client on separate servers. Just need to create a new server:

ceda-wps-ui-staging.ceda.ac.uk

agstephens commented 2 years ago

How to test WPS with UI on staging server

Staging server: ceda-wps-staging.ceda.ac.uk

Install the CEDA WPS UI using Ansible

We install Phoenix using our playbook on breezy: ceda-wps/phoenix-playbook.git

This will install with:

ansible-playbook -i inventories/ceda-wps-staging.yml \
    --vault-password-file=vault-password-ceda-wps \
    playbook.yml

Install the WPS

WPSNAME=swallow
cd /usr/local/src/
git clone https://github.com/cedadev/${WPSNAME}
cd ${WPSNAME}/

export PATH=/usr/local/Miniconda3-py39_4.9.2-Linux-x86_64/bin:$PATH
conda env create -f environment.yml
source activate ${WPSNAME}

Then use make to install and run:

make install
make start

This will start the service on: http://localhost:5000/wps

Register the WPS with the WPS UI

Go to admin on CEDA WPS UI (on staging server):

https://ceda-wps-staging.ceda.ac.uk/admin

Login and add the WPS here:

https://ceda-wps-staging.ceda.ac.uk/services/register

Use info:

Link up the output path URL and directory

Create/connect Phoenix to expose output directories

NOTE: These instructions work for vulture - not swallow

We can tell the Phoenix installation to provide access to the output directories by doing:

  1. Create a new file:
$ cat /usr/local/birdhouse/etc/nginx/conf.d/outputs.conf
server {
        listen                 80;
        server_name            ceda-wps-staging.ceda.ac.uk;

    location /outputs
    {
        alias /gws/nopw/j04/ceda_wps/birds/test/outputs/vulture;
        autoindex off;
    }
}
  1. And restart the phoenix service
# Logout and login again
ssh root@ceda-wps-staging...
source ./setup-env.sh
make restart

Then, this should work:

http://ceda-wps-staging.ceda.ac.uk/outputs/test.txt

Modify where test version of service is writing outputs

You might need to add these lines in vulture/cli.py:

diff --git a/vulture/cli.py b/vulture/cli.py
index 5053c08..cc7478f 100644
--- a/vulture/cli.py
+++ b/vulture/cli.py
@@ -202,6 +202,8 @@ def start(
             wps_log_level=log_level,
             wps_log_file=log_file,
             wps_database=database,
+            wps_outputurl="http://ceda-wps-staging.ceda.ac.uk/outputs",
+            wps_outputpath="/gws/nopw/j04/ceda_wps/birds/test/outputs/vulture"
         )
     )

and do:

vulture start -d --outputurl=http://ceda-wps-staging.ceda.ac.uk/outputs \
                         --outputpath=/gws/nopw/j04/ceda_wps/birds/test/outputs/vulture

Otherwise, the WPS will be using /tmp as its default output directory.

Test it - look at the UI form

Visit: https://ceda-wps-staging.ceda.ac.uk/processes

Click on the link, it will render a form for the process (if the describeprocess endpoint is working).