[jira] [Commented] (AIRAVATA-2746) Job completed and experiment failed due to error in initializing SSH agent

2018-04-11 Thread Eroma (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434097#comment-16434097
 ] 

Eroma commented on AIRAVATA-2746:
-

Two more experiments have failed with error [2] which are similar. These 
failures have occurred at environment setup.

[2]

org.apache.airavata.helix.impl.task.TaskOnFailException: Error Code : 
3822ae38-197f-40a3-9bc4-0c73ec3346b3, Task 
TASK_47217b92-2f21-473a-b98a-c70617559172 failed due to Failed to setup 
environment of task TASK_47217b92-2f21-473a-b98a-c70617559172, Error while 
initializing ssh agent for compute resource 
carbonate.uits.iu.edu_42a3397f-e2c6-4fda-ac9c-d8fb25be82e7 to token 
e415b180-7a40-4ad7-8a82-b77b909b70a1 at 
org.apache.airavata.helix.impl.task.AiravataTask.onFail(AiravataTask.java:101) 
at 
org.apache.airavata.helix.impl.task.env.EnvSetupTask.onRun(EnvSetupTask.java:53)
 at 
org.apache.airavata.helix.impl.task.AiravataTask.onRun(AiravataTask.java:268) 
at org.apache.airavata.helix.core.AbstractTask.run(AbstractTask.java:82) at 
org.apache.helix.task.TaskRunner.run(TaskRunner.java:71) at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at 
java.util.concurrent.FutureTask.run(FutureTask.java:266) at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
 at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
 at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
at java.lang.Thread.run(Thread.java:748) Caused by: 
org.apache.airavata.agents.api.AgentException: Error while initializing ssh 
agent for compute resource 
carbonate.uits.iu.edu_42a3397f-e2c6-4fda-ac9c-d8fb25be82e7 to token 
e415b180-7a40-4ad7-8a82-b77b909b70a1 at 
org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:116)
 at 
org.apache.airavata.helix.core.support.AdaptorSupportImpl.fetchAdaptor(AdaptorSupportImpl.java:59)
 at 
org.apache.airavata.helix.impl.task.env.EnvSetupTask.onRun(EnvSetupTask.java:41)
 ... 10 more Caused by: org.apache.airavata.agents.api.AgentException: Could 
not create ssh session for host carbonate.uits.iu.edu at 
org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:84)
 at 
org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:112)
 ... 12 more Caused by: com.jcraft.jsch.JSchException: Auth cancel at 
com.jcraft.jsch.Session.connect(Session.java:511) at 
com.jcraft.jsch.Session.connect(Session.java:183) at 
org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:81)
 ... 13 more

> Job completed and experiment failed due to error in initializing SSH agent
> --
>
> Key: AIRAVATA-2746
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2746
> Project: Airavata
>  Issue Type: Bug
>  Components: helix implementation
>Affects Versions: 0.18
>Reporter: Eroma
>Assignee: Dimuthu Upeksha
>Priority: Major
> Fix For: 0.18
>
>
> # Submitted a batch of experiments and got this error as an intermittent 
> error.
>  # Job status is COMPLETED but experiment is FAILED due to the error [1]
> [1]
> rg.apache.airavata.helix.impl.task.TaskOnFailException: Error Code : 
> c8fdb6ff-e1ca-470f-9858-b5d08e9334bd, Task 
> TASK_2dd64a31-44b9-4358-b962-122fdfb36415 failed due to Failed to obtain 
> adaptor for compute resource 
> carbonate.uits.iu.edu_42a3397f-e2c6-4fda-ac9c-d8fb25be82e7 in task 
> TASK_2dd64a31-44b9-4358-b962-122fdfb36415, Error while initializing ssh agent 
> for compute resource 
> carbonate.uits.iu.edu_42a3397f-e2c6-4fda-ac9c-d8fb25be82e7 to token 
> e415b180-7a40-4ad7-8a82-b77b909b70a1 at 
> org.apache.airavata.helix.impl.task.AiravataTask.onFail(AiravataTask.java:101)
>  at 
> org.apache.airavata.helix.impl.task.staging.ArchiveTask.onRun(ArchiveTask.java:142)
>  at 
> org.apache.airavata.helix.impl.task.AiravataTask.onRun(AiravataTask.java:268) 
> at org.apache.airavata.helix.core.AbstractTask.run(AbstractTask.java:82) at 
> org.apache.helix.task.TaskRunner.run(TaskRunner.java:71) at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at 
> java.util.concurrent.FutureTask.run(FutureTask.java:266) at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 

[jira] [Commented] (AIRAVATA-2742) Helix Controller throws an Exception when the participant is killed

2018-04-11 Thread Dimuthu Upeksha (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434115#comment-16434115
 ] 

Dimuthu Upeksha commented on AIRAVATA-2742:
---

Helix Team identified this as an bug and they will fix it in future releases

https://issues.apache.org/jira/browse/HELIX-693

Helix Dev discussion - Subject: Sporadic issue when restarting a Participant

> Helix Controller throws an Exception when the participant is killed
> ---
>
> Key: AIRAVATA-2742
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2742
> Project: Airavata
>  Issue Type: Bug
>  Components: helix implementation
>Affects Versions: 0.18
>Reporter: Dimuthu Upeksha
>Assignee: Dimuthu Upeksha
>Priority: Major
>
> This was a sporadic issue and occurred only once in the test setup. There 
> were 5 - 10 tasks running in the Participant and Participant was externally 
> killed by SIGTERM command (kill . Once the Participant is started 
> again, it did not pickup the tasks that it was running at the time it was 
> killed. Surprisingly, the status of the respective workflows were IN_PROGRESS 
> status. Helix Controller log showed following error for each Workflow. This 
> seems like a bug in Helix and I posted the issue in Helix mailing list 
> (Subject : Sporadic issue when restarting a Participant). 
>  
> 2018-04-06 15:10:57,766 [Thread-3] ERROR o.a.h.c.s.BestPossibleStateCalcStage 
>  - Error computing assignment for resource 
> Workflow_of_process_PROCESS_7f6c8a54-b50f-4bdb-aafd-59ce87276527-POST-b5e39e07-2d8e-4309-be5a-f5b6067f9a24_TASK_cc8039e5-f054-4dea-8c7f-07c98077b117.
>  Skipping.
> java.lang.NullPointerException: Name is null
>         at java.lang.Enum.valueOf(Enum.java:236)
>         at 
> org.apache.helix.task.TaskPartitionState.valueOf(TaskPartitionState.java:25)
>         at 
> org.apache.helix.task.JobRebalancer.computeResourceMapping(JobRebalancer.java:272)
>         at 
> org.apache.helix.task.JobRebalancer.computeBestPossiblePartitionState(JobRebalancer.java:140)
>         at 
> org.apache.helix.controller.stages.BestPossibleStateCalcStage.compute(BestPossibleStateCalcStage.java:171)
>         at 
> org.apache.helix.controller.stages.BestPossibleStateCalcStage.process(BestPossibleStateCalcStage.java:66)
>         at 
> org.apache.helix.controller.pipeline.Pipeline.handle(Pipeline.java:48)
>         at 
> org.apache.helix.controller.GenericHelixController.handleEvent(GenericHelixController.java:295)
>         at 
> org.apache.helix.controller.GenericHelixController$ClusterEventProcessor.run(GenericHelixController.java:595)
> 2018-04-06 15:11:00,385 [Thread-3] ERROR o.a.h.c.s.BestPossibleStateCalcStage 
>  - Error computing assignment for resource 
> Workflow_of_process_PROCESS_2b69b499-c527-4c9d-8b2b-db17366f5f81-POST-c67607ae-9177-4a02-af8a-8b3751eea4ff_TASK_1ea6876d-f2ec-4139-a15d-0e64a80a3025.
>  Skipping. 
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434123#comment-16434123
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180812346
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
+try {
+final String storageResourceId = 
AppCatalogUtils.getID(description.getHostName());
+if (description.getStorageResourceDescription().equals("") || 
description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID))
 {
+description.setStorageResourceId(storageResourceId);
+}
+description.setCreationTime(System.currentTimeMillis());
+if (description.getDataMovementInterfaces() != null) {
+description.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(description.getStorageResourceId()));
+}
+StorageResourceDescription storageResourceDescription = 
create(description);
+return storageResourceDescription.getStorageResourceId();
+} catch (Exception e) {
+logger.error("Error while saving storage resource...", e);
 
 Review comment:
   Add storage resource id and other required data to this log line in order to 
make it unique and useful.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refactoring App Catalog implementation
> --
>
> Key: AIRAVATA-2619
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2619
> Project: Airavata
>  Issue Type: Sub-task
>Reporter: Sachin Kariyattin
>Assignee: Sachin Kariyattin
>Priority: Major
>
> The app catalog module contains the following Impl classes.
> {quote}ApplicationDeploymentImpl
>  ApplicationInterfaceImpl
>  ComputeResourceImpl
>  GwyResourceProfileImpl
>  StorageResourceImpl
>  UsrResourceProfileImpl
> {quote}
> This task involves creating a repository class for 

[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434151#comment-16434151
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180818018
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
+try {
+final String storageResourceId = 
AppCatalogUtils.getID(description.getHostName());
+if (description.getStorageResourceDescription().equals("") || 
description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID))
 {
+description.setStorageResourceId(storageResourceId);
+}
+description.setCreationTime(System.currentTimeMillis());
+if (description.getDataMovementInterfaces() != null) {
+description.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(description.getStorageResourceId()));
+}
+StorageResourceDescription storageResourceDescription = 
create(description);
+return storageResourceDescription.getStorageResourceId();
+} catch (Exception e) {
+logger.error("Error while saving storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public void updateStorageResource(String storageResourceId, 
StorageResourceDescription updatedStorageResource) throws AppCatalogException {
+try {
+updatedStorageResource.setUpdateTime(System.currentTimeMillis());
+if (updatedStorageResource.getDataMovementInterfaces() != null) {
+
updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(updatedStorageResource.getStorageResourceId()));
+}
+update(updatedStorageResource);
+} catch (Exception e) {
+logger.error("Error while updating storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public StorageResourceDescription getStorageResource(String resourceId) 
throws AppCatalogException {
+try {
+return get(resourceId);
+} catch (Exception e) {
+logger.error("Error while retrieving storage resource...", e);
+throw 

[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434150#comment-16434150
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180817916
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
+try {
+final String storageResourceId = 
AppCatalogUtils.getID(description.getHostName());
+if (description.getStorageResourceDescription().equals("") || 
description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID))
 {
+description.setStorageResourceId(storageResourceId);
+}
+description.setCreationTime(System.currentTimeMillis());
+if (description.getDataMovementInterfaces() != null) {
+description.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(description.getStorageResourceId()));
+}
+StorageResourceDescription storageResourceDescription = 
create(description);
+return storageResourceDescription.getStorageResourceId();
+} catch (Exception e) {
+logger.error("Error while saving storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public void updateStorageResource(String storageResourceId, 
StorageResourceDescription updatedStorageResource) throws AppCatalogException {
+try {
+updatedStorageResource.setUpdateTime(System.currentTimeMillis());
+if (updatedStorageResource.getDataMovementInterfaces() != null) {
+
updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(updatedStorageResource.getStorageResourceId()));
+}
+update(updatedStorageResource);
+} catch (Exception e) {
+logger.error("Error while updating storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public StorageResourceDescription getStorageResource(String resourceId) 
throws AppCatalogException {
+try {
+return get(resourceId);
+} catch (Exception e) {
+logger.error("Error while retrieving storage resource...", e);
 
 Review comment:
  

[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434146#comment-16434146
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180817800
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
+try {
+final String storageResourceId = 
AppCatalogUtils.getID(description.getHostName());
+if (description.getStorageResourceDescription().equals("") || 
description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID))
 {
+description.setStorageResourceId(storageResourceId);
+}
+description.setCreationTime(System.currentTimeMillis());
+if (description.getDataMovementInterfaces() != null) {
+description.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(description.getStorageResourceId()));
+}
+StorageResourceDescription storageResourceDescription = 
create(description);
+return storageResourceDescription.getStorageResourceId();
+} catch (Exception e) {
+logger.error("Error while saving storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public void updateStorageResource(String storageResourceId, 
StorageResourceDescription updatedStorageResource) throws AppCatalogException {
+try {
+updatedStorageResource.setUpdateTime(System.currentTimeMillis());
+if (updatedStorageResource.getDataMovementInterfaces() != null) {
+
updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(updatedStorageResource.getStorageResourceId()));
+}
+update(updatedStorageResource);
+} catch (Exception e) {
+logger.error("Error while updating storage resource...", e);
 
 Review comment:
   Same as above comments


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 

[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434175#comment-16434175
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180819101
 
 

 ##
 File path: 
modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepositoryTest.java
 ##
 @@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.data.movement.*;
+import org.apache.airavata.registry.core.repositories.util.Initialize;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Created by skariyat on 3/13/18.
+ */
+public class StorageResourceRepositoryTest {
+
+private static Initialize initialize;
+private StorageResourceRepository storageResourceRepository;
+private static final Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+@Before
+public void setUp() {
+try {
+initialize = new Initialize("appcatalog-derby.sql");
+initialize.initializeDB();
+storageResourceRepository = new StorageResourceRepository();
+} catch (Exception e) {
+logger.error(e.getMessage(), e);
+}
+}
+
+@After
+public void tearDown() throws Exception {
+System.out.println("** TEAR DOWN ");
+initialize.stopDerbyServer();
+}
+
+@Test
+public void StorageResourceRepositoryTest() throws AppCatalogException {
+
+StorageResourceDescription description = new 
StorageResourceDescription();
+
+description.setHostName("localhost");
+description.setEnabled(true);
+description.setStorageResourceDescription("testDescription");
+
+
+String scpDataMoveId = addSCPDataMovement();
+System.out.println(" SCP DataMoveId** :" + scpDataMoveId);
+String gridFTPDataMoveId = addGridFTPDataMovement();
+System.out.println(" grid FTP DataMoveId** :" + 
gridFTPDataMoveId);
+
+List dataMovementInterfaces = new 
ArrayList();
+DataMovementInterface scpInterface = new DataMovementInterface();
+scpInterface.setDataMovementInterfaceId(scpDataMoveId);
+scpInterface.setDataMovementProtocol(DataMovementProtocol.SCP);
+scpInterface.setPriorityOrder(1);
+
+DataMovementInterface gridFTPMv = new DataMovementInterface();
+gridFTPMv.setDataMovementInterfaceId(gridFTPDataMoveId);
+gridFTPMv.setDataMovementProtocol(DataMovementProtocol.GridFTP);
+gridFTPMv.setPriorityOrder(2);
+
+dataMovementInterfaces.add(scpInterface);
+dataMovementInterfaces.add(gridFTPMv);
+description.setDataMovementInterfaces(dataMovementInterfaces);
+
+String resourceId = 
storageResourceRepository.addStorageResource(description);
+StorageResourceDescription storageResourceDescription = null;
+
+if (storageResourceRepository.isExists(resourceId)) {
+storageResourceDescription = 
storageResourceRepository.getStorageResource(resourceId);
+
assertTrue(storageResourceDescription.getHostName().equals("localhost"));
+
assertTrue(storageResourceDescription.getStorageResourceDescription().equals("testDescription"));
+List movementInterfaces = 
storageResourceDescription.getDataMovementInterfaces();
+if (movementInterfaces != null && !movementInterfaces.isEmpty()){
+for (DataMovementInterface dataMovementInterface 

[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434174#comment-16434174
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180819055
 
 

 ##
 File path: 
modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepositoryTest.java
 ##
 @@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.data.movement.*;
+import org.apache.airavata.registry.core.repositories.util.Initialize;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Created by skariyat on 3/13/18.
+ */
+public class StorageResourceRepositoryTest {
+
+private static Initialize initialize;
+private StorageResourceRepository storageResourceRepository;
+private static final Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+@Before
+public void setUp() {
+try {
+initialize = new Initialize("appcatalog-derby.sql");
+initialize.initializeDB();
+storageResourceRepository = new StorageResourceRepository();
+} catch (Exception e) {
+logger.error(e.getMessage(), e);
+}
+}
+
+@After
+public void tearDown() throws Exception {
+System.out.println("** TEAR DOWN ");
+initialize.stopDerbyServer();
+}
+
+@Test
+public void StorageResourceRepositoryTest() throws AppCatalogException {
+
+StorageResourceDescription description = new 
StorageResourceDescription();
+
+description.setHostName("localhost");
+description.setEnabled(true);
+description.setStorageResourceDescription("testDescription");
+
+
+String scpDataMoveId = addSCPDataMovement();
+System.out.println(" SCP DataMoveId** :" + scpDataMoveId);
+String gridFTPDataMoveId = addGridFTPDataMovement();
+System.out.println(" grid FTP DataMoveId** :" + 
gridFTPDataMoveId);
+
+List dataMovementInterfaces = new 
ArrayList();
+DataMovementInterface scpInterface = new DataMovementInterface();
+scpInterface.setDataMovementInterfaceId(scpDataMoveId);
+scpInterface.setDataMovementProtocol(DataMovementProtocol.SCP);
+scpInterface.setPriorityOrder(1);
+
+DataMovementInterface gridFTPMv = new DataMovementInterface();
+gridFTPMv.setDataMovementInterfaceId(gridFTPDataMoveId);
+gridFTPMv.setDataMovementProtocol(DataMovementProtocol.GridFTP);
+gridFTPMv.setPriorityOrder(2);
+
+dataMovementInterfaces.add(scpInterface);
+dataMovementInterfaces.add(gridFTPMv);
+description.setDataMovementInterfaces(dataMovementInterfaces);
+
+String resourceId = 
storageResourceRepository.addStorageResource(description);
+StorageResourceDescription storageResourceDescription = null;
+
+if (storageResourceRepository.isExists(resourceId)) {
+storageResourceDescription = 
storageResourceRepository.getStorageResource(resourceId);
+
assertTrue(storageResourceDescription.getHostName().equals("localhost"));
+
assertTrue(storageResourceDescription.getStorageResourceDescription().equals("testDescription"));
+List movementInterfaces = 
storageResourceDescription.getDataMovementInterfaces();
+if (movementInterfaces != null && !movementInterfaces.isEmpty()){
+for (DataMovementInterface dataMovementInterface 

[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434182#comment-16434182
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on issue #182: [AIRAVATA-2619] Refactoring App Catalog 
implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#issuecomment-380516485
 
 
   @sachinkariyattin When printing log lines and re throw custom exceptions, 
try to print as much as data so that we can easily investigate the isssue


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refactoring App Catalog implementation
> --
>
> Key: AIRAVATA-2619
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2619
> Project: Airavata
>  Issue Type: Sub-task
>Reporter: Sachin Kariyattin
>Assignee: Sachin Kariyattin
>Priority: Major
>
> The app catalog module contains the following Impl classes.
> {quote}ApplicationDeploymentImpl
>  ApplicationInterfaceImpl
>  ComputeResourceImpl
>  GwyResourceProfileImpl
>  StorageResourceImpl
>  UsrResourceProfileImpl
> {quote}
> This task involves creating a repository class for app catalog and include 
> all the methods from the Impl classes mentioned above. As a modular approach 
> is being followed, to start of, only methods GwyResourceProfileImpl will be 
> considered. So the RegistryServiceHandler methods only with respect to 
> GwyResourceProfileImpl will be modified. Subsequently all methods related to 
> app catalog will be refactored.
> *Progress*:
>  * Implemeted GatewayResourceProfileRepository.
>  * Implemented ComputeResourceRepository.
>  * Implemented StorageResourceRepository.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434171#comment-16434171
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180818705
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
+try {
+final String storageResourceId = 
AppCatalogUtils.getID(description.getHostName());
+if (description.getStorageResourceDescription().equals("") || 
description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID))
 {
+description.setStorageResourceId(storageResourceId);
+}
+description.setCreationTime(System.currentTimeMillis());
+if (description.getDataMovementInterfaces() != null) {
+description.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(description.getStorageResourceId()));
+}
+StorageResourceDescription storageResourceDescription = 
create(description);
+return storageResourceDescription.getStorageResourceId();
+} catch (Exception e) {
+logger.error("Error while saving storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public void updateStorageResource(String storageResourceId, 
StorageResourceDescription updatedStorageResource) throws AppCatalogException {
+try {
+updatedStorageResource.setUpdateTime(System.currentTimeMillis());
+if (updatedStorageResource.getDataMovementInterfaces() != null) {
+
updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(updatedStorageResource.getStorageResourceId()));
+}
+update(updatedStorageResource);
+} catch (Exception e) {
+logger.error("Error while updating storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public StorageResourceDescription getStorageResource(String resourceId) 
throws AppCatalogException {
+try {
+return get(resourceId);
+} catch (Exception e) {
+logger.error("Error while retrieving storage resource...", e);
+throw 

[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434170#comment-16434170
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180818612
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
+try {
+final String storageResourceId = 
AppCatalogUtils.getID(description.getHostName());
+if (description.getStorageResourceDescription().equals("") || 
description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID))
 {
+description.setStorageResourceId(storageResourceId);
+}
+description.setCreationTime(System.currentTimeMillis());
+if (description.getDataMovementInterfaces() != null) {
+description.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(description.getStorageResourceId()));
+}
+StorageResourceDescription storageResourceDescription = 
create(description);
+return storageResourceDescription.getStorageResourceId();
+} catch (Exception e) {
+logger.error("Error while saving storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public void updateStorageResource(String storageResourceId, 
StorageResourceDescription updatedStorageResource) throws AppCatalogException {
+try {
+updatedStorageResource.setUpdateTime(System.currentTimeMillis());
+if (updatedStorageResource.getDataMovementInterfaces() != null) {
+
updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(updatedStorageResource.getStorageResourceId()));
+}
+update(updatedStorageResource);
+} catch (Exception e) {
+logger.error("Error while updating storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public StorageResourceDescription getStorageResource(String resourceId) 
throws AppCatalogException {
+try {
+return get(resourceId);
+} catch (Exception e) {
+logger.error("Error while retrieving storage resource...", e);
+throw 

[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434154#comment-16434154
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180818443
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
+try {
+final String storageResourceId = 
AppCatalogUtils.getID(description.getHostName());
+if (description.getStorageResourceDescription().equals("") || 
description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID))
 {
+description.setStorageResourceId(storageResourceId);
+}
+description.setCreationTime(System.currentTimeMillis());
+if (description.getDataMovementInterfaces() != null) {
+description.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(description.getStorageResourceId()));
+}
+StorageResourceDescription storageResourceDescription = 
create(description);
+return storageResourceDescription.getStorageResourceId();
+} catch (Exception e) {
+logger.error("Error while saving storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public void updateStorageResource(String storageResourceId, 
StorageResourceDescription updatedStorageResource) throws AppCatalogException {
+try {
+updatedStorageResource.setUpdateTime(System.currentTimeMillis());
+if (updatedStorageResource.getDataMovementInterfaces() != null) {
+
updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(updatedStorageResource.getStorageResourceId()));
+}
+update(updatedStorageResource);
+} catch (Exception e) {
+logger.error("Error while updating storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public StorageResourceDescription getStorageResource(String resourceId) 
throws AppCatalogException {
+try {
+return get(resourceId);
+} catch (Exception e) {
+logger.error("Error while retrieving storage resource...", e);
+throw 

[jira] [Created] (AIRAVATA-2746) Job completed and experiment failed due to error in initializing SSH agent

2018-04-11 Thread Eroma (JIRA)
Eroma created AIRAVATA-2746:
---

 Summary: Job completed and experiment failed due to error in 
initializing SSH agent
 Key: AIRAVATA-2746
 URL: https://issues.apache.org/jira/browse/AIRAVATA-2746
 Project: Airavata
  Issue Type: Bug
  Components: helix implementation
Affects Versions: 0.18
Reporter: Eroma
Assignee: Dimuthu Upeksha
 Fix For: 0.18


# Submitted a batch of experiments and got this error as an intermittent error.
 # Job status is COMPLETED but experiment is FAILED due to the error [1]

[1]

rg.apache.airavata.helix.impl.task.TaskOnFailException: Error Code : 
c8fdb6ff-e1ca-470f-9858-b5d08e9334bd, Task 
TASK_2dd64a31-44b9-4358-b962-122fdfb36415 failed due to Failed to obtain 
adaptor for compute resource 
carbonate.uits.iu.edu_42a3397f-e2c6-4fda-ac9c-d8fb25be82e7 in task 
TASK_2dd64a31-44b9-4358-b962-122fdfb36415, Error while initializing ssh agent 
for compute resource carbonate.uits.iu.edu_42a3397f-e2c6-4fda-ac9c-d8fb25be82e7 
to token e415b180-7a40-4ad7-8a82-b77b909b70a1 at 
org.apache.airavata.helix.impl.task.AiravataTask.onFail(AiravataTask.java:101) 
at 
org.apache.airavata.helix.impl.task.staging.ArchiveTask.onRun(ArchiveTask.java:142)
 at 
org.apache.airavata.helix.impl.task.AiravataTask.onRun(AiravataTask.java:268) 
at org.apache.airavata.helix.core.AbstractTask.run(AbstractTask.java:82) at 
org.apache.helix.task.TaskRunner.run(TaskRunner.java:71) at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at 
java.util.concurrent.FutureTask.run(FutureTask.java:266) at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
 at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
 at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
at java.lang.Thread.run(Thread.java:748) Caused by: 
org.apache.airavata.agents.api.AgentException: Error while initializing ssh 
agent for compute resource 
carbonate.uits.iu.edu_42a3397f-e2c6-4fda-ac9c-d8fb25be82e7 to token 
e415b180-7a40-4ad7-8a82-b77b909b70a1 at 
org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:116)
 at 
org.apache.airavata.helix.core.support.AdaptorSupportImpl.fetchAdaptor(AdaptorSupportImpl.java:59)
 at 
org.apache.airavata.helix.impl.task.staging.DataStagingTask.getComputeResourceAdaptor(DataStagingTask.java:90)
 at 
org.apache.airavata.helix.impl.task.staging.ArchiveTask.onRun(ArchiveTask.java:80)
 ... 10 more Caused by: org.apache.airavata.agents.api.AgentException: Could 
not create ssh session for host carbonate.uits.iu.edu at 
org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:84)
 at 
org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:112)
 ... 13 more Caused by: com.jcraft.jsch.JSchException: Auth cancel at 
com.jcraft.jsch.Session.connect(Session.java:511) at 
com.jcraft.jsch.Session.connect(Session.java:183) at 
org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:81)
 ... 14 more

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434172#comment-16434172
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180818762
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
+try {
+final String storageResourceId = 
AppCatalogUtils.getID(description.getHostName());
+if (description.getStorageResourceDescription().equals("") || 
description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID))
 {
+description.setStorageResourceId(storageResourceId);
+}
+description.setCreationTime(System.currentTimeMillis());
+if (description.getDataMovementInterfaces() != null) {
+description.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(description.getStorageResourceId()));
+}
+StorageResourceDescription storageResourceDescription = 
create(description);
+return storageResourceDescription.getStorageResourceId();
+} catch (Exception e) {
+logger.error("Error while saving storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public void updateStorageResource(String storageResourceId, 
StorageResourceDescription updatedStorageResource) throws AppCatalogException {
+try {
+updatedStorageResource.setUpdateTime(System.currentTimeMillis());
+if (updatedStorageResource.getDataMovementInterfaces() != null) {
+
updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(updatedStorageResource.getStorageResourceId()));
+}
+update(updatedStorageResource);
+} catch (Exception e) {
+logger.error("Error while updating storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public StorageResourceDescription getStorageResource(String resourceId) 
throws AppCatalogException {
+try {
+return get(resourceId);
+} catch (Exception e) {
+logger.error("Error while retrieving storage resource...", e);
+throw 

[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434173#comment-16434173
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180818898
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
+try {
+final String storageResourceId = 
AppCatalogUtils.getID(description.getHostName());
+if (description.getStorageResourceDescription().equals("") || 
description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID))
 {
+description.setStorageResourceId(storageResourceId);
+}
+description.setCreationTime(System.currentTimeMillis());
+if (description.getDataMovementInterfaces() != null) {
+description.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(description.getStorageResourceId()));
+}
+StorageResourceDescription storageResourceDescription = 
create(description);
+return storageResourceDescription.getStorageResourceId();
+} catch (Exception e) {
+logger.error("Error while saving storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public void updateStorageResource(String storageResourceId, 
StorageResourceDescription updatedStorageResource) throws AppCatalogException {
+try {
+updatedStorageResource.setUpdateTime(System.currentTimeMillis());
+if (updatedStorageResource.getDataMovementInterfaces() != null) {
+
updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(updatedStorageResource.getStorageResourceId()));
+}
+update(updatedStorageResource);
+} catch (Exception e) {
+logger.error("Error while updating storage resource...", e);
+throw new AppCatalogException(e);
+}
+}
+
+@Override
+public StorageResourceDescription getStorageResource(String resourceId) 
throws AppCatalogException {
+try {
+return get(resourceId);
+} catch (Exception e) {
+logger.error("Error while retrieving storage resource...", e);
+throw 

[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434122#comment-16434122
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180811838
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
+try {
+final String storageResourceId = 
AppCatalogUtils.getID(description.getHostName());
+if (description.getStorageResourceDescription().equals("") || 
description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID))
 {
 
 Review comment:
   Use "".equals(description.getStorageResourceDescription()) and 
airavata_commonsConstants.DEFAULT_ID.equals(description.getStorageResourceId()) 
to avoid possible NPE


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refactoring App Catalog implementation
> --
>
> Key: AIRAVATA-2619
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2619
> Project: Airavata
>  Issue Type: Sub-task
>Reporter: Sachin Kariyattin
>Assignee: Sachin Kariyattin
>Priority: Major
>
> The app catalog module contains the following Impl classes.
> {quote}ApplicationDeploymentImpl
>  ApplicationInterfaceImpl
>  ComputeResourceImpl
>  GwyResourceProfileImpl
>  StorageResourceImpl
>  UsrResourceProfileImpl
> {quote}
> This task involves creating a repository class for app catalog and include 
> all the methods from the Impl classes mentioned above. As a modular approach 
> is being followed, to start of, only methods GwyResourceProfileImpl will be 
> considered. So the RegistryServiceHandler methods only with respect to 
> GwyResourceProfileImpl will be modified. Subsequently all methods related to 
> app catalog will be refactored.
> *Progress*:
>  * Implemeted GatewayResourceProfileRepository.
>  * Implemented ComputeResourceRepository.
>  * Implemented StorageResourceRepository.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434142#comment-16434142
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180817247
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
+try {
+final String storageResourceId = 
AppCatalogUtils.getID(description.getHostName());
+if (description.getStorageResourceDescription().equals("") || 
description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID))
 {
+description.setStorageResourceId(storageResourceId);
+}
+description.setCreationTime(System.currentTimeMillis());
+if (description.getDataMovementInterfaces() != null) {
+description.getDataMovementInterfaces().stream().forEach(dm -> 
dm.setStorageResourceId(description.getStorageResourceId()));
+}
+StorageResourceDescription storageResourceDescription = 
create(description);
+return storageResourceDescription.getStorageResourceId();
+} catch (Exception e) {
+logger.error("Error while saving storage resource...", e);
+throw new AppCatalogException(e);
 
 Review comment:
   Add a message to exception. Probably the same one that you have put in the 
log message


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refactoring App Catalog implementation
> --
>
> Key: AIRAVATA-2619
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2619
> Project: Airavata
>  Issue Type: Sub-task
>Reporter: Sachin Kariyattin
>Assignee: Sachin Kariyattin
>Priority: Major
>
> The app catalog module contains the following Impl classes.
> {quote}ApplicationDeploymentImpl
>  ApplicationInterfaceImpl
>  ComputeResourceImpl
>  GwyResourceProfileImpl
>  StorageResourceImpl
>  UsrResourceProfileImpl
> {quote}
> This task involves 

[jira] [Assigned] (AIRAVATA-2747) OOM issue in Helix Participant

2018-04-11 Thread Dimuthu Upeksha (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRAVATA-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Upeksha reassigned AIRAVATA-2747:
-

Assignee: Dimuthu Upeksha

> OOM issue in Helix Participant
> --
>
> Key: AIRAVATA-2747
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2747
> Project: Airavata
>  Issue Type: Bug
>  Components: helix implementation
>Reporter: Dimuthu Upeksha
>Assignee: Dimuthu Upeksha
>Priority: Major
> Attachments: airavata.log, threaddump-oom.log
>
>
> There seems to be an memory leak in helix participant when creating the SSH 
> sessions.
> 2018-04-11 16:06:35,916 [TaskStateModelFactory-task_thread] INFO 
> o.a.a.h.i.t.s.DataStagingTask 
> process=PROCESS_ad3fd791-a165-4e1d-bf25-cf4fa86c1970, 
> task=TASK_049812b4-5462-45dd-95a1-9c1db3a5cf73, 
> experiment=SLM001-NEK5000-BR2_08789b1b-feff-46f9-9f4b-67ee9ded280d, 
> gateway=default - Downloading output file 
> /N/dc2/scratch/cgateway/gta-work-dirs/PROCESS_ad3fd791-a165-4e1d-bf25-cf4fa86c1970/NEK5000.stdout
>  to the local path 
> /tmp/PROCESS_ad3fd791-a165-4e1d-bf25-cf4fa86c1970/temp_inputs/NEK5000.stdout
> 2018-04-11 16:06:35,929 [TaskStateModelFactory-task_thread] ERROR 
> o.apache.helix.task.TaskRunner - Problem running the task, report task as 
> FAILED.
> java.lang.OutOfMemoryError: unable to create new native thread
>  at java.lang.Thread.start0(Native Method)
>  at java.lang.Thread.start(Thread.java:717)
>  at com.jcraft.jsch.Session.connect(Session.java:528)
>  at com.jcraft.jsch.Session.connect(Session.java:183)
>  at 
> org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:81)
>  at 
> org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:112)
>  at 
> org.apache.airavata.helix.core.support.AdaptorSupportImpl.fetchAdaptor(AdaptorSupportImpl.java:59)
>  at 
> org.apache.airavata.helix.impl.task.submission.DefaultJobSubmissionTask.onRun(DefaultJobSubmissionTask.java:58)
>  at 
> org.apache.airavata.helix.impl.task.AiravataTask.onRun(AiravataTask.java:268)
>  at org.apache.airavata.helix.core.AbstractTask.run(AbstractTask.java:82)
>  at org.apache.helix.task.TaskRunner.run(TaskRunner.java:71)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  at java.lang.Thread.run(Thread.java:748)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (AIRAVATA-2747) OOM issue in Helix Participant

2018-04-11 Thread Dimuthu Upeksha (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRAVATA-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Upeksha updated AIRAVATA-2747:
--
Attachment: airavata.log
threaddump-oom.log

> OOM issue in Helix Participant
> --
>
> Key: AIRAVATA-2747
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2747
> Project: Airavata
>  Issue Type: Bug
>  Components: helix implementation
>Reporter: Dimuthu Upeksha
>Priority: Major
> Attachments: airavata.log, threaddump-oom.log
>
>
> There seems to be an memory leak in helix participant when creating the SSH 
> sessions.
> 2018-04-11 16:06:35,916 [TaskStateModelFactory-task_thread] INFO 
> o.a.a.h.i.t.s.DataStagingTask 
> process=PROCESS_ad3fd791-a165-4e1d-bf25-cf4fa86c1970, 
> task=TASK_049812b4-5462-45dd-95a1-9c1db3a5cf73, 
> experiment=SLM001-NEK5000-BR2_08789b1b-feff-46f9-9f4b-67ee9ded280d, 
> gateway=default - Downloading output file 
> /N/dc2/scratch/cgateway/gta-work-dirs/PROCESS_ad3fd791-a165-4e1d-bf25-cf4fa86c1970/NEK5000.stdout
>  to the local path 
> /tmp/PROCESS_ad3fd791-a165-4e1d-bf25-cf4fa86c1970/temp_inputs/NEK5000.stdout
> 2018-04-11 16:06:35,929 [TaskStateModelFactory-task_thread] ERROR 
> o.apache.helix.task.TaskRunner - Problem running the task, report task as 
> FAILED.
> java.lang.OutOfMemoryError: unable to create new native thread
>  at java.lang.Thread.start0(Native Method)
>  at java.lang.Thread.start(Thread.java:717)
>  at com.jcraft.jsch.Session.connect(Session.java:528)
>  at com.jcraft.jsch.Session.connect(Session.java:183)
>  at 
> org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:81)
>  at 
> org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:112)
>  at 
> org.apache.airavata.helix.core.support.AdaptorSupportImpl.fetchAdaptor(AdaptorSupportImpl.java:59)
>  at 
> org.apache.airavata.helix.impl.task.submission.DefaultJobSubmissionTask.onRun(DefaultJobSubmissionTask.java:58)
>  at 
> org.apache.airavata.helix.impl.task.AiravataTask.onRun(AiravataTask.java:268)
>  at org.apache.airavata.helix.core.AbstractTask.run(AbstractTask.java:82)
>  at org.apache.helix.task.TaskRunner.run(TaskRunner.java:71)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  at java.lang.Thread.run(Thread.java:748)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (AIRAVATA-2749) Experiment status not updated, but job is COMPLETED and outputs are staged.

2018-04-11 Thread Eroma (JIRA)
Eroma created AIRAVATA-2749:
---

 Summary: Experiment status not updated, but job is COMPLETED and 
outputs are staged.
 Key: AIRAVATA-2749
 URL: https://issues.apache.org/jira/browse/AIRAVATA-2749
 Project: Airavata
  Issue Type: Bug
  Components: helix implementation
Affects Versions: 0.18
Reporter: Eroma
Assignee: Dimuthu Upeksha
 Fix For: 0.18


# Experiment launched and job submitted and completed sucesfully.
 # Output files are also staged and available in the gateway portal as well.
 # Experiment status not changed to COMPLETED, in EXECUTING
 # No errors in the participant or controller logs.

|SLM001-Gaussian-Carbonate_8473f6fc-5d24-4101-84db-1b05c46ba882
 
|



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2697) Update GroupResourceProfile methods in API server to use sharing API to enforce READ and WRITE rules

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434366#comment-16434366
 ] 

ASF GitHub Bot commented on AIRAVATA-2697:
--

machristie commented on issue #181: [AIRAVATA-2697] Update GroupResourceProfile 
methods in API server to use sharing API to enforce READ and WRITE rules
URL: https://github.com/apache/airavata/pull/181#issuecomment-380548476
 
 
   +1, looks good @sachinkariyattin 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Update GroupResourceProfile methods in API server to use sharing API to 
> enforce READ and WRITE rules
> 
>
> Key: AIRAVATA-2697
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2697
> Project: Airavata
>  Issue Type: Bug
>Reporter: Marcus Christie
>Assignee: Sachin Kariyattin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2697) Update GroupResourceProfile methods in API server to use sharing API to enforce READ and WRITE rules

2018-04-11 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434369#comment-16434369
 ] 

ASF subversion and git services commented on AIRAVATA-2697:
---

Commit 7d696e0f67df7773ec4db32dcb28583e66eb3882 in airavata's branch 
refs/heads/group-based-auth from [~marcuschristie]
[ https://gitbox.apache.org/repos/asf?p=airavata.git;h=7d696e0 ]

Merge pull request #181 from sachinkariyattin/group-based-auth

[AIRAVATA-2697] Update GroupResourceProfile methods in API server to use 
sharing API to enforce READ and WRITE rules

> Update GroupResourceProfile methods in API server to use sharing API to 
> enforce READ and WRITE rules
> 
>
> Key: AIRAVATA-2697
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2697
> Project: Airavata
>  Issue Type: Bug
>Reporter: Marcus Christie
>Assignee: Sachin Kariyattin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (AIRAVATA-2747) OOM issue in Helix Participant

2018-04-11 Thread Dimuthu Upeksha (JIRA)
Dimuthu Upeksha created AIRAVATA-2747:
-

 Summary: OOM issue in Helix Participant
 Key: AIRAVATA-2747
 URL: https://issues.apache.org/jira/browse/AIRAVATA-2747
 Project: Airavata
  Issue Type: Bug
  Components: helix implementation
Reporter: Dimuthu Upeksha


There seems to be an memory leak in helix participant when creating the SSH 
sessions.

2018-04-11 16:06:35,916 [TaskStateModelFactory-task_thread] INFO 
o.a.a.h.i.t.s.DataStagingTask 
process=PROCESS_ad3fd791-a165-4e1d-bf25-cf4fa86c1970, 
task=TASK_049812b4-5462-45dd-95a1-9c1db3a5cf73, 
experiment=SLM001-NEK5000-BR2_08789b1b-feff-46f9-9f4b-67ee9ded280d, 
gateway=default - Downloading output file 
/N/dc2/scratch/cgateway/gta-work-dirs/PROCESS_ad3fd791-a165-4e1d-bf25-cf4fa86c1970/NEK5000.stdout
 to the local path 
/tmp/PROCESS_ad3fd791-a165-4e1d-bf25-cf4fa86c1970/temp_inputs/NEK5000.stdout
2018-04-11 16:06:35,929 [TaskStateModelFactory-task_thread] ERROR 
o.apache.helix.task.TaskRunner - Problem running the task, report task as 
FAILED.
java.lang.OutOfMemoryError: unable to create new native thread
 at java.lang.Thread.start0(Native Method)
 at java.lang.Thread.start(Thread.java:717)
 at com.jcraft.jsch.Session.connect(Session.java:528)
 at com.jcraft.jsch.Session.connect(Session.java:183)
 at 
org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:81)
 at 
org.apache.airavata.helix.agent.ssh.SshAgentAdaptor.init(SshAgentAdaptor.java:112)
 at 
org.apache.airavata.helix.core.support.AdaptorSupportImpl.fetchAdaptor(AdaptorSupportImpl.java:59)
 at 
org.apache.airavata.helix.impl.task.submission.DefaultJobSubmissionTask.onRun(DefaultJobSubmissionTask.java:58)
 at 
org.apache.airavata.helix.impl.task.AiravataTask.onRun(AiravataTask.java:268)
 at org.apache.airavata.helix.core.AbstractTask.run(AbstractTask.java:82)
 at org.apache.helix.task.TaskRunner.run(TaskRunner.java:71)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
 at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
 at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:748)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2697) Update GroupResourceProfile methods in API server to use sharing API to enforce READ and WRITE rules

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434368#comment-16434368
 ] 

ASF GitHub Bot commented on AIRAVATA-2697:
--

machristie closed pull request #181: [AIRAVATA-2697] Update 
GroupResourceProfile methods in API server to use sharing API to enforce READ 
and WRITE rules
URL: https://github.com/apache/airavata/pull/181
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
 
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 99a1cb8ac9..47479dc75d 100644
--- 
a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ 
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -45,12 +45,7 @@
 import 
org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
 import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
 import 
org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
-import org.apache.airavata.model.appcatalog.computeresource.CloudJobSubmission;
-import 
org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
-import org.apache.airavata.model.appcatalog.computeresource.LOCALSubmission;
-import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager;
-import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission;
-import 
org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission;
+import org.apache.airavata.model.appcatalog.computeresource.*;
 import 
org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
 import 
org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
 import org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference;
@@ -5079,9 +5074,31 @@ else 
if(userPermission.getValue().equals(ResourcePermissionType.EXEC))
 @SecurityCheck
 public void createGroupResourceProfile(AuthzToken authzToken, 
GroupResourceProfile groupResourceProfile) throws InvalidRequestException, 
AiravataClientException, AiravataSystemException, AuthorizationException, 
TException {
 RegistryService.Client regClient = registryClientPool.getResource();
+SharingRegistryService.Client sharingClient = 
sharingClientPool.getResource();
+String userName = authzToken.getClaimsMap().get(Constants.USER_NAME);
 try {
-regClient.createGroupResourceProfile(groupResourceProfile);
+String groupResourceProfileId = 
regClient.createGroupResourceProfile(groupResourceProfile);
+if(ServerSettings.isEnableSharing()) {
+try {
+Entity entity = new Entity();
+entity.setEntityId(groupResourceProfileId);
+entity.setDomainId(groupResourceProfile.getGatewayId());
+entity.setEntityTypeId(groupResourceProfile.getGatewayId() 
+ ":" + "GROUP_RESOURCE_PROFILE");
+entity.setOwnerId(userName + "@" + 
groupResourceProfile.getGatewayId());
+
entity.setName(groupResourceProfile.getGroupResourceProfileName());
+
+sharingClient.createEntity(entity);
+} catch (Exception ex) {
+logger.error(ex.getMessage(), ex);
+logger.error("Rolling back group resource profile creation 
Group Resource Profile ID : " + groupResourceProfileId);
+
regClient.removeGroupResourceProfile(groupResourceProfileId);
+AiravataSystemException ase = new 
AiravataSystemException();
+ase.setMessage("Failed to create sharing registry record");
+throw ase;
+}
+}
 registryClientPool.returnResource(regClient);
+sharingClientPool.returnResource(sharingClient);
 } catch (Exception e) {
 String msg = "Error creating group resource profile.";
 logger.error(msg, e);
@@ -5096,9 +5113,23 @@ public void createGroupResourceProfile(AuthzToken 
authzToken, GroupResourceProfi
 @SecurityCheck
 public void updateGroupResourceProfile(AuthzToken authzToken, 
GroupResourceProfile groupResourceProfile) throws InvalidRequestException, 
AiravataClientException, AiravataSystemException, AuthorizationException, 
TException {
 RegistryService.Client regClient = 

[jira] [Updated] (AIRAVATA-2750) Helix Participant is not picking up tasks after a restart

2018-04-11 Thread Dimuthu Upeksha (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRAVATA-2750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Upeksha updated AIRAVATA-2750:
--
Component/s: helix implementation

> Helix Participant is not picking up tasks after a restart
> -
>
> Key: AIRAVATA-2750
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2750
> Project: Airavata
>  Issue Type: Bug
>  Components: helix implementation
>Reporter: Dimuthu Upeksha
>Priority: Major
>
> Helix Participant was restarted due to an OOM issue then it did not pickup 
> any task. By changing the participant name fixed that. Controller log
>  
> 2018-04-11 19:17:41,850 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - All partitions: [0] taskAssignment: 
> \{helixparticipant=[]} excludedInstances: []
> 2018-04-11 19:17:41,850 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Throttle tasks to be assigned to instance 
> helixparticipant using limitation: Job Concurrent Task(1), Participant Max 
> Task(40). Remaining capacity -8.
> 2018-04-11 19:17:41,859 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Job 
> Workflow_of_process_PROCESS_e14813b1-a93b-47c8-9faa-634b3cdf47b7-POST-f9e7f2c1-e3af-4f46-8740-b71289e23270_TASK_70f5baae-6e11-4448-9962-e7a964cdff37
>  new assignment []
> 2018-04-11 19:17:41,859 [GenericHelixController-event_process] DEBUG 
> o.a.h.c.s.BestPossibleStateCalcStage - Processing 
> resource:Workflow_of_process_PROCESS_c3fa99be-557a-4c25-bbb7-d4bada5d0ede-PRE-06933b15-fb89-48b9-8501-3bd4a20a1a5f_TASK_ab90e04f-a4d6-4ead-b81c-f021748f4179
> 2018-04-11 19:17:41,859 [GenericHelixController-event_process] DEBUG 
> o.a.h.c.s.BestPossibleStateCalcStage - resource 
> Workflow_of_process_PROCESS_c3fa99be-557a-4c25-bbb7-d4bada5d0ede-PRE-06933b15-fb89-48b9-8501-3bd4a20a1a5f_TASK_ab90e04f-a4d6-4ead-b81c-f021748f4179
>  use idealStateRebalancer org.apache.helix.task.JobRebalancer
> 2018-04-11 19:17:41,859 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Computer Best Partition for job: 
> Workflow_of_process_PROCESS_c3fa99be-557a-4c25-bbb7-d4bada5d0ede-PRE-06933b15-fb89-48b9-8501-3bd4a20a1a5f_TASK_ab90e04f-a4d6-4ead-b81c-f021748f4179
> 2018-04-11 19:17:41,860 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - All partitions: [0] taskAssignment: 
> \{helixparticipant=[]} excludedInstances: []
> 2018-04-11 19:17:41,861 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Throttle tasks to be assigned to instance 
> helixparticipant using limitation: Job Concurrent Task(1), Participant Max 
> Task(40). Remaining capacity -8.
> 2018-04-11 19:17:41,871 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Job 
> Workflow_of_process_PROCESS_c3fa99be-557a-4c25-bbb7-d4bada5d0ede-PRE-06933b15-fb89-48b9-8501-3bd4a20a1a5f_TASK_ab90e04f-a4d6-4ead-b81c-f021748f4179
>  new assignment []
> 2018-04-11 19:17:41,872 [GenericHelixController-event_process] DEBUG 
> o.a.h.c.s.BestPossibleStateCalcStage - Processing 
> resource:Workflow_of_process_PROCESS_5b71bc64-49f9-4bf5-801d-359dc35f58ef-POST-54334da3-d6b8-4d9f-b956-9fd943290d66_TASK_0f141d85-8633-470e-81bb-5158bf8e2ad9
> 2018-04-11 19:17:41,872 [GenericHelixController-event_process] DEBUG 
> o.a.h.c.s.BestPossibleStateCalcStage - resource 
> Workflow_of_process_PROCESS_5b71bc64-49f9-4bf5-801d-359dc35f58ef-POST-54334da3-d6b8-4d9f-b956-9fd943290d66_TASK_0f141d85-8633-470e-81bb-5158bf8e2ad9
>  use idealStateRebalancer org.apache.helix.task.JobRebalancer
> 2018-04-11 19:17:41,872 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Computer Best Partition for job: 
> Workflow_of_process_PROCESS_5b71bc64-49f9-4bf5-801d-359dc35f58ef-POST-54334da3-d6b8-4d9f-b956-9fd943290d66_TASK_0f141d85-8633-470e-81bb-5158bf8e2ad9
> 2018-04-11 19:17:41,873 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - All partitions: [0] taskAssignment: 
> \{helixparticipant=[]} excludedInstances: []
> 2018-04-11 19:17:41,873 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Throttle tasks to be assigned to instance 
> helixparticipant using limitation: Job Concurrent Task(1), Participant Max 
> Task(40). Remaining capacity -8.
> 2018-04-11 19:17:41,884 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Job 
> Workflow_of_process_PROCESS_5b71bc64-49f9-4bf5-801d-359dc35f58ef-POST-54334da3-d6b8-4d9f-b956-9fd943290d66_TASK_0f141d85-8633-470e-81bb-5158bf8e2ad9
>  new assignment []
> 2018-04-11 19:17:41,884 [GenericHelixController-event_process] DEBUG 
> o.a.h.c.s.BestPossibleStateCalcStage - Processing 
> 

[jira] [Assigned] (AIRAVATA-2750) Helix Participant is not picking up tasks after a restart

2018-04-11 Thread Dimuthu Upeksha (JIRA)

 [ 
https://issues.apache.org/jira/browse/AIRAVATA-2750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dimuthu Upeksha reassigned AIRAVATA-2750:
-

Assignee: Dimuthu Upeksha

> Helix Participant is not picking up tasks after a restart
> -
>
> Key: AIRAVATA-2750
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2750
> Project: Airavata
>  Issue Type: Bug
>  Components: helix implementation
>Reporter: Dimuthu Upeksha
>Assignee: Dimuthu Upeksha
>Priority: Major
>
> Helix Participant was restarted due to an OOM issue then it did not pickup 
> any task. By changing the participant name fixed that. Controller log
>  
> 2018-04-11 19:17:41,850 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - All partitions: [0] taskAssignment: 
> \{helixparticipant=[]} excludedInstances: []
> 2018-04-11 19:17:41,850 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Throttle tasks to be assigned to instance 
> helixparticipant using limitation: Job Concurrent Task(1), Participant Max 
> Task(40). Remaining capacity -8.
> 2018-04-11 19:17:41,859 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Job 
> Workflow_of_process_PROCESS_e14813b1-a93b-47c8-9faa-634b3cdf47b7-POST-f9e7f2c1-e3af-4f46-8740-b71289e23270_TASK_70f5baae-6e11-4448-9962-e7a964cdff37
>  new assignment []
> 2018-04-11 19:17:41,859 [GenericHelixController-event_process] DEBUG 
> o.a.h.c.s.BestPossibleStateCalcStage - Processing 
> resource:Workflow_of_process_PROCESS_c3fa99be-557a-4c25-bbb7-d4bada5d0ede-PRE-06933b15-fb89-48b9-8501-3bd4a20a1a5f_TASK_ab90e04f-a4d6-4ead-b81c-f021748f4179
> 2018-04-11 19:17:41,859 [GenericHelixController-event_process] DEBUG 
> o.a.h.c.s.BestPossibleStateCalcStage - resource 
> Workflow_of_process_PROCESS_c3fa99be-557a-4c25-bbb7-d4bada5d0ede-PRE-06933b15-fb89-48b9-8501-3bd4a20a1a5f_TASK_ab90e04f-a4d6-4ead-b81c-f021748f4179
>  use idealStateRebalancer org.apache.helix.task.JobRebalancer
> 2018-04-11 19:17:41,859 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Computer Best Partition for job: 
> Workflow_of_process_PROCESS_c3fa99be-557a-4c25-bbb7-d4bada5d0ede-PRE-06933b15-fb89-48b9-8501-3bd4a20a1a5f_TASK_ab90e04f-a4d6-4ead-b81c-f021748f4179
> 2018-04-11 19:17:41,860 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - All partitions: [0] taskAssignment: 
> \{helixparticipant=[]} excludedInstances: []
> 2018-04-11 19:17:41,861 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Throttle tasks to be assigned to instance 
> helixparticipant using limitation: Job Concurrent Task(1), Participant Max 
> Task(40). Remaining capacity -8.
> 2018-04-11 19:17:41,871 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Job 
> Workflow_of_process_PROCESS_c3fa99be-557a-4c25-bbb7-d4bada5d0ede-PRE-06933b15-fb89-48b9-8501-3bd4a20a1a5f_TASK_ab90e04f-a4d6-4ead-b81c-f021748f4179
>  new assignment []
> 2018-04-11 19:17:41,872 [GenericHelixController-event_process] DEBUG 
> o.a.h.c.s.BestPossibleStateCalcStage - Processing 
> resource:Workflow_of_process_PROCESS_5b71bc64-49f9-4bf5-801d-359dc35f58ef-POST-54334da3-d6b8-4d9f-b956-9fd943290d66_TASK_0f141d85-8633-470e-81bb-5158bf8e2ad9
> 2018-04-11 19:17:41,872 [GenericHelixController-event_process] DEBUG 
> o.a.h.c.s.BestPossibleStateCalcStage - resource 
> Workflow_of_process_PROCESS_5b71bc64-49f9-4bf5-801d-359dc35f58ef-POST-54334da3-d6b8-4d9f-b956-9fd943290d66_TASK_0f141d85-8633-470e-81bb-5158bf8e2ad9
>  use idealStateRebalancer org.apache.helix.task.JobRebalancer
> 2018-04-11 19:17:41,872 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Computer Best Partition for job: 
> Workflow_of_process_PROCESS_5b71bc64-49f9-4bf5-801d-359dc35f58ef-POST-54334da3-d6b8-4d9f-b956-9fd943290d66_TASK_0f141d85-8633-470e-81bb-5158bf8e2ad9
> 2018-04-11 19:17:41,873 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - All partitions: [0] taskAssignment: 
> \{helixparticipant=[]} excludedInstances: []
> 2018-04-11 19:17:41,873 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Throttle tasks to be assigned to instance 
> helixparticipant using limitation: Job Concurrent Task(1), Participant Max 
> Task(40). Remaining capacity -8.
> 2018-04-11 19:17:41,884 [GenericHelixController-event_process] DEBUG 
> o.a.helix.task.JobRebalancer - Job 
> Workflow_of_process_PROCESS_5b71bc64-49f9-4bf5-801d-359dc35f58ef-POST-54334da3-d6b8-4d9f-b956-9fd943290d66_TASK_0f141d85-8633-470e-81bb-5158bf8e2ad9
>  new assignment []
> 2018-04-11 19:17:41,884 [GenericHelixController-event_process] DEBUG 
> o.a.h.c.s.BestPossibleStateCalcStage - Processing 
> 

[jira] [Created] (AIRAVATA-2751) Dozer custom mapping to skip primitive fields that aren't set

2018-04-11 Thread Marcus Christie (JIRA)
Marcus Christie created AIRAVATA-2751:
-

 Summary: Dozer custom mapping to skip primitive fields that aren't 
set
 Key: AIRAVATA-2751
 URL: https://issues.apache.org/jira/browse/AIRAVATA-2751
 Project: Airavata
  Issue Type: Bug
Reporter: Marcus Christie


I'm finding that primitive fields that aren't set on a thrift model, like 
{{long}}, are mapped into entities as a 0.  The Dozer mapping (see 
ObjectMapperSingleton) isn't calling {{isSet}} on the thrift models to make 
sure that they are mapped.

Here's some pseudo code that I think would do the trick, although I'm not sure 
if a CustomFieldMapper is the right way to customize this in Dozer (seemed like 
the best option given the research I did):
{code}
public static ObjectMapperSingleton getInstance(){
if(instance == null) {
instance = new ObjectMapperSingleton();
instance.setCustomFieldMapper(new CustomFieldMapper() {
@Override
public boolean mapField(Object source, Object destination, 
Object sourceFieldValue, ClassMap classMap, FieldMap fieldMap) {
if (source instanceof TBase) {
TBase thriftSource = (TBase) source;
// TODO: following doesn't work, needs reflection
srcField = 
thriftSource.getClass()._Fields.byName(fieldMap.getSrcFieldName());
if (!thriftSource.isSet(srcField)) {
// Just skipping mapping field if not set on Thrift 
source model
return true;
}

}
return false;
}
});
}
return instance;
}
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16433461#comment-16433461
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

sachinkariyattin commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180645874
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java
 ##
 @@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.registry.core.repositories.appcatalog;
+
+import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK;
+import 
org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity;
+import org.apache.airavata.registry.core.utils.AppCatalogUtils;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.apache.airavata.registry.cpi.StorageResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by skariyat on 3/12/18.
+ */
+public class StorageResourceRepository extends 
AppCatAbstractRepository implements StorageResource {
+
+private final static Logger logger = 
LoggerFactory.getLogger(StorageResourceRepository.class);
+
+
+public StorageResourceRepository() {
+super(StorageResourceDescription.class, StorageResourceEntity.class);
+}
+
+
+@Override
+public String addStorageResource(StorageResourceDescription description) 
throws AppCatalogException {
 
 Review comment:
   Since StorageResourceRepository implements the StorageResource CPI 
(https://github.com/apache/airavata/blob/master/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/StorageResource.java),
  I just had to implement these methods. Otherwise as you have mentioned there 
is no need of two similar methods like these


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refactoring App Catalog implementation
> --
>
> Key: AIRAVATA-2619
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2619
> Project: Airavata
>  Issue Type: Sub-task
>Reporter: Sachin Kariyattin
>Assignee: Sachin Kariyattin
>Priority: Major
>
> The app catalog module contains the following Impl classes.
> {quote}ApplicationDeploymentImpl
>  ApplicationInterfaceImpl
>  ComputeResourceImpl
>  GwyResourceProfileImpl
>  StorageResourceImpl
>  UsrResourceProfileImpl
> {quote}
> This task involves creating a repository class for app catalog and include 
> all the methods from the Impl classes mentioned above. As a modular approach 
> is being followed, to start of, only methods GwyResourceProfileImpl will be 
> considered. So the RegistryServiceHandler methods only with respect to 
> GwyResourceProfileImpl will be modified. Subsequently all methods related to 
> app catalog will be refactored.
> *Progress*:
>  * Implemeted GatewayResourceProfileRepository.
>  * Implemented ComputeResourceRepository.
>  * Implemented StorageResourceRepository.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434969#comment-16434969
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

sachinkariyattin commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180968963
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java
 ##
 @@ -329,8 +329,11 @@ public String addDataMovementProtocol(String resourceId, 
DMType dmType, DataMove
 return (new 
DataMovementRepository()).addDataMovementProtocol(resourceId, 
dataMovementInterface);
 }
 else if (dmType.equals(DMType.STORAGE_RESOURCE)){
-//TODO - COMPLETE this after StorageResourceRepo implementation
-return null;
+Mapper mapper = ObjectMapperSingleton.getInstance();
 
 Review comment:
   Moved this to DataMovementRepository


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refactoring App Catalog implementation
> --
>
> Key: AIRAVATA-2619
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2619
> Project: Airavata
>  Issue Type: Sub-task
>Reporter: Sachin Kariyattin
>Assignee: Sachin Kariyattin
>Priority: Major
>
> The app catalog module contains the following Impl classes.
> {quote}ApplicationDeploymentImpl
>  ApplicationInterfaceImpl
>  ComputeResourceImpl
>  GwyResourceProfileImpl
>  StorageResourceImpl
>  UsrResourceProfileImpl
> {quote}
> This task involves creating a repository class for app catalog and include 
> all the methods from the Impl classes mentioned above. As a modular approach 
> is being followed, to start of, only methods GwyResourceProfileImpl will be 
> considered. So the RegistryServiceHandler methods only with respect to 
> GwyResourceProfileImpl will be modified. Subsequently all methods related to 
> app catalog will be refactored.
> *Progress*:
>  * Implemeted GatewayResourceProfileRepository.
>  * Implemented ComputeResourceRepository.
>  * Implemented StorageResourceRepository.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434967#comment-16434967
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

sachinkariyattin commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180968936
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java
 ##
 @@ -20,26 +20,29 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
+import javax.persistence.*;
 import java.io.Serializable;
 import java.sql.Timestamp;
 
 /**
  * The persistent class for the storage_interface database table.
  */
 @Entity
-@Table(name = "storage_interface")
+@Table(name = "STORAGE_INTERFACE")
+@IdClass(StorageInterfacePK.class)
 public class StorageInterfaceEntity implements Serializable {
 private static final long serialVersionUID = 1L;
 
-@EmbeddedId
-private StorageInterfacePK id;
+@Id
+@Column(name="STORAGE_RESOURCE_ID")
+private String storageResourceId;
+
+@Id
+@Column(name="DATA_MOVEMENT_INTERFACE_ID")
+private String dataMovementInterfaceId;
 
 @Column(name = "CREATION_TIME")
-private Timestamp creationTime;
+private long creationTime;
 
 Review comment:
   @machristie I have added a custom dozer converter to map from long to 
TIMESTAMP.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refactoring App Catalog implementation
> --
>
> Key: AIRAVATA-2619
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2619
> Project: Airavata
>  Issue Type: Sub-task
>Reporter: Sachin Kariyattin
>Assignee: Sachin Kariyattin
>Priority: Major
>
> The app catalog module contains the following Impl classes.
> {quote}ApplicationDeploymentImpl
>  ApplicationInterfaceImpl
>  ComputeResourceImpl
>  GwyResourceProfileImpl
>  StorageResourceImpl
>  UsrResourceProfileImpl
> {quote}
> This task involves creating a repository class for app catalog and include 
> all the methods from the Impl classes mentioned above. As a modular approach 
> is being followed, to start of, only methods GwyResourceProfileImpl will be 
> considered. So the RegistryServiceHandler methods only with respect to 
> GwyResourceProfileImpl will be modified. Subsequently all methods related to 
> app catalog will be refactored.
> *Progress*:
>  * Implemeted GatewayResourceProfileRepository.
>  * Implemented ComputeResourceRepository.
>  * Implemented StorageResourceRepository.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434970#comment-16434970
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

sachinkariyattin commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180968963
 
 

 ##
 File path: 
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java
 ##
 @@ -329,8 +329,11 @@ public String addDataMovementProtocol(String resourceId, 
DMType dmType, DataMove
 return (new 
DataMovementRepository()).addDataMovementProtocol(resourceId, 
dataMovementInterface);
 }
 else if (dmType.equals(DMType.STORAGE_RESOURCE)){
-//TODO - COMPLETE this after StorageResourceRepo implementation
-return null;
+Mapper mapper = ObjectMapperSingleton.getInstance();
 
 Review comment:
   Moved this to DataMovementRepository


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refactoring App Catalog implementation
> --
>
> Key: AIRAVATA-2619
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2619
> Project: Airavata
>  Issue Type: Sub-task
>Reporter: Sachin Kariyattin
>Assignee: Sachin Kariyattin
>Priority: Major
>
> The app catalog module contains the following Impl classes.
> {quote}ApplicationDeploymentImpl
>  ApplicationInterfaceImpl
>  ComputeResourceImpl
>  GwyResourceProfileImpl
>  StorageResourceImpl
>  UsrResourceProfileImpl
> {quote}
> This task involves creating a repository class for app catalog and include 
> all the methods from the Impl classes mentioned above. As a modular approach 
> is being followed, to start of, only methods GwyResourceProfileImpl will be 
> considered. So the RegistryServiceHandler methods only with respect to 
> GwyResourceProfileImpl will be modified. Subsequently all methods related to 
> app catalog will be refactored.
> *Progress*:
>  * Implemeted GatewayResourceProfileRepository.
>  * Implemented ComputeResourceRepository.
>  * Implemented StorageResourceRepository.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434972#comment-16434972
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

sachinkariyattin commented on a change in pull request #182: [AIRAVATA-2619] 
Refactoring App Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#discussion_r180969151
 
 

 ##
 File path: 
modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
 ##
 @@ -1626,8 +1627,7 @@ public boolean deleteComputeResource(String 
computeResourceId) throws RegistrySe
 @Override
 public StorageResourceDescription getStorageResource(String 
storageResourceId) throws RegistryServiceException, TException {
 try {
-appCatalog = RegistryFactory.getAppCatalog();
-StorageResourceDescription storageResource = 
appCatalog.getStorageResource().getStorageResource(storageResourceId);
+StorageResourceDescription storageResource = new 
StorageResourceRepository().getStorageResource(storageResourceId);
 
 Review comment:
   Done!. I have to do this for other repository classes as well 
(GatewayRepository, ComputeRepository etc.)
   
   I will make these changes in another PR.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refactoring App Catalog implementation
> --
>
> Key: AIRAVATA-2619
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2619
> Project: Airavata
>  Issue Type: Sub-task
>Reporter: Sachin Kariyattin
>Assignee: Sachin Kariyattin
>Priority: Major
>
> The app catalog module contains the following Impl classes.
> {quote}ApplicationDeploymentImpl
>  ApplicationInterfaceImpl
>  ComputeResourceImpl
>  GwyResourceProfileImpl
>  StorageResourceImpl
>  UsrResourceProfileImpl
> {quote}
> This task involves creating a repository class for app catalog and include 
> all the methods from the Impl classes mentioned above. As a modular approach 
> is being followed, to start of, only methods GwyResourceProfileImpl will be 
> considered. So the RegistryServiceHandler methods only with respect to 
> GwyResourceProfileImpl will be modified. Subsequently all methods related to 
> app catalog will be refactored.
> *Progress*:
>  * Implemeted GatewayResourceProfileRepository.
>  * Implemented ComputeResourceRepository.
>  * Implemented StorageResourceRepository.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation

2018-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16434973#comment-16434973
 ] 

ASF GitHub Bot commented on AIRAVATA-2619:
--

sachinkariyattin commented on issue #182: [AIRAVATA-2619] Refactoring App 
Catalog implementation - StorageResource
URL: https://github.com/apache/airavata/pull/182#issuecomment-380683999
 
 
   @machristie @DImuthuUpe Thanks for the review. I have implemented the 
suggested changes


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refactoring App Catalog implementation
> --
>
> Key: AIRAVATA-2619
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2619
> Project: Airavata
>  Issue Type: Sub-task
>Reporter: Sachin Kariyattin
>Assignee: Sachin Kariyattin
>Priority: Major
>
> The app catalog module contains the following Impl classes.
> {quote}ApplicationDeploymentImpl
>  ApplicationInterfaceImpl
>  ComputeResourceImpl
>  GwyResourceProfileImpl
>  StorageResourceImpl
>  UsrResourceProfileImpl
> {quote}
> This task involves creating a repository class for app catalog and include 
> all the methods from the Impl classes mentioned above. As a modular approach 
> is being followed, to start of, only methods GwyResourceProfileImpl will be 
> considered. So the RegistryServiceHandler methods only with respect to 
> GwyResourceProfileImpl will be modified. Subsequently all methods related to 
> app catalog will be refactored.
> *Progress*:
>  * Implemeted GatewayResourceProfileRepository.
>  * Implemented ComputeResourceRepository.
>  * Implemented StorageResourceRepository.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)