You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

We well know that one example is worth a thousand words, therefore, we present you with a handful of examples illustrating various functionalities that can be used in your custom applications. Each of them can be copied and directly used in your workspace, and, later, modified to better suit your research.

Contents of this guide

This guide contains links to sample ready-to-use applications, that will help you understand different possibilities related to custom applications. Each sample application is described presenting the aspects of configuration it shows. The guide contains also an instruction on how to copy and use the sample applications for yourself.   

How to use the examples

Each example contains a link to the sample application within the Application Workbench. After accessing it, you will see a list of its files, where you can browse them (you will not be able to edit them at this point). If you decide you want to test this application in your workspace and later use it as a base for your own codes, use the Fork button in the right upper corner of the page (see Figure 1).   

Note that, to access and fork the sample applications you will have to log in to the Application Workbench first.

Figure 1. Page displaying sample application with Fork button marked

Upon this action, you will be able to decide on the name under which the application will be copied to your account (Repository Name, marked with (1) in Figure 2). You will be also able to add your custom description (Description, marked with (2) in Figure 2). 

Figure 2. Creating a new forked repository

After confirming with the Fork Repository button, your copy of the application repository will be created and presented to you. The copied application will have the same contents, therefore, the view will much resemble the original application (Figure 1). However, notice the change of the user name (the repository name may also be changed if you did that in the previous step) and the information that the repository is forked (marked in Figure 3). The button Fork will also be disabled as you cannot create another fork from a repository that already is a fork. You will also have more controls enabling management of your repository and edition of files.

Figure 3. Forked repository view

Since this moment you will be able to see the application also within My Apps Management tab in EPISODES Platform.

Figure 4. Forked sample application visible in My Apps Management tab within EPISODES Platform

The above means that you will also be able to use the application and run it in your workspace (see also Running your custom application guide) as it will appear within the Applications list in the EPISODES Platform (note, that it will be visible only as long as you are logged in).

Figure 5. Forked sample application visible in Applications list within EPISODES Platform 

Example 1 (Matlab/Octave)

Link to the application: https://epos-apps.grid.cyfronet.pl/tcs-test-user/MatlabSampleApp1

Programming language: the application is written in Octave programming language and configured to be run with Octave interpreter (settings underlined in Figure 6), however, it is also compatible with Matlab programming language and could be run with Matlab interpreter as well.

The application contains a simple code that plots a vector of double-precision numbers and returns it in a form of a PNG file - as demonstrated in Excerpt 1. This, however simple, code, to be correctly interpreted by the EPISODES Platform, requires a configuration, called Application Definition, which will tell the Platform how to transfer the input files to your application and what to do with the output files. Figure 6 shows the configuration used for this application, with input files definition marked with (1): one file of type double_vector, and output files definition marked with (2): one output file of type image_data and name vectorPlot.png, in PNG format. Thanks to this definition the interface of the application within the EPISODES Platform would allow you to add a double_vector file (e.g. a magnitude vector extracted from a Seismic Catalog with Catalog to Vectors converter) as input to the application, and will look for a file vectorPlot.png when the application finishes and transfer it to your workspace, where you will be able to display it - exactly as shown in Figure 7. Note, that if you change your code, so that it produces another file, it will be ignored by the system, unless you add it to the appDefiniotion.json. Similarly, to add another input to the application, you have to add it both to the application script and to the appDefinition.json file.

Note, that the configuration file presented here is generated by the EPISODES Platform through a dedicated wizard (see also Creating new application guide), therefore, it might be more verbose than necessary, but if you use this wizard, your file will look like this one. In the Application Definition file guide, you can find alternatives to the configuration elements that can make them simpler (and shorter) - an example of this is shown in rectangles in Figure 6 - both of the rectangles represent the same meaning as the part of code marked with (1).

function sampleApp(inVector)

    plot(inVector);
    print('-dpng', 'vectorPlot.png');

end

Excerpt 1. Content of the MatlabSampleApp1 application script

Figure 6. Content of appDefinition.json file from MatlabSampleApp1 application, with most important elements marked

Figure 7. MatlabSampleApp1 displayed and run in workspace with inputs and outputs marked

Example 2 (Matlab/Octave)

Link to the application: https://epos-apps.grid.cyfronet.pl/tcs-test-user/MatlabSampleApp2

Example 3 (Python)

Link to the application: https://epos-apps.grid.cyfronet.pl/tcs-test-user/PythonSampleApp

  • No labels