Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a folder (ex: SciGaP) in a preferable location in your local machine to clone download the PHP samples from GitHub. Open the created SciGaP folder (...../ cd SciGaP) and clone the files using GitHuB ‘HTTPS clone URL’    
    git clone https://git-wip-usdist.apache.org/repos/asf?p=airavata.git
    Once the cloning is completed you would get a completed message. 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/airavataapache-api/airavata-clientphp-sdks/airavata-php-sdk/src/main/resourcessdk-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. registerApplicationInterface.php
      25. updateApplicationInterface.php
      26. getAllApplicationInterfaceNames.php
      27. deleteApplicationInterface.php
      28. getAvailableAppInterfaceComputeResources.php
      29. registerApplicationDeployment.php
      30. getApplicationDeployedResources.php
      31. getApplicationInputs.php

      32. getApplicationOutputs.php
      33. 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. Verify the existence of the above created project by using getAllUserProjects.php file 
  2. User = Project owner who creates the Project. User name is given as a command line argument.
    1. Format;
      php getAllUserProjects.php <space><user><space><user>
    2. Sample values;
      user: ThomasPeter
  3. Execute the file; all the projects created by the given user will get listed with project information.

    Image - Project Detail Listing

...

  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

    TestPHP_ProjectEXP1_4063b44017a34aa5-332a68cb-49af41e6-a6deb189-aea21d77bb2f dc94548660a6

    Project iD is validated against existing projects

    Passed as an argument to the script

    Creating User

    ThomasDonald

    Users are validated against existing Airavata gateway users.

    Passed as an argument to the script

    Experiment Name

    Exp_Test_Project_1PHP_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

      

    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

    0

     

    Total Physical Memory

    0

     

    Application ID

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

    Existing application in the selected resource

    Input Key

    echo_input

     

    Input Value

    echo_output=Hello World

     

    Output Key

    echo_output

     
  3. 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 - PHP Script Sample

  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. To clone above modified experiment use cloneExperiment.php.
  2. Cloning will create exact copy of the existing experiment with a new experiment ID, new experiment name in CREATED state. 
  3. To clone the experiment use;
    1. php cloneExperiment.php
    2. Format:
      php cloneExperiment.php<space><exp<space><experiment_ID>id>
  4. Experiment modification confirmation message;
    1. Experiment<space><exp_ID><space>cloned!

      Created<space>clone<space>with<space>ID<space><Experiment_id><space>named<space><experiment_name>

  5. User can clone any experiment created by him/her irrespective of the experiment status.
  6. User can change existing information by updating the newly created experiment.
  7. Tutorial tryout;
    1. Try adding parameters to the script to change other data in the new experiment. E.g.: Exp name, Application, Resource, etc… and execute.

...

  1. Experiments can be searched by providing username along with experiment name or part of the experiment name.
    1. Format;
      php search_experiments_by_name.php<space><username><space><experiment_name>
    2. Example;
      php search_experiments_by_name.php Test_User Exp
  2. When the script is executed; all the experiments which has the given text as part of the name will be listed along with all experiment information.
  3. To view all experiments created by the user use star (*) or percentage mark (%) in the place of experiment name. 

...

  1. Experiments can be searched by providing username along with experiment description or part of the experiment description.
    1. Format;
      php search_experiments_by_description.php<space><username><space><experiment_description>
    2. Example;
      php search_experiments_by_description.php Test_User Test
  2. When the script is executed; all the experiments which has the given text as part of the description will be listed along with all experiment information.
  3. To view all experiments created by the user use star (*) or percentage mark (%) in the place of experiment description. This would list experiment which has no description as well.

...

  1. Experiments can be searched by providing username along with applicationId or part of the applicationId.
    1. Format;
      php search_experiments_by_application.php<space><username><space><applicationID>
    2. Example;
      php search_experiments_by_application.php Test_User Echo
  2. When the script is executed; all the experiments which has the given text as part of the application ID will be listed along with all experiment information.
  3. To view all experiments created by the user use star (*) or percentage mark (%) in the place of applicationID.

...

  1. Once the experiment is COMPLETED (Status of the experiment is checked using above getExperimentStatus.php) user can check the output. 
  2. To check the output  
    1. Format; 
      php getExperimentOutputs.php<space><experiment_id>

...

    1. Image Added 

Image - Sample output

Tutorial VIII - Computational Resources

...