|
Part 4 - Upload and run your own processor
In this section, we learn how to integrate a new processor on the CTEP.
Suitable processors include:
- Linux executables
- shell scripts
- python scripts Other script languages can be supported, please contact us if you have a specific need.
In a first step, we start with a very basic shell script which adds two integers and returns the result in a text file. This example illustrates how the integration mechanism works.
The shell script is the following:
The script has to start with #!/bin/sh
. Notice that it has two input variables $1
and $2
and that output results are placed in the CTEP_OUTPUT_DIR
folder. The last point is important: this will allow the CTEP to know where to retrieve the processing results.
To upload the processor, create a targz archive with this file. Assuming the file is called proc1.sh
, the command is
tar cvzf proc1.tar.gz proc1.sh
.
Now we need to create new processor on the CTEP and define its parameters. Go to the uploading processor interface https://coastal-tep.eo.esa.int/wps/ui/#/ and click on the New button.
5. You will now define your processor parameters. First you will see the Info panel. Enter a name and a short description for your processor. (You can share it with other users).
6. Go to the Inputs panel and define your parameters (name and type). Press the Add Input button to add parameters.
7. Go to the execution panel and enter the path of your processor. Then create it!
8. Click on All Processors menu and refresh the page.
9. Your processor is waiting for a binary.
10. Click on the Upload button and select your compressed file.
11. Your processor is building. Please refresh the page.
12. Your processor is now ready.
13. Return to the geobrowser interface: https://coastal-tep.eo.esa.int/geobrowser/. In the processor panel you will now see your processor.
14. Enter the values of input parameters. And execute your job.
15. After few minutes, your process should be done.
16. Go now to the Interactive Application Service to see your results.
17. Open an Ubuntu virtual machine by clicking on Start new.
18. Click on Start container.
19. And connect to the machine.
20. You should see the following result. Click on the file manager button.
21. Go in your basket folder.
22. Choose the folder corresponding to your last job.
23. You can see two files: the output of your process and the associated log.
24. Click on the result file and open it with the application of your choice.
25. For example LibreOffice.
26. Congratulations! You have processed your first job on the CTep!
27. You can also have a look on the log file.
|