Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2309A200BC1 for ; Wed, 2 Nov 2016 00:03:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 21ABA160B02; Tue, 1 Nov 2016 23:03:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4190D160AF7 for ; Wed, 2 Nov 2016 00:03:12 +0100 (CET) Received: (qmail 84289 invoked by uid 500); 1 Nov 2016 23:03:11 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 84280 invoked by uid 99); 1 Nov 2016 23:03:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2016 23:03:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 461A2E0FC4; Tue, 1 Nov 2016 23:03:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ndoshi@apache.org To: commits@airavata.apache.org Message-Id: <250362f42bbe4ecc8632aa6f5225352d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: airavata-php-gateway git commit: Adding Cloud Job Submission Date: Tue, 1 Nov 2016 23:03:11 +0000 (UTC) archived-at: Tue, 01 Nov 2016 23:03:13 -0000 Repository: airavata-php-gateway Updated Branches: refs/heads/develop 4ea44b18c -> 693db4ee5 Adding Cloud Job Submission Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/693db4ee Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/693db4ee Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/693db4ee Branch: refs/heads/develop Commit: 693db4ee5919c4b66b2acbb4cda9e0af5512fc3e Parents: 4ea44b1 Author: Nipurn Doshi Authored: Tue Nov 1 16:02:36 2016 -0700 Committer: Nipurn Doshi Committed: Tue Nov 1 16:02:36 2016 -0700 ---------------------------------------------------------------------- app/libraries/CRUtilities.php | 33 +++++++++++++++++++-- app/views/resource/edit.blade.php | 52 +++++++++++++++++++++++++++------- public/js/script.js | 9 +++--- 3 files changed, 77 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/693db4ee/app/libraries/CRUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php index ae3e1ad..3349961 100755 --- a/app/libraries/CRUtilities.php +++ b/app/libraries/CRUtilities.php @@ -21,6 +21,8 @@ use Airavata\Model\Data\Movement\SecurityProtocol; use Airavata\Model\AppCatalog\ComputeResource\SSHJobSubmission; use Airavata\Model\Data\Movement\UnicoreDataMovement; use Airavata\Model\AppCatalog\ComputeResource\UnicoreJobSubmission; +use Airavata\Model\AppCatalog\ComputeResource\CloudJobSubmission; +use Airavata\Model\AppCatalog\ComputeResource\ProviderName; use Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference; use Airavata\Model\AppCatalog\GatewayProfile\GatewayResourceProfile; use Airavata\Model\AppCatalog\Parallelism\ApplicationParallelismType; @@ -84,6 +86,7 @@ class CRUtilities $jmc = new JobManagerCommand(); $mm = new MonitorMode(); $pt = new ApplicationParallelismType(); + $pn = new ProviderName(); return array( "fileSystemsObject" => $files, "fileSystems" => $files::$__names, @@ -97,7 +100,8 @@ class CRUtilities "dataMovementProtocols" => $dmp::$__names, "jobManagerCommands" => $jmc::$__names, "monitorModes" => $mm::$__names, - "parallelismTypes" => $pt::$__names + "parallelismTypes" => $pt::$__names, + "providerNames" => $pn::$__names ); } @@ -265,7 +269,31 @@ class CRUtilities $unicoreSub = Airavata::addUNICOREJobSubmissionDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $unicoreJobSubmission); } return; - } else /* Globus does not work currently */ { + } else if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::CLOUD) { + $cloudJobSubmission = new CloudJobSubmission(array + ( + "securityProtocol" => intval($inputs["securityProtocol"]), + "nodeId" => $inputs["nodeId"], + "executableType" => $inputs["executableType"], + "providerName" => intval( $inputs["providerName"]), + "userAccountName" => $inputs["userAccountName"] + ) + ); + if ($update) { + $jsiObject = Airavata::getCloudJobSubmission(Session::get('authz-token'), $jsiId); + $jsiObject->securityProtocol = intval($inputs["securityProtocol"]); + $jsiObject->nodeId = $inputs["nodeId"]; + $jsiObject->executableType = $inputs["executableType"]; + $jsiObject->providerName = intval( $inputs["providerName"]); + $jsiObject->userAccountName = $inputs["userAccountName"]; + + $cloudSub = Airavata::updateCloudJobSubmissionDetails(Session::get('authz-token'), $jsiId, $jsiObject); + } else { + $cloudSub = Airavata::addCloudJobSubmissionDetails(Session::get('authz-token'), $computeResource->computeResourceId, 0, $cloudJobSubmission); + } + return; + } + else /* Globus does not work currently */ { print_r("Whoops! We haven't coded for this Job Submission Protocol yet. Still working on it. Please click here to go back to edit page for compute resource."); } } @@ -659,7 +687,6 @@ class CRUtilities } return $dspArray; } - } ?> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/693db4ee/app/views/resource/edit.blade.php ---------------------------------------------------------------------- diff --git a/app/views/resource/edit.blade.php b/app/views/resource/edit.blade.php index f55fddb..e2d3e75 100644 --- a/app/views/resource/edit.blade.php +++ b/app/views/resource/edit.blade.php @@ -285,6 +285,37 @@ + @elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::CLOUD) +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
@endif
@@ -542,24 +573,25 @@
- -
-
- - +
- +
- + + @foreach( $providerNames as $index => $pn) + + @endforeach
+
+ + +
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/693db4ee/public/js/script.js ---------------------------------------------------------------------- diff --git a/public/js/script.js b/public/js/script.js index b3e6732..c2727c7 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -121,13 +121,14 @@ $(document).ready( function(){ } else if( selectedVal == "cloud") { - alert("Cloud Protool is not being setup right now. Please choose another option."); - /* + //alert("Cloud Protool is not being setup right now. Please choose another option."); + $(this).parent().append( parentResDiv + $(".ssh-block").html() + $(".cloud-block").html() + + "
" ); - */ + } else{ alert("Something went wrong. Please try again"); @@ -135,7 +136,7 @@ $(document).ready( function(){ } //temporary till all protocols are not setup - if( selectedVal == "local" || selectedVal == "ssh_fork" || selectedVal == "ssh" || selectedVal == "unicore" ) + if( selectedVal == "local" || selectedVal == "ssh_fork" || selectedVal == "ssh" || selectedVal == "unicore" || selectedVal == "cloud") $(".jspSubmit").removeClass("hide"); else $(".jspSubmit").addClass("hide");