Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. Create a folder (ex: SciGaP) in a preferable location in your local machine to download the PHP samples from https://dist.apache.org/repos/dist/dev/airavata/0.13/RC0/. 
  2. In the given location download the apache-airavata-php-sdk-0.13-SNAPSHOT-bin.tar.gz
  3. Open the folder which contains the PHP sample scripts. 
    SciGaP → airavata/apache-airavata-php-sdk-0.13-SNAPSHOT/php-cli-samples
  4. client-samples  folder contains PHP scripts to exercise currently existing Airavata API methods;
      1. GetAPIVersion.php (a sanity check) 
      2. createProject.php
      3. updateProject.php
      4. getAllUserProjects.php
      5. createExperiment.php
      6. getExperiment.php
      7. updateExperiment.php
      8. cloneExperiment.php
      9. getAllExperimentsInProject.php
      10. getAllUserExperiments.php
      11. search_experiments_by_name.php
      12. search_experiments_by_description.php
      13. search_experiments_by_application.php
      14. launchExperiment.php
      15. terminateExperiment.php 
      16. getExperimentStatus.php
      17. getExperimentOutputs.php
      18. registerComputeResource.php
      19. getAllComputeResourceNames.php
      20. getComputeResource.php

      21. deleteComputeResource.php

      22. registerApplicationModule.php
      23. getApplicationModule.php
      24. getApplicationDeployedResources.php
      25. registerApplicationInterface.php
      26. updateApplicationInterface.php
      27. getAllApplicationInterfaceNames.php
      28. deleteApplicationInterface.php
      29. getAvailableAppInterfaceComputeResources.php
      30. registerApplicationDeployment.php
      31. getApplicationDeployedResourcesgetApplicationDeployment.php
      32. getApplicationInputs.php

      33. getApplicationOutputs.php
      34. deleteGatewayComputeResourcePreference.php
      35. getGatewayComputeResourcePreference.php
      36. airavata-client-api-tester.php
  5. Apart for the scripts for the API methods the folder contains;
    1. getAiravataClient.php - This script is referred by all other scripts to obtain Airavata client. Not for stand alone execution.
    2. README.txt - Gives an introduction to the scripts and also reference links to wiki pages with command line script execution information
  6. Navigation to working directory; 
    cd SciGaP/airavata/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples

...

  1. Create an experiment with above created project using createExperiment.php script. When creating experiment User, Experiment name and Project ID (username, experiment_name, project_ID) are passed as arguments to the script.
    1. Format;
      php createExperiment.php<space><username><space><experiment_name><space><project_ID>
  2. Changing other parameters require opening the script and modifying and saving values inside the script. 
    Sample values;

     

    Parameter

    Sample Values

    NOTE

    Project ID

    PHP_EXP1_17a34aa5-68cb-41e6-b189-dc94548660a6

    Project iD is validated against existing projects

    Passed as an argument to the script

    Creating User

    Donald

    Users are validated against existing Airavata gateway users.

    Passed as an argument to the script

    Experiment Name

    PHP_EXP

    Not a unique value. Use can enter any value

    Passed as an argument to the script

    Resource Host ID

    stampede.tacc.xsede.org_8f20b832-c11a-444b-8e73-bf15f4760b9a

     

    Computational Project Account

      

     

    From Application Catalog

    Total CPU Count

    10

    Number of CPUs required for the experiment

    nodeCount

    10

    Number of nodes required in each CPU

    Number of Threads

    10

    Number of threads per node

    Queue Name

    normal

    if left blank it will pick default queue

    Wall Time Limit

    10

    This is given in minutes

    JobStartTime Application ID

    0

     

    Total Physical Memory

    0

     

    Application ID

    SimpleEcho3_ca40f7c6-69ba-4f89-918d-9937cea0ca8f'

    Existing application in the selected resource

    From Application Catalog

    Input Key

    echo_input

     

    Input Value

    echo_output=Hello World

     

    Output Key

    echo_output

     
    Depending on the computational resource used the resource scheduling data part need to be entered by the user. Other defined resource scheduling parts should be commented. 
    Image Removed
    Image - PHP Script Sample
  3. Script has all the resource listed; User has to select a resource to run the experiment and comment the others. User can change existing other parameters as well in the script.
  4. Execute the file; experiment will be created and experiment ID will be generated; ID is the unique value which identifies the experiment in Airavata.
  5. Experiment creation confirmation message;
    Experiment<space><exp_ID><space>created!

...

  1. User can view all existing resources linked with the gateway using script; getAllComputeResourceNames.php
    1. Format;
      php getAllComputeResourceNames.php
  2. Computational resource names and their IDs will be listed at the script execution.

...

  1. Gateway user can view a particular application module details using script; getApplicationModule.php
    1. Format;
      php getApplicationModule.php<space><appModuleID>
  2. Executing the script will display application module object with Application module ID, Application Module name, Description and version.

Tutorial X - Application Interfaces

Register Application Interface
Search Application Deployments 
  1. To view all application deployments of a particle To register a new application interface using above created application module use the script; registerApplicationInterfacegetApplicationDeployedResources.php
  2. Along with application interface name and description also need to provide application module ID as  command line arguments to the scriptBy providing the application module ID can view all available application deployments of the application.
    1. Format;
      php registerApplicationInterface.php<space><appName><space><appDescription><space><appModuleId>
  3. Successful execution of the script will display the created application interface object along with the confirmation message
    Image Removed
  4. Confirmation message contains the application interface ID generated at creation.
    Application Interface <applicationInterfaceId><space>is<space>registered!
Update Application Interface
    1. php getApplicationDeployedResources.php<space><appModuleID>
  1. Output will look like;
    Image Added

Tutorial X - Application Interfaces

Register Application Interface
  1. To register a new application interface using above created application module use the script; registerApplicationInterface.php
  2. Along with application interface name and description also need to provide application module ID as  command line arguments to the scriptApplication interface registration is required to indicate gateway user, what inputs and outputs required for an application. To register an application interface use script updateApplicationInterface.php to update the above registered application interface.
    1. Format;
      php updateApplicationInterfaceregisterApplicationInterface.php<space><appInterfaceId><appName><space><appDescription><space><appModuleId>
  3. Execution Successful execution of the script will update name of display the application input and application output.
    Image Removedcreated application interface object along with the confirmation message
    Image Added
  4. Confirmation message contains the application interface ID generated at updatecreation.
    Application Interface <applicationInterfaceId><space>is<space>updated<applicationInterfaceId><space>is<space>registered!

...

Update Application

...

Interface
  1. Application interface registration is required to indicate gateway user, what inputs and outputs required for an application. To register an application interface use script updateApplicationInterface.php to update the above registered application interfaceFor user to view all existing applications and their application interface ID use; getAllApplicationInterfaceNames.php script.
    1. Format;
      php getAllApplicationInterfaceNamesupdateApplicationInterface.phpphp<space><appInterfaceId>
  2. Execution of the script will update name of the application input and application output.
    Image Added
  3. Confirmation message contains All the applications used within the gateway will be listed along with the application interface ID generated at update.
    Image Removed
Delete Application Interface
  1. Application Interface <applicationInterfaceId><space>is<space>updated!
List Application Interfaces
  1. For user to view all existing applications and their application interface ID use; getAllApplicationInterfaceNames.php script.User can delete existing application interface by providing the application interface ID as a command line argument to the script; deleteApplicationInterface.php
    1. Format;
      php getAllApplicationInterfaceNames.php
  2. All the applications used within the gateway will be listed along with the application interface ID.
    Image Added
Delete Application Interface
  1. User can delete existing application interface by providing the application interface ID as a command line argument to the script; deleteApplicationInterface.php
    1. Format;
      php deleteApplicationInterface.php<space>< deleteApplicationInterface.php<space><appInterfaceId>
  2. At sucesful execution a confirmation message will be prompted to coinfrm the deletion
    Application Interface <applicationInterfaceId><space>successfully<space>deleted

...

  1. User can view all the computational resources which has a particular Application interface deployed by using the script; getAvailableAppInterfaceComputeResources.php
    1. Format;
      php getAvailableAppInterfaceComputeResources.php<space><appInterfaceId>
  2. name and computational resource ID of all the resources with which has the provided application interfacedeployed will get listed.

Tutorial XI - Application Deployments

...

  1. When an application module is registered in the system AIravat need to register the deployment of the application module in one or many computational resources. In order to do so user can execute the script;
    registerApplicationDeployment.php
    1. Format;
      php registerApplicationDeployment.php<space><appModuleId><space><computeHostId><space><executablePath>
  2. In order to do deploy user has to give application module ID, computational Host ID and also the executable path of the application deployment.
Search Application Deployments
  1. Tutorial tryout; User can enhance the script to add other parameters such as appDeploymentDescription, libPrependPaths, etc... as command line arguments.
View Application Deployment
  1. Execution of getApplicationDeployment.php script will show all the information related to the application deployment
  2. To view all application deployments of a particle application module use the script; getApplicationDeployedResources.php
  3. By providing the application module ID can view all available application deployments of the application.
    1. Format;
      php getApplicationDeployedResourcesgetApplicationDeployment.php<space><appModuleID><space>< appDeploymentId>
  4. When the script is executed it will show;
    Image AddedOutput will look like;
    Image Removed

Tutorial XII - View Application Input & Output

View Application Input
  1. In order to view a particular application input data this script can be used with providing application interface ID
    1. Format;
      php getApplicationInputs.php
  2. At script execution user will be provided with information on application inputs.
    Sample inout information on Echo application


...

  1. In order to view a particular application output data this script can be used with providing application interface ID
    1. Format;
      php getApplicationOutputs.php
  2. At script execution user will be provided with information on application outputs.
    Sample: Application Output Name: Echoed_Output   Output Type STRING

Tutorial XIII -

...

Gateway Preferences

View Gateway Preference
  1. A gateway can have a resource preference to execute an application when the same application is available in multiple reseoruces.
  2. To find out the gateway preference user can use getGatewayComputeResourcePreference.php script.
    1. Format;
    2. php getGatewayComputeResourcePreference.php<space> <gateway id><space><compute resource id>
Delete Gateway Preference
  1. To delete an existing gateway preference one can use deleteGatewayComputeResourcePreference.php script.

Tutorial XIV - Airavata API tester

  1. This special script consist of several API method executions. 
    1. Format;
      php airavata-client-api-tester.php<space><username>
  2. By this single script user can

...

  1. This special script consist of several API method executions. 
    1. Format;
      php airavata-client-api-tester.php<space><username>
  2. By this single script user can create project, update the project, create experiment, launch experiment, view experiment, clone experiment, etc... 
  3. Explore the script for more infomration and build on this script.

Useful Commands

...

Action

...

Command

...

Make a directory

...

mkdir <directory name>

...

Navigate to directory

...

cd <directory name>

...

List directory content

...

ls <directory name>

...

Navigate to a directory giving path

...

cd <..../….../…../ directory name>

cd SciGaP/Airavata-PHP-Client-Samples/client-samples

...

Check for PHP existence

...

php –v

...

Install PHP & GIT

...

sudo apt-get install php5-cli

sudo apt-get install git

...

The given sequence will ensure getting a new copy from git reverting all the local changes have made  to the local scripts

...

git reset --hard HEAD

git pull

 

...