[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412206#comment-16412206 ] ASF GitHub Bot commented on AIRAVATA-2712: -- tilaks26 commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176881067 ## File path: modules/registry-refactoring/src/main/resources/META-INF/persistence.xml ## @@ -122,6 +122,9 @@ org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK Review comment: I've removed it. It's a part of the [https://github.com/apache/airavata/pull/167] 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 - User Resource Profile > -- > > Key: AIRAVATA-2712 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2712 > Project: Airavata > Issue Type: Improvement > Components: Registry API >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412204#comment-16412204 ] ASF GitHub Bot commented on AIRAVATA-2712: -- tilaks26 commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176880712 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/UserResourceProfileRepository.java ## @@ -0,0 +1,227 @@ +/** + * + * 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.userresourceprofile.UserComputeResourcePreference; +import org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile; +import org.apache.airavata.model.appcatalog.userresourceprofile.UserStoragePreference; +import org.apache.airavata.registry.core.entities.appcatalog.UserComputeResourcePreferencePK; +import org.apache.airavata.registry.core.entities.appcatalog.UserResourceProfileEntity; +import org.apache.airavata.registry.core.entities.appcatalog.UserResourceProfilePK; +import org.apache.airavata.registry.core.entities.appcatalog.UserStoragePreferencePK; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.CompositeIdentifier; +import org.apache.airavata.registry.cpi.UsrResourceProfile; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.*; + +public class UserResourceProfileRepository extends AppCatAbstractRepositoryimplements UsrResourceProfile { +private final static Logger logger = LoggerFactory.getLogger(UserResourceProfileRepository.class); + +public UserResourceProfileRepository() { +super(UserResourceProfile.class, UserResourceProfileEntity.class); +} + +protected String saveUserResourceProfileData(UserResourceProfile userResourceProfile) throws AppCatalogException { +UserResourceProfileEntity userResourceProfileEntity = saveUserResourceProfile(userResourceProfile); +return userResourceProfileEntity.getUserId(); +} + +protected UserResourceProfileEntity saveUserResourceProfile(UserResourceProfile userResourceProfile) throws AppCatalogException { +String userId = userResourceProfile.getUserId(); +String gatewayId = userResourceProfile.getGatewayID(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +UserResourceProfileEntity userResourceProfileEntity = mapper.map(userResourceProfile, UserResourceProfileEntity.class); + +if (userResourceProfileEntity.getUserComputeResourcePreferences() != null) { +logger.debug("Populating the Primary Key UserComputeResourcePreferences objects for the User Resource Profile"); + userResourceProfileEntity.getUserComputeResourcePreferences().forEach(userComputeResourcePreferenceEntity -> userComputeResourcePreferenceEntity.setUserId(userId)); + userResourceProfileEntity.getUserComputeResourcePreferences().forEach(userComputeResourcePreferenceEntity -> userComputeResourcePreferenceEntity.setGatewayId(gatewayId)); +} + +if (userResourceProfileEntity.getUserStoragePreferences() != null) { +logger.debug("Populating the Primary Key UserStoragePreferences objects for the User Resource Profile"); + userResourceProfileEntity.getUserStoragePreferences().forEach(userStoragePreferenceEntity -> userStoragePreferenceEntity.setUserId(userId)); + userResourceProfileEntity.getUserStoragePreferences().forEach(userStoragePreferenceEntity -> userStoragePreferenceEntity.setGatewayId(gatewayId)); +} + +
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412082#comment-16412082 ] ASF GitHub Bot commented on AIRAVATA-2712: -- machristie commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176863306 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/UserResourceProfileRepository.java ## @@ -0,0 +1,227 @@ +/** + * + * 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.userresourceprofile.UserComputeResourcePreference; +import org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile; +import org.apache.airavata.model.appcatalog.userresourceprofile.UserStoragePreference; +import org.apache.airavata.registry.core.entities.appcatalog.UserComputeResourcePreferencePK; +import org.apache.airavata.registry.core.entities.appcatalog.UserResourceProfileEntity; +import org.apache.airavata.registry.core.entities.appcatalog.UserResourceProfilePK; +import org.apache.airavata.registry.core.entities.appcatalog.UserStoragePreferencePK; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.CompositeIdentifier; +import org.apache.airavata.registry.cpi.UsrResourceProfile; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.*; + +public class UserResourceProfileRepository extends AppCatAbstractRepositoryimplements UsrResourceProfile { +private final static Logger logger = LoggerFactory.getLogger(UserResourceProfileRepository.class); + +public UserResourceProfileRepository() { +super(UserResourceProfile.class, UserResourceProfileEntity.class); +} + +protected String saveUserResourceProfileData(UserResourceProfile userResourceProfile) throws AppCatalogException { +UserResourceProfileEntity userResourceProfileEntity = saveUserResourceProfile(userResourceProfile); +return userResourceProfileEntity.getUserId(); +} + +protected UserResourceProfileEntity saveUserResourceProfile(UserResourceProfile userResourceProfile) throws AppCatalogException { +String userId = userResourceProfile.getUserId(); +String gatewayId = userResourceProfile.getGatewayID(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +UserResourceProfileEntity userResourceProfileEntity = mapper.map(userResourceProfile, UserResourceProfileEntity.class); + +if (userResourceProfileEntity.getUserComputeResourcePreferences() != null) { +logger.debug("Populating the Primary Key UserComputeResourcePreferences objects for the User Resource Profile"); + userResourceProfileEntity.getUserComputeResourcePreferences().forEach(userComputeResourcePreferenceEntity -> userComputeResourcePreferenceEntity.setUserId(userId)); + userResourceProfileEntity.getUserComputeResourcePreferences().forEach(userComputeResourcePreferenceEntity -> userComputeResourcePreferenceEntity.setGatewayId(gatewayId)); +} + +if (userResourceProfileEntity.getUserStoragePreferences() != null) { +logger.debug("Populating the Primary Key UserStoragePreferences objects for the User Resource Profile"); + userResourceProfileEntity.getUserStoragePreferences().forEach(userStoragePreferenceEntity -> userStoragePreferenceEntity.setUserId(userId)); + userResourceProfileEntity.getUserStoragePreferences().forEach(userStoragePreferenceEntity -> userStoragePreferenceEntity.setGatewayId(gatewayId)); +} + +
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412084#comment-16412084 ] ASF GitHub Bot commented on AIRAVATA-2712: -- machristie commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176863015 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/UserResourceProfileRepository.java ## @@ -0,0 +1,227 @@ +/** + * + * 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.userresourceprofile.UserComputeResourcePreference; +import org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile; +import org.apache.airavata.model.appcatalog.userresourceprofile.UserStoragePreference; +import org.apache.airavata.registry.core.entities.appcatalog.UserComputeResourcePreferencePK; +import org.apache.airavata.registry.core.entities.appcatalog.UserResourceProfileEntity; +import org.apache.airavata.registry.core.entities.appcatalog.UserResourceProfilePK; +import org.apache.airavata.registry.core.entities.appcatalog.UserStoragePreferencePK; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.CompositeIdentifier; +import org.apache.airavata.registry.cpi.UsrResourceProfile; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.*; + +public class UserResourceProfileRepository extends AppCatAbstractRepositoryimplements UsrResourceProfile { +private final static Logger logger = LoggerFactory.getLogger(UserResourceProfileRepository.class); + +public UserResourceProfileRepository() { +super(UserResourceProfile.class, UserResourceProfileEntity.class); +} + +protected String saveUserResourceProfileData(UserResourceProfile userResourceProfile) throws AppCatalogException { +UserResourceProfileEntity userResourceProfileEntity = saveUserResourceProfile(userResourceProfile); +return userResourceProfileEntity.getUserId(); +} + +protected UserResourceProfileEntity saveUserResourceProfile(UserResourceProfile userResourceProfile) throws AppCatalogException { +String userId = userResourceProfile.getUserId(); +String gatewayId = userResourceProfile.getGatewayID(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +UserResourceProfileEntity userResourceProfileEntity = mapper.map(userResourceProfile, UserResourceProfileEntity.class); + +if (userResourceProfileEntity.getUserComputeResourcePreferences() != null) { +logger.debug("Populating the Primary Key UserComputeResourcePreferences objects for the User Resource Profile"); + userResourceProfileEntity.getUserComputeResourcePreferences().forEach(userComputeResourcePreferenceEntity -> userComputeResourcePreferenceEntity.setUserId(userId)); + userResourceProfileEntity.getUserComputeResourcePreferences().forEach(userComputeResourcePreferenceEntity -> userComputeResourcePreferenceEntity.setGatewayId(gatewayId)); +} + +if (userResourceProfileEntity.getUserStoragePreferences() != null) { +logger.debug("Populating the Primary Key UserStoragePreferences objects for the User Resource Profile"); + userResourceProfileEntity.getUserStoragePreferences().forEach(userStoragePreferenceEntity -> userStoragePreferenceEntity.setUserId(userId)); + userResourceProfileEntity.getUserStoragePreferences().forEach(userStoragePreferenceEntity -> userStoragePreferenceEntity.setGatewayId(gatewayId)); +} + +
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412085#comment-16412085 ] ASF GitHub Bot commented on AIRAVATA-2712: -- machristie commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176859591 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserComputeResourcePreferenceEntity.java ## @@ -0,0 +1,195 @@ +/* + * + * 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.entities.appcatalog; + +import javax.persistence.*; +import java.sql.Timestamp; + +/** + * The persistent class for the user_compute_resource_preference database table. + */ +@Entity +@Table(name = "USER_COMPUTE_RESOURCE_PREFERENCE") +@IdClass(UserComputeResourcePreferencePK.class) +public class UserComputeResourcePreferenceEntity { +private static final long serialVersionUID = 1L; + +@Id +@Column(name = "RESOURCE_ID") +private String computeResourceId; + +@Id +@Column(name = "USER_ID") +private String userId; + +@Id +@Column(name = "GATEWAY_ID") +private String gatewayId; + +@Column(name = "PREFERED_BATCH_QUEUE") +private String preferredBatchQueue; + +@Column(name = "RESOURCE_CS_TOKEN") +private String resourceSpecificCredentialStoreToken; + +@Column(name = "LOGIN_USERNAME") +private String loginUserName; + +@Column(name = "ALLOCATION_PROJECT_NUMBER") +private String allocationProjectNumber; + +@Column(name = "QUALITY_OF_SERVICE") +private String qualityOfService; + +@Column(name = "RESERVATION") +private String reservation; + +@Column(name = "RESERVATION_START_TIME") +private Timestamp reservationStartTime; + +@Column(name = "RESERVATION_END_TIME") +private Timestamp reservationEndTime; + +@Column(name = "SCRATCH_LOCATION") +private String scratchLocation; + +@Column(name = "VALIDATED") +private boolean validated; + +@ManyToOne(targetEntity = UserResourceProfileEntity.class, cascade = CascadeType.MERGE) +@JoinColumn(name = "USER_ID") Review comment: This should join on USER_ID and GATEWAY_ID 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 - User Resource Profile > -- > > Key: AIRAVATA-2712 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2712 > Project: Airavata > Issue Type: Improvement > Components: Registry API >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412081#comment-16412081 ] ASF GitHub Bot commented on AIRAVATA-2712: -- machristie commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176859914 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserStoragePreferenceEntity.java ## @@ -0,0 +1,118 @@ +/* + * + * 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.entities.appcatalog; + +import javax.persistence.*; + +/** + * The persistent class for the user_storage_preference database table. + */ +@Entity +@Table(name = "USER_STORAGE_PREFERENCE") +@IdClass(UserStoragePreferencePK.class) +public class UserStoragePreferenceEntity { +private static final long serialVersionUID = 1L; + +@Id +@Column(name = "STORAGE_RESOURCE_ID") +private String storageResourceId; + +@Id +@Column(name = "USER_ID") +private String userId; + +@Id +@Column(name = "GATEWAY_ID") +private String gatewayId; + +@Column(name = "RESOURCE_CS_TOKEN") +private String resourceSpecificCredentialStoreToken; + +@Column(name = "FS_ROOT_LOCATION") +private String fileSystemRootLocation; + +@Column(name = "LOGIN_USERNAME") +private String loginUserName; + +@ManyToOne(targetEntity = UserResourceProfileEntity.class, cascade = CascadeType.MERGE) +@JoinColumn(name = "USER_ID") Review comment: This should join on USER_ID and GATEWAY_ID 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 - User Resource Profile > -- > > Key: AIRAVATA-2712 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2712 > Project: Airavata > Issue Type: Improvement > Components: Registry API >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412078#comment-16412078 ] ASF GitHub Bot commented on AIRAVATA-2712: -- machristie commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176859079 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserResourceProfilePK.java ## @@ -0,0 +1,83 @@ +/* + * + * 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.entities.appcatalog; + +import javax.persistence.Column; +import javax.persistence.Id; +import java.io.Serializable; + +/** + * The primary key class for the user_resource_profile database table. + * + */ +public class UserResourceProfilePK implements Serializable { +//default serial version id, required for serializable classes. +private static final long serialVersionUID = 1L; + +@Id Review comment: Same comment as above 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 - User Resource Profile > -- > > Key: AIRAVATA-2712 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2712 > Project: Airavata > Issue Type: Improvement > Components: Registry API >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412080#comment-16412080 ] ASF GitHub Bot commented on AIRAVATA-2712: -- machristie commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176858764 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserComputeResourcePreferencePK.java ## @@ -0,0 +1,98 @@ +/* + * + * 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.entities.appcatalog; + +import javax.persistence.Column; +import javax.persistence.Id; +import java.io.Serializable; + +/** + * The primary key class for the user_compute_resource_preference database table. + * + */ +public class UserComputeResourcePreferencePK implements Serializable { +//default serial version id, required for serializable classes. +private static final long serialVersionUID = 1L; + +@Id Review comment: I don't think you need any JPA annotations on an id class. See [Example 7-4](https://docs.oracle.com/cd/E16439_01/doc.1013/e13981/cmp30cfg001.htm). 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 - User Resource Profile > -- > > Key: AIRAVATA-2712 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2712 > Project: Airavata > Issue Type: Improvement > Components: Registry API >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412076#comment-16412076 ] ASF GitHub Bot commented on AIRAVATA-2712: -- machristie commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176861106 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/UserResourceProfileRepository.java ## @@ -0,0 +1,227 @@ +/** + * + * 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.userresourceprofile.UserComputeResourcePreference; +import org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile; +import org.apache.airavata.model.appcatalog.userresourceprofile.UserStoragePreference; +import org.apache.airavata.registry.core.entities.appcatalog.UserComputeResourcePreferencePK; +import org.apache.airavata.registry.core.entities.appcatalog.UserResourceProfileEntity; +import org.apache.airavata.registry.core.entities.appcatalog.UserResourceProfilePK; +import org.apache.airavata.registry.core.entities.appcatalog.UserStoragePreferencePK; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.CompositeIdentifier; +import org.apache.airavata.registry.cpi.UsrResourceProfile; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.*; + +public class UserResourceProfileRepository extends AppCatAbstractRepositoryimplements UsrResourceProfile { +private final static Logger logger = LoggerFactory.getLogger(UserResourceProfileRepository.class); + +public UserResourceProfileRepository() { +super(UserResourceProfile.class, UserResourceProfileEntity.class); +} + +protected String saveUserResourceProfileData(UserResourceProfile userResourceProfile) throws AppCatalogException { +UserResourceProfileEntity userResourceProfileEntity = saveUserResourceProfile(userResourceProfile); +return userResourceProfileEntity.getUserId(); +} + +protected UserResourceProfileEntity saveUserResourceProfile(UserResourceProfile userResourceProfile) throws AppCatalogException { +String userId = userResourceProfile.getUserId(); +String gatewayId = userResourceProfile.getGatewayID(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +UserResourceProfileEntity userResourceProfileEntity = mapper.map(userResourceProfile, UserResourceProfileEntity.class); + +if (userResourceProfileEntity.getUserComputeResourcePreferences() != null) { +logger.debug("Populating the Primary Key UserComputeResourcePreferences objects for the User Resource Profile"); + userResourceProfileEntity.getUserComputeResourcePreferences().forEach(userComputeResourcePreferenceEntity -> userComputeResourcePreferenceEntity.setUserId(userId)); Review comment: No need to forEach twice, you can set both properties. Same on line 68. 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 - User Resource Profile > -- > > Key: AIRAVATA-2712 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2712 > Project: Airavata > Issue Type: Improvement >
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412087#comment-16412087 ] ASF GitHub Bot commented on AIRAVATA-2712: -- machristie commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176860039 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserStoragePreferencePK.java ## @@ -0,0 +1,98 @@ +/* + * + * 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.entities.appcatalog; + +import javax.persistence.Column; +import javax.persistence.Id; +import java.io.Serializable; + +/** + * The primary key class for the user_storage_preference database table. + * + */ +public class UserStoragePreferencePK implements Serializable { +//default serial version id, required for serializable classes. +private static final long serialVersionUID = 1L; + +@Id Review comment: Same comment as above. 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 - User Resource Profile > -- > > Key: AIRAVATA-2712 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2712 > Project: Airavata > Issue Type: Improvement > Components: Registry API >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412086#comment-16412086 ] ASF GitHub Bot commented on AIRAVATA-2712: -- machristie commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176863606 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java ## @@ -37,4 +37,26 @@ "WHERE BQ.groupResourceProfileId LIKE : " + DBConstants.GroupResourceProfile.GROUP_RESOURCE_PROFILE_ID; String FIND_ALL_GROUP_COMPUTE_RESOURCE_POLICY = "SELECT CR FROM "+ ComputeResourcePolicyEntity.class.getSimpleName() + " CR " + "WHERE CR.groupResourceProfileId LIKE : " + DBConstants.GroupResourceProfile.GROUP_RESOURCE_PROFILE_ID; + +String GET_USER_RESOURCE_PROFILE = "SELECT DISTINCT URP FROM " + UserResourceProfileEntity.class.getSimpleName() + " URP " + Review comment: GET_USER_RESOURCE_PROFILE, GET_USER_COMPUTE_RESOURCE_PREFERENCE and GET_USER_STORAGE_PREFERENCE I don't think are needed if using the `get()` repository method as mentioned above. 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 - User Resource Profile > -- > > Key: AIRAVATA-2712 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2712 > Project: Airavata > Issue Type: Improvement > Components: Registry API >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412079#comment-16412079 ] ASF GitHub Bot commented on AIRAVATA-2712: -- machristie commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176863684 ## File path: modules/registry-refactoring/src/main/resources/META-INF/persistence.xml ## @@ -122,6 +122,9 @@ org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK Review comment: We can remove these Id classes, right? 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 - User Resource Profile > -- > > Key: AIRAVATA-2712 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2712 > Project: Airavata > Issue Type: Improvement > Components: Registry API >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2712) Refactoring App Catalog Implementation - User Resource Profile
[ https://issues.apache.org/jira/browse/AIRAVATA-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412083#comment-16412083 ] ASF GitHub Bot commented on AIRAVATA-2712: -- machristie commented on a change in pull request #185: [AIRAVATA-2712] Refactoring App Catalog Implementation - UserResourceProfile URL: https://github.com/apache/airavata/pull/185#discussion_r176863089 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/UserResourceProfileRepository.java ## @@ -0,0 +1,227 @@ +/** + * + * 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.userresourceprofile.UserComputeResourcePreference; +import org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile; +import org.apache.airavata.model.appcatalog.userresourceprofile.UserStoragePreference; +import org.apache.airavata.registry.core.entities.appcatalog.UserComputeResourcePreferencePK; +import org.apache.airavata.registry.core.entities.appcatalog.UserResourceProfileEntity; +import org.apache.airavata.registry.core.entities.appcatalog.UserResourceProfilePK; +import org.apache.airavata.registry.core.entities.appcatalog.UserStoragePreferencePK; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.CompositeIdentifier; +import org.apache.airavata.registry.cpi.UsrResourceProfile; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.*; + +public class UserResourceProfileRepository extends AppCatAbstractRepositoryimplements UsrResourceProfile { +private final static Logger logger = LoggerFactory.getLogger(UserResourceProfileRepository.class); + +public UserResourceProfileRepository() { +super(UserResourceProfile.class, UserResourceProfileEntity.class); +} + +protected String saveUserResourceProfileData(UserResourceProfile userResourceProfile) throws AppCatalogException { +UserResourceProfileEntity userResourceProfileEntity = saveUserResourceProfile(userResourceProfile); +return userResourceProfileEntity.getUserId(); +} + +protected UserResourceProfileEntity saveUserResourceProfile(UserResourceProfile userResourceProfile) throws AppCatalogException { +String userId = userResourceProfile.getUserId(); +String gatewayId = userResourceProfile.getGatewayID(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +UserResourceProfileEntity userResourceProfileEntity = mapper.map(userResourceProfile, UserResourceProfileEntity.class); + +if (userResourceProfileEntity.getUserComputeResourcePreferences() != null) { +logger.debug("Populating the Primary Key UserComputeResourcePreferences objects for the User Resource Profile"); + userResourceProfileEntity.getUserComputeResourcePreferences().forEach(userComputeResourcePreferenceEntity -> userComputeResourcePreferenceEntity.setUserId(userId)); + userResourceProfileEntity.getUserComputeResourcePreferences().forEach(userComputeResourcePreferenceEntity -> userComputeResourcePreferenceEntity.setGatewayId(gatewayId)); +} + +if (userResourceProfileEntity.getUserStoragePreferences() != null) { +logger.debug("Populating the Primary Key UserStoragePreferences objects for the User Resource Profile"); + userResourceProfileEntity.getUserStoragePreferences().forEach(userStoragePreferenceEntity -> userStoragePreferenceEntity.setUserId(userId)); + userResourceProfileEntity.getUserStoragePreferences().forEach(userStoragePreferenceEntity -> userStoragePreferenceEntity.setGatewayId(gatewayId)); +} + +
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412044#comment-16412044 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on issue #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#issuecomment-375794359 @DImuthuUpe @machristie Thank you for the review. I've made the requested 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411995#comment-16411995 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on issue #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#issuecomment-375786828 @DImuthuUpe I can't find any documentation about it. The description here is pretty succinct: https://issues.apache.org/jira/browse/AIRAVATA-2618. Let me know if you have any questions. 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411984#comment-16411984 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176851411 ## File path: modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java ## @@ -3589,8 +3586,7 @@ public String registerApplicationDeployment(String gatewayId, ApplicationDeploym @Override public boolean updateApplicationModule(String appModuleId, ApplicationModule applicationModule) throws RegistryServiceException, TException { try { -appCatalog = RegistryFactory.getAppCatalog(); - appCatalog.getApplicationInterface().updateApplicationModule(appModuleId, applicationModule); +new ApplicationInterfaceRepository().updateApplicationModule(appModuleId, applicationModule); Review comment: My understanding is that we can reuse them since they are stateless and hence threadsafe. +1 for just instantiating these once in RegistryServerHandler and reusing them. 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411786#comment-16411786 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176816330 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,159 @@ +/** + * + * 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.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) Review comment: Just print the message mentioning why that block is executing 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411722#comment-16411722 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176800876 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,159 @@ +/** + * + * 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.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) Review comment: Sure @DImuthuUpe Do you want me to just add a message or include the object as well? 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411632#comment-16411632 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on issue #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#issuecomment-375716872 @tilaks26 Code looks good. There are few areas that need improvements Add more debug or info level logs in the complex if conditions. This will benefit when we are doing debugging. Improve the readability of the code. One option is to add new lines logically when there are too much lines together. Do null checks and the availability to the items in the lists before accessing them. Handle them properly and always try to avoid NullPointerExceptions. @machristie @sachinkariyattin @tilaks26 I do not have a in depth idea of what is going inside the registry refactoring. Do we have any resource that we can refer in order to have an idea of the proposed 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411616#comment-16411616 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176782440 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -0,0 +1,256 @@ +/** + * + * 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.appdeployment.ApplicationModule; +import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription; +import org.apache.airavata.model.appcatalog.appinterface.application_interface_modelConstants; +import org.apache.airavata.model.application.io.InputDataObjectType; +import org.apache.airavata.model.application.io.OutputDataObjectType; +import org.apache.airavata.registry.core.utils.*; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationInterface; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationInterfaceRepository extends AppCatAbstractRepositoryimplements ApplicationInterface { +private final static Logger logger = LoggerFactory.getLogger(ApplicationInterfaceRepository.class); + +public ApplicationInterfaceRepository () { +super(ApplicationInterfaceDescription.class, ApplicationInterfaceEntity.class); +} + +protected String saveApplicationInterfaceDescriptorData( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +ApplicationInterfaceEntity applicationInterfaceEntity = saveApplicationInterface(applicationInterfaceDescription, gatewayId); +return applicationInterfaceEntity.getApplicationInterfaceId(); +} + +protected ApplicationInterfaceEntity saveApplicationInterface( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +String applicationInterfaceId = applicationInterfaceDescription.getApplicationInterfaceId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationInterfaceEntity applicationInterfaceEntity = mapper.map(applicationInterfaceDescription, ApplicationInterfaceEntity.class); +if (gatewayId != null) +applicationInterfaceEntity.setGatewayId(gatewayId); +if (applicationInterfaceEntity.getApplicationInputs() != null) { + applicationInterfaceEntity.getApplicationInputs().forEach(applicationInputEntity -> applicationInputEntity.setInterfaceId(applicationInterfaceId)); +} +if (applicationInterfaceEntity.getApplicationOutputs() != null) { + applicationInterfaceEntity.getApplicationOutputs().forEach(applicationOutputEntity -> applicationOutputEntity.setInterfaceId(applicationInterfaceId)); +} +if (!isApplicationInterfaceExists(applicationInterfaceId)) +applicationInterfaceEntity.setCreationTime(new Timestamp(System.currentTimeMillis())); +applicationInterfaceEntity.setUpdateTime(new Timestamp(System.currentTimeMillis())); +return execute(entityManager -> entityManager.merge(applicationInterfaceEntity)); +} + +protected String saveApplicationModuleData( +ApplicationModule applicationModule, String gatewayId) throws AppCatalogException { +ApplicationModuleEntity applicationModuleEntity =
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411612#comment-16411612 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176781978 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -0,0 +1,256 @@ +/** + * + * 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.appdeployment.ApplicationModule; +import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription; +import org.apache.airavata.model.appcatalog.appinterface.application_interface_modelConstants; +import org.apache.airavata.model.application.io.InputDataObjectType; +import org.apache.airavata.model.application.io.OutputDataObjectType; +import org.apache.airavata.registry.core.utils.*; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationInterface; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationInterfaceRepository extends AppCatAbstractRepositoryimplements ApplicationInterface { +private final static Logger logger = LoggerFactory.getLogger(ApplicationInterfaceRepository.class); + +public ApplicationInterfaceRepository () { +super(ApplicationInterfaceDescription.class, ApplicationInterfaceEntity.class); +} + +protected String saveApplicationInterfaceDescriptorData( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +ApplicationInterfaceEntity applicationInterfaceEntity = saveApplicationInterface(applicationInterfaceDescription, gatewayId); +return applicationInterfaceEntity.getApplicationInterfaceId(); +} + +protected ApplicationInterfaceEntity saveApplicationInterface( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +String applicationInterfaceId = applicationInterfaceDescription.getApplicationInterfaceId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationInterfaceEntity applicationInterfaceEntity = mapper.map(applicationInterfaceDescription, ApplicationInterfaceEntity.class); +if (gatewayId != null) +applicationInterfaceEntity.setGatewayId(gatewayId); +if (applicationInterfaceEntity.getApplicationInputs() != null) { + applicationInterfaceEntity.getApplicationInputs().forEach(applicationInputEntity -> applicationInputEntity.setInterfaceId(applicationInterfaceId)); +} +if (applicationInterfaceEntity.getApplicationOutputs() != null) { + applicationInterfaceEntity.getApplicationOutputs().forEach(applicationOutputEntity -> applicationOutputEntity.setInterfaceId(applicationInterfaceId)); +} +if (!isApplicationInterfaceExists(applicationInterfaceId)) +applicationInterfaceEntity.setCreationTime(new Timestamp(System.currentTimeMillis())); +applicationInterfaceEntity.setUpdateTime(new Timestamp(System.currentTimeMillis())); +return execute(entityManager -> entityManager.merge(applicationInterfaceEntity)); +} + +protected String saveApplicationModuleData( +ApplicationModule applicationModule, String gatewayId) throws AppCatalogException { +ApplicationModuleEntity applicationModuleEntity =
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411610#comment-16411610 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176781653 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -0,0 +1,256 @@ +/** + * + * 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.appdeployment.ApplicationModule; +import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription; +import org.apache.airavata.model.appcatalog.appinterface.application_interface_modelConstants; +import org.apache.airavata.model.application.io.InputDataObjectType; +import org.apache.airavata.model.application.io.OutputDataObjectType; +import org.apache.airavata.registry.core.utils.*; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationInterface; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationInterfaceRepository extends AppCatAbstractRepositoryimplements ApplicationInterface { +private final static Logger logger = LoggerFactory.getLogger(ApplicationInterfaceRepository.class); + +public ApplicationInterfaceRepository () { +super(ApplicationInterfaceDescription.class, ApplicationInterfaceEntity.class); +} + +protected String saveApplicationInterfaceDescriptorData( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +ApplicationInterfaceEntity applicationInterfaceEntity = saveApplicationInterface(applicationInterfaceDescription, gatewayId); +return applicationInterfaceEntity.getApplicationInterfaceId(); +} + +protected ApplicationInterfaceEntity saveApplicationInterface( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +String applicationInterfaceId = applicationInterfaceDescription.getApplicationInterfaceId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationInterfaceEntity applicationInterfaceEntity = mapper.map(applicationInterfaceDescription, ApplicationInterfaceEntity.class); +if (gatewayId != null) Review comment: Debug logs 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2717) [GSoC] Resurrect User-Defined Airavata Workflows
[ https://issues.apache.org/jira/browse/AIRAVATA-2717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411604#comment-16411604 ] Dimuthu Upeksha commented on AIRAVATA-2717: --- [~marcuschristie] Yeah I guess that's what we want. Sorry for my misrepresentation. Let's use a higher level workflow to connect applications rather than composing everything in a single workflow. > [GSoC] Resurrect User-Defined Airavata Workflows > - > > Key: AIRAVATA-2717 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2717 > Project: Airavata > Issue Type: Epic >Affects Versions: 0.17 >Reporter: Suresh Marru >Priority: Major > Labels: gsoc2018 > > Airavata used to support user-defined workflows using an interface XBaya to > drag and drop application components to a workspace and define data flow and > control flow dependencies among the application nodes. Airavata's workflow > system was used for composing, executing, and monitoring workflow graphs > primarly web service components. The workflow description was high level > abstraction and used to be converted to lower level execution run times like > BPEL, SCUFL and Python scripts. > > Airavata has evolved significantly and the current development version is > being built-over Apache Helix for DAG orchestration. This provides an > opportunity to resurrect workflow capabilities in Airavata. > This GSoC project involves finalizing a Airavata Workflow Language; modify > the orchestrator to parse user described workflow and translate to equivalent > Helix DAG's; execute and monitor the worklfows; develop a simple UI to > demonstrate the capabilities. > To describe the workflows, you can build on this - > [https://docs.google.com/document/d/1eh7BV8CHupxyM2jeqcM2tUG5MnXFt7hNDX4PQDfxCcM/edit] > or follow other discussions like - > https://issues.apache.org/jira/browse/AIRAVATA-2555 and > User community & Impact of the software: Airavata is primarily targeted to > build science gateways using computational resources from various > disciplines. The initial targeted set of gateways include projects supporting > research and education in chemistry, biophysics, and geosciences . The goal > of airavata is to enhance productivity of these gateways to utilize > cyberinfrastructure of resources (e.g., local lab resources, the Extreme > Science and Engineering Discovery Environment (XSEDE), University Clusters, > Academic and Commercial Computational Clouds. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (AIRAVATA-2721) Thirft Models,CPI's and OpenJPA for community requests
Harsha Phulwani created AIRAVATA-2721: - Summary: Thirft Models,CPI's and OpenJPA for community requests Key: AIRAVATA-2721 URL: https://issues.apache.org/jira/browse/AIRAVATA-2721 Project: Airavata Issue Type: Sub-task Components: Airavata Allocation Manager Reporter: Harsha Phulwani Backend changes in the following components - OpenJPA(Entities, Repositories), Thrift Model and CPI methods, ServerHandler(For implementing all the methods) -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (AIRAVATA-2720) Resource Allocation - Community Requests
Harsha Phulwani created AIRAVATA-2720: - Summary: Resource Allocation - Community Requests Key: AIRAVATA-2720 URL: https://issues.apache.org/jira/browse/AIRAVATA-2720 Project: Airavata Issue Type: Task Components: Airavata Allocation Manager Reporter: Harsha Phulwani A pipeline for PI's to create community requests using the Django-portal. This includes three dashboard users - PI view, Reviewer view and Admin view -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2717) [GSoC] Resurrect User-Defined Airavata Workflows
[ https://issues.apache.org/jira/browse/AIRAVATA-2717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411558#comment-16411558 ] Marcus Christie commented on AIRAVATA-2717: --- [~dimuthuupe], do we need two levels of workflows? The static workflow that the orchestrator defines is for running an Application. Do we want a higher level workflow for chaining together multiple Applications? I guess a higher level workflow dealing with Applications would be more user friendly. > [GSoC] Resurrect User-Defined Airavata Workflows > - > > Key: AIRAVATA-2717 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2717 > Project: Airavata > Issue Type: Epic >Affects Versions: 0.17 >Reporter: Suresh Marru >Priority: Major > Labels: gsoc2018 > > Airavata used to support user-defined workflows using an interface XBaya to > drag and drop application components to a workspace and define data flow and > control flow dependencies among the application nodes. Airavata's workflow > system was used for composing, executing, and monitoring workflow graphs > primarly web service components. The workflow description was high level > abstraction and used to be converted to lower level execution run times like > BPEL, SCUFL and Python scripts. > > Airavata has evolved significantly and the current development version is > being built-over Apache Helix for DAG orchestration. This provides an > opportunity to resurrect workflow capabilities in Airavata. > This GSoC project involves finalizing a Airavata Workflow Language; modify > the orchestrator to parse user described workflow and translate to equivalent > Helix DAG's; execute and monitor the worklfows; develop a simple UI to > demonstrate the capabilities. > To describe the workflows, you can build on this - > [https://docs.google.com/document/d/1eh7BV8CHupxyM2jeqcM2tUG5MnXFt7hNDX4PQDfxCcM/edit] > or follow other discussions like - > https://issues.apache.org/jira/browse/AIRAVATA-2555 and > User community & Impact of the software: Airavata is primarily targeted to > build science gateways using computational resources from various > disciplines. The initial targeted set of gateways include projects supporting > research and education in chemistry, biophysics, and geosciences . The goal > of airavata is to enhance productivity of these gateways to utilize > cyberinfrastructure of resources (e.g., local lab resources, the Extreme > Science and Engineering Discovery Environment (XSEDE), University Clusters, > Academic and Commercial Computational Clouds. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411504#comment-16411504 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176758465 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,159 @@ +/** + * + * 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.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) +applicationDeploymentEntity.setGatewayId(gatewayId); +if (applicationDeploymentEntity.getModuleLoadCmds() != null) { + applicationDeploymentEntity.getModuleLoadCmds().forEach(moduleLoadCmdEntity -> moduleLoadCmdEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getPreJobCommands() != null) { + applicationDeploymentEntity.getPreJobCommands().forEach(prejobCommandEntity -> prejobCommandEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getPostJobCommands() != null) { + applicationDeploymentEntity.getPostJobCommands().forEach(postjobCommandEntity -> postjobCommandEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getLibPrependPaths() != null) { + applicationDeploymentEntity.getLibPrependPaths().forEach(libraryPrependPathEntity -> libraryPrependPathEntity.setDeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getLibAppendPaths() != null) { + applicationDeploymentEntity.getLibAppendPaths().forEach(libraryApendPathEntity -> libraryApendPathEntity.setDeploymentId(applicationDeploymentId)); +} +if
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411500#comment-16411500 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176758088 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,159 @@ +/** + * + * 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.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) +applicationDeploymentEntity.setGatewayId(gatewayId); +if (applicationDeploymentEntity.getModuleLoadCmds() != null) { + applicationDeploymentEntity.getModuleLoadCmds().forEach(moduleLoadCmdEntity -> moduleLoadCmdEntity.setAppdeploymentId(applicationDeploymentId)); +} Review comment: Add a new line after each if block. It will improve the readability 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411496#comment-16411496 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176757385 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,159 @@ +/** + * + * 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.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) Review comment: Add debug logs in each if block. Then we can easily track issues without remote debugging 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411489#comment-16411489 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176755943 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -122,15 +130,15 @@ public ApplicationModule getApplicationModule(String moduleId) throws AppCatalog ApplicationModuleRepository applicationModuleRepository = new ApplicationModuleRepository(); MapqueryParameters = new HashMap<>(); queryParameters.put(DBConstants.ApplicationModule.APPLICATION_MODULE_ID, moduleId); -ApplicationModule applicationModule = (ApplicationModule) applicationModuleRepository.select(QueryConstants.FIND_APPLICATION_MODULE, -1, 0, queryParameters); +ApplicationModule applicationModule = applicationModuleRepository.select(QueryConstants.FIND_APPLICATION_MODULE, -1, 0, queryParameters).get(0); return applicationModule; } @Override public ApplicationInterfaceDescription getApplicationInterface(String interfaceId) throws AppCatalogException { Map queryParameters = new HashMap<>(); queryParameters.put(DBConstants.ApplicationInterface.APPLICATION_INTERFACE_ID, interfaceId); -ApplicationInterfaceDescription applicationInterfaceDescription = (ApplicationInterfaceDescription) select(QueryConstants.FIND_APPLICATION_INTERFACE, -1, 0, queryParameters); +ApplicationInterfaceDescription applicationInterfaceDescription = select(QueryConstants.FIND_APPLICATION_INTERFACE, -1, 0, queryParameters).get(0); Review comment: Same here get(0) 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411488#comment-16411488 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176755873 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -122,15 +130,15 @@ public ApplicationModule getApplicationModule(String moduleId) throws AppCatalog ApplicationModuleRepository applicationModuleRepository = new ApplicationModuleRepository(); MapqueryParameters = new HashMap<>(); queryParameters.put(DBConstants.ApplicationModule.APPLICATION_MODULE_ID, moduleId); -ApplicationModule applicationModule = (ApplicationModule) applicationModuleRepository.select(QueryConstants.FIND_APPLICATION_MODULE, -1, 0, queryParameters); +ApplicationModule applicationModule = applicationModuleRepository.select(QueryConstants.FIND_APPLICATION_MODULE, -1, 0, queryParameters).get(0); Review comment: Is it guaranteed this to return at least one value? Otherwise it is risky to directly call get(0) 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411480#comment-16411480 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176755232 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -67,17 +71,21 @@ protected ApplicationInterfaceEntity saveApplicationInterface( protected String saveApplicationModuleData( ApplicationModule applicationModule) throws AppCatalogException { ApplicationModuleEntity applicationModuleEntity = saveApplicationModule(applicationModule); -return applicationModuleEntity.getModuleId(); +return applicationModuleEntity.getAppModuleId(); } protected ApplicationModuleEntity saveApplicationModule( ApplicationModule applicationModule) throws AppCatalogException { +String applicationModuleId = applicationModule.getAppModuleId(); Mapper mapper = ObjectMapperSingleton.getInstance(); ApplicationModuleEntity applicationModuleEntity = mapper.map(applicationModule, ApplicationModuleEntity.class); -if (!applicationModuleEntity.getModuleId().equals("") && !applicationModule.getAppModuleId().equals(application_interface_modelConstants.DEFAULT_ID)) { - applicationModuleEntity.setModuleId(applicationModule.getAppModuleId()); +if (!isApplicationModuleExists(applicationModuleId)) Review comment: Same here {} 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411483#comment-16411483 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176755369 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -67,17 +71,21 @@ protected ApplicationInterfaceEntity saveApplicationInterface( protected String saveApplicationModuleData( ApplicationModule applicationModule) throws AppCatalogException { ApplicationModuleEntity applicationModuleEntity = saveApplicationModule(applicationModule); -return applicationModuleEntity.getModuleId(); +return applicationModuleEntity.getAppModuleId(); } protected ApplicationModuleEntity saveApplicationModule( ApplicationModule applicationModule) throws AppCatalogException { +String applicationModuleId = applicationModule.getAppModuleId(); Mapper mapper = ObjectMapperSingleton.getInstance(); ApplicationModuleEntity applicationModuleEntity = mapper.map(applicationModule, ApplicationModuleEntity.class); -if (!applicationModuleEntity.getModuleId().equals("") && !applicationModule.getAppModuleId().equals(application_interface_modelConstants.DEFAULT_ID)) { - applicationModuleEntity.setModuleId(applicationModule.getAppModuleId()); +if (!isApplicationModuleExists(applicationModuleId)) +applicationModuleEntity.setCreationTime(new Timestamp(System.currentTimeMillis())); +applicationModuleEntity.setUpdateTime(new Timestamp(System.currentTimeMillis())); +if (!applicationModuleEntity.getAppModuleId().equals("") && !applicationModule.getAppModuleId().equals(application_interface_modelConstants.DEFAULT_ID)) { Review comment: Add debug logs in if else block 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411479#comment-16411479 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176755093 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -55,6 +56,9 @@ protected ApplicationInterfaceEntity saveApplicationInterface( String applicationInterfaceId = applicationInterfaceDescription.getApplicationInterfaceId(); Mapper mapper = ObjectMapperSingleton.getInstance(); ApplicationInterfaceEntity applicationInterfaceEntity = mapper.map(applicationInterfaceDescription, ApplicationInterfaceEntity.class); +if (!isApplicationInterfaceExists(applicationInterfaceId)) Review comment: It is good to have curly braces {} even though you have one line if statement. That improves the readability of the code 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411477#comment-16411477 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176754498 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -43,16 +44,24 @@ public ApplicationDeploymentRepository() { } protected String saveApplicationDeploymentDescriptorData( -ApplicationDeploymentDescription applicationDeploymentDescription) throws AppCatalogException { -ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription); -return applicationDeploymentEntity.getDeploymentId(); +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); } protected ApplicationDeploymentEntity saveApplicationDeployment( -ApplicationDeploymentDescription applicationDeploymentDescription) throws AppCatalogException { +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); Mapper mapper = ObjectMapperSingleton.getInstance(); ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) Review comment: This logic is bit complex. Better if you can add debug logs in each if block. 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411474#comment-16411474 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176753900 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,160 @@ +/** + * + * 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.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) +applicationDeploymentEntity.setGatewayId(gatewayId); +if (applicationDeploymentEntity.getModuleLoadCmds() != null) { + applicationDeploymentEntity.getModuleLoadCmds().forEach(moduleLoadCmdEntity -> moduleLoadCmdEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getPreJobCommands() != null) { + applicationDeploymentEntity.getPreJobCommands().forEach(prejobCommandEntity -> prejobCommandEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getPostJobCommands() != null) { + applicationDeploymentEntity.getPostJobCommands().forEach(postjobCommandEntity -> postjobCommandEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getLibPrependPaths() != null) { + applicationDeploymentEntity.getLibPrependPaths().forEach(libraryPrependPathEntity -> libraryPrependPathEntity.setDeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getLibAppendPaths() != null) { + applicationDeploymentEntity.getLibAppendPaths().forEach(libraryApendPathEntity -> libraryApendPathEntity.setDeploymentId(applicationDeploymentId)); +} +if
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411462#comment-16411462 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176752715 ## File path: modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java ## @@ -3589,8 +3586,7 @@ public String registerApplicationDeployment(String gatewayId, ApplicationDeploym @Override public boolean updateApplicationModule(String appModuleId, ApplicationModule applicationModule) throws RegistryServiceException, TException { try { -appCatalog = RegistryFactory.getAppCatalog(); - appCatalog.getApplicationInterface().updateApplicationModule(appModuleId, applicationModule); +new ApplicationInterfaceRepository().updateApplicationModule(appModuleId, applicationModule); Review comment: @machristie @tilaks26, Just for my knowledge, is this the new way to do database operations? Is it required to create a new object of ApplicationInterfaceRepository for each call? Can't we re use them? 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411451#comment-16411451 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176748684 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepositoryTest.java ## @@ -161,23 +161,29 @@ public void ApplicationDeploymentRepositoryTest() throws AppCatalogException { applicationDeploymentRepository.updateApplicationDeployment(appDeploymentId , applicationDeploymentDescription); assertTrue(applicationDeploymentRepository.getApplicationDeployement(appDeploymentId).getDefaultQueueName().equals("queue3")); - applicationDeploymentRepository.addApplicationDeployment(applicationDeploymentDescription1, gatewayId); +String deploymentId1 = applicationDeploymentRepository.addApplicationDeployment(applicationDeploymentDescription1, gatewayId); List appDeploymentList = applicationDeploymentRepository.getAllApplicationDeployements(gatewayId); List appDeploymentIds = applicationDeploymentRepository.getAllApplicationDeployementIds(); assertTrue(appDeploymentList.size() == 2); assertTrue(appDeploymentIds.size() == 2); - applicationDeploymentRepository.removeAppDeployment(applicationDeploymentDescription1.getAppDeploymentId()); - assertFalse(applicationDeploymentRepository.isExists(applicationDeploymentDescription1.getAppDeploymentId())); - Mapfilters = new HashMap<>(); filters.put(DBConstants.ApplicationDeployment.APPLICATION_MODULE_ID, applicationModule.getAppModuleId()); filters.put(DBConstants.ApplicationDeployment.COMPUTE_HOST_ID, computeResourceDescription.getComputeResourceId()); appDeploymentList = applicationDeploymentRepository.getApplicationDeployements(filters); assertEquals(computeResourceDescription.getComputeResourceId(), appDeploymentList.get(0).getComputeHostId()); Review comment: Is it safe to call appDeploymentList.get(0) ? You might have to check the size of the appDeploymentList first and a potential null check of appDeploymentList 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411450#comment-16411450 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176747997 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepositoryTest.java ## @@ -161,23 +161,29 @@ public void ApplicationDeploymentRepositoryTest() throws AppCatalogException { applicationDeploymentRepository.updateApplicationDeployment(appDeploymentId , applicationDeploymentDescription); assertTrue(applicationDeploymentRepository.getApplicationDeployement(appDeploymentId).getDefaultQueueName().equals("queue3")); - applicationDeploymentRepository.addApplicationDeployment(applicationDeploymentDescription1, gatewayId); +String deploymentId1 = applicationDeploymentRepository.addApplicationDeployment(applicationDeploymentDescription1, gatewayId); Review comment: Shall we rename deploymentId1 into a more user friendly one? 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 - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2717) [GSoC] Resurrect User-Defined Airavata Workflows
[ https://issues.apache.org/jira/browse/AIRAVATA-2717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411320#comment-16411320 ] Yasas Gunarathne commented on AIRAVATA-2717: Hi Dimuthu, Thank you for the detailed answer. I created a new thread at dev mailing list to discuss about Airavata Workflow Language. Regards > [GSoC] Resurrect User-Defined Airavata Workflows > - > > Key: AIRAVATA-2717 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2717 > Project: Airavata > Issue Type: Epic >Affects Versions: 0.17 >Reporter: Suresh Marru >Priority: Major > Labels: gsoc2018 > > Airavata used to support user-defined workflows using an interface XBaya to > drag and drop application components to a workspace and define data flow and > control flow dependencies among the application nodes. Airavata's workflow > system was used for composing, executing, and monitoring workflow graphs > primarly web service components. The workflow description was high level > abstraction and used to be converted to lower level execution run times like > BPEL, SCUFL and Python scripts. > > Airavata has evolved significantly and the current development version is > being built-over Apache Helix for DAG orchestration. This provides an > opportunity to resurrect workflow capabilities in Airavata. > This GSoC project involves finalizing a Airavata Workflow Language; modify > the orchestrator to parse user described workflow and translate to equivalent > Helix DAG's; execute and monitor the worklfows; develop a simple UI to > demonstrate the capabilities. > To describe the workflows, you can build on this - > [https://docs.google.com/document/d/1eh7BV8CHupxyM2jeqcM2tUG5MnXFt7hNDX4PQDfxCcM/edit] > or follow other discussions like - > https://issues.apache.org/jira/browse/AIRAVATA-2555 and > User community & Impact of the software: Airavata is primarily targeted to > build science gateways using computational resources from various > disciplines. The initial targeted set of gateways include projects supporting > research and education in chemistry, biophysics, and geosciences . The goal > of airavata is to enhance productivity of these gateways to utilize > cyberinfrastructure of resources (e.g., local lab resources, the Extreme > Science and Engineering Discovery Environment (XSEDE), University Clusters, > Academic and Commercial Computational Clouds. -- This message was sent by Atlassian JIRA (v7.6.3#76005)