You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2018/12/30 03:03:33 UTC
[airavata] 01/02: Merge branch 'master' into staging
This is an automated email from the ASF dual-hosted git repository.
dimuthuupe pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airavata.git
commit 89ae6eef1fcb927534aab61016b4e87e1df22a48
Merge: a6ef239 241e5a3
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Fri Dec 28 15:00:17 2018 -0500
Merge branch 'master' into staging
# Conflicts:
# airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
# airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
# airavata-services/profile-service/profile-service-stubs/src/main/java/org/apache/airavata/service/profile/iam/admin/services/cpi/IamAdminServices.java
# modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
# modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/RemoteCluster.java
# modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/BESRemoteCluster.java
# modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
# modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/LocalRemoteCluster.java
# modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/SSHUtils.java
# modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
# modules/gfac/gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
# modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
.../api/server/handler/AiravataServerHandler.java | 30 +
.../java/org/apache/airavata/api/Airavata.java | 77016 +++++++++++--------
.../main/resources/lib/Airavata/API/Airavata.php | 10997 +--
.../Model/AppCatalog/AccountProvisioning/Types.php | 345 +
.../Iam/Admin/Services/CPI/IamAdminServices.php | 294 +
.../core/impl/TenantManagementKeycloakImpl.java | 19 +
.../core/interfaces/TenantManagementInterface.java | 10 +
.../profile/handlers/IamAdminServicesHandler.java | 14 +
.../iam/admin/services/cpi/IamAdminServices.java | 4589 +-
.../scigap/dreg-production/group_vars/pga/vars.yml | 4 +-
.../group_vars/pga/vars.yml | 37 +-
.../nexttdb-production/group_vars/pga/vault.yml | 18 +
.../inventories/scigap/nexttdb-production/hosts | 21 +
.../pga_config/{csbglsu => ampgateway}/vars.yml | 23 +-
.../production/pga_config/ampgateway/vault.yml | 18 +
.../scigap/production/pga_config/csbglsu/vars.yml | 17 +-
.../pga_config/{csbglsu => ddstudio}/vars.yml | 30 +-
.../production/pga_config/ddstudio/vault.yml | 17 +
.../pga_config/{searchingSRA => demo1}/vars.yml | 14 +-
.../scigap/production/pga_config/demo1/vault.yml | 17 +
.../pga_config/{searchingSRA => demo10}/vars.yml | 14 +-
.../scigap/production/pga_config/demo10/vault.yml | 17 +
.../pga_config/{searchingSRA => demo2}/vars.yml | 14 +-
.../scigap/production/pga_config/demo2/vault.yml | 17 +
.../pga_config/{searchingSRA => demo3}/vars.yml | 14 +-
.../scigap/production/pga_config/demo3/vault.yml | 17 +
.../pga_config/{searchingSRA => demo4}/vars.yml | 14 +-
.../scigap/production/pga_config/demo4/vault.yml | 17 +
.../pga_config/{searchingSRA => demo5}/vars.yml | 14 +-
.../scigap/production/pga_config/demo5/vault.yml | 17 +
.../pga_config/{searchingSRA => demo6}/vars.yml | 14 +-
.../scigap/production/pga_config/demo6/vault.yml | 17 +
.../pga_config/{searchingSRA => demo7}/vars.yml | 14 +-
.../scigap/production/pga_config/demo7/vault.yml | 17 +
.../pga_config/{searchingSRA => demo8}/vars.yml | 14 +-
.../scigap/production/pga_config/demo8/vault.yml | 17 +
.../pga_config/{searchingSRA => demo9}/vars.yml | 14 +-
.../scigap/production/pga_config/demo9/vault.yml | 17 +
.../{searchingSRA => epwgateway}/vars.yml | 23 +-
.../production/pga_config/epwgateway/vault.yml | 18 +
.../production/pga_config/georgiastate/vars.yml | 6 +-
.../pga_config/{iugateway => hubzero}/vars.yml | 31 +-
.../scigap/production/pga_config/hubzero/vault.yml | 18 +
.../pga_config/{csbglsu => interactwel}/vars.yml | 25 +-
.../production/pga_config/interactwel/vault.yml | 18 +
.../production/pga_config/iugateway/vars.yml | 4 +-
.../production/pga_config/iugeosurvey/vars.yml | 17 +-
.../production/pga_config/newUltrascan/vars.yml | 73 -
.../production/pga_config/newUltrascan/vault.yml | 18 -
.../pga_config/{csbglsu => nexttdb}/vars.yml | 26 +-
.../scigap/production/pga_config/nexttdb/vault.yml | 18 +
.../pga_config/{csbglsu => r-hpc}/vars.yml | 25 +-
.../scigap/production/pga_config/r-hpc/vault.yml | 18 +
.../pga_config/{csbglsu => rutgersgemr}/vars.yml | 25 +-
.../production/pga_config/rutgersgemr/vault.yml | 18 +
.../pga_config/{iugateway => saverx}/vars.yml | 31 +-
.../scigap/production/pga_config/saverx/vault.yml | 18 +
.../scigap/production/pga_config/seagrid/vars.yml | 11 +-
.../production/pga_config/searchingSRA/vars.yml | 15 +-
.../pga_config/simvascular/files/pga_config.php.j2 | 7 +-
.../production/pga_config/simvascular/vars.yml | 3 +
.../production/pga_config/southdakota/vars.yml | 8 +-
.../production/pga_config/testdrive/vars.yml | 10 +-
dev-tools/ansible/pga-scigap-prod.yml | 14 +-
dev-tools/ansible/requirements.txt | 2 +-
.../gfac/templates/airavata-server.properties.j2 | 2 +-
.../roles/gfac/templates/gfac-config.yaml.j2 | 11 +
dev-tools/ansible/roles/pga/defaults/main.yml | 7 +
.../roles/pga/templates/pga-ssl-vhost.conf.j2 | 13 +
.../ansible/roles/pga/templates/pga-vhost.conf.j2 | 11 +-
.../accountprovisioning/SSHAccountManager.java | 25 +-
.../accountprovisioning/SSHAccountProvisioner.java | 9 +
.../provisioner/IULdapSSHAccountProvisioner.java | 165 +-
.../IULdapSSHAccountProvisionerProvider.java | 6 +-
.../provisioner/TestSSHAccountProvisioner.java | 5 +
.../monitor/email/parser/PBSEmailParser.java | 2 +-
.../src/main/resources/appcatalog-mysql.sql | 2 +-
.../DeltaScripts/appCatalog_schema_delta.sql | 38 +-
.../DeltaScripts/credentialStore_schema_delta.sql | 8 -
.../DeltaScripts/expCatalog_schema_delta.sql | 8 -
.../DeltaScripts/replicaCatalog_schema_delta.sql | 8 -
.../DeltaScripts/sharingCatalog_schema_delta.sql | 21 +
.../DeltaScripts/workFlow_schema_delta.sql | 8 -
...licaCatalog_lowercase_user_data_dir_example.sql | 0
.../credentialStore_keycloak_migration.sql | 0
.../expCatalog_keycloak_migration.sql | 0
.../profileService_keycloak_migration.sql | 0
.../sharingCatalog_keycloak_migration.sql | 0
.../0.16-0.17/migration-notes.md | 9 +-
.../DeltaScripts/appCatalog_schema_delta.sql | 30 -
.../0.17-0.18/migration-notes.md | 17 -
.../DeltaScripts/appCatalog_schema_delta.sql | 36 -
.../airavata-apis/airavata_api.thrift | 9 +
.../iam-admin-services-cpi.thrift | 5 +
94 files changed, 54069 insertions(+), 40695 deletions(-)
diff --cc modules/job-monitor/email-monitor/src/main/java/org/apache/airavata/monitor/email/parser/PBSEmailParser.java
index 45dce11,0000000..14a4497
mode 100644,000000..100644
--- a/modules/job-monitor/email-monitor/src/main/java/org/apache/airavata/monitor/email/parser/PBSEmailParser.java
+++ b/modules/job-monitor/email-monitor/src/main/java/org/apache/airavata/monitor/email/parser/PBSEmailParser.java
@@@ -1,106 -1,0 +1,106 @@@
+/**
+ *
+ * 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.monitor.email.parser;
+
+import org.apache.airavata.common.exception.AiravataException;
+import org.apache.airavata.model.status.JobState;
+import org.apache.airavata.monitor.JobStatusResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import java.io.IOException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class PBSEmailParser implements EmailParser {
+ private static final Logger log = LoggerFactory.getLogger(PBSEmailParser.class);
+ public static final String BEGUN_EXECUTION = "Begun execution";
+ public static final String EXECUTION_TERMINATED = "Execution terminated";
+ public static final String ABORTED_BY_PBS_SERVER = "Aborted by PBS Server";
+
+ static final String REGEX = "[a-zA-Z ]*:[ ]*(?<" + JOBID + ">[a-zA-Z0-9-_\\.]*)\\s+[a-zA-Z ]*:[ ]*(?<" +
+ JOBNAME + ">[a-zA-Z0-9-\\.]*)\\s[\\S|\\s]*(?<" + STATUS + ">" + BEGUN_EXECUTION + "|" +
+ EXECUTION_TERMINATED + "|" + ABORTED_BY_PBS_SERVER + ")";
+
+ private static final String REGEX_EXIT_STATUS = "Exit_status=(?<" + EXIT_STATUS + ">[\\d]+)";
+
+ @Override
+ public JobStatusResult parseEmail(Message message) throws MessagingException, AiravataException {
+ JobStatusResult jobStatusResult = new JobStatusResult();
+// log.info("Parsing -> " + message.getSubject());
+ try {
+ String content = ((String) message.getContent());
+ parseContent(content, jobStatusResult);
- } catch (IOException e) {
++ } catch (Exception e) {
+ throw new AiravataException("[EJM]: Error while reading content of the email message");
+ }
+ return jobStatusResult;
+ }
+
+ void parseContent(String content, JobStatusResult jobStatusResult) throws MessagingException, AiravataException {
+ content = content.replaceAll("[^\\x00-\\x7F]", "");
+ Pattern pattern = Pattern.compile(REGEX);
+ Matcher matcher = pattern.matcher(content);
+ if (matcher.find()) {
+ jobStatusResult.setJobId(matcher.group(JOBID));
+ jobStatusResult.setJobName(matcher.group(JOBNAME));
+ String statusLine = matcher.group(STATUS);
+ jobStatusResult.setState(getJobState(statusLine, content));
+ } else {
+ log.error("[EJM]: No matched found for content => \n" + content);
+ }
+ }
+
+ private JobState getJobState(String statusLine, String content) {
+ switch (statusLine) {
+ case BEGUN_EXECUTION:
+ return JobState.ACTIVE;
+ case EXECUTION_TERMINATED:
+ int exitStatus = getExitStatus(content);
+ if (exitStatus == 0) {
+ // TODO - Remove rabbitmq client script line from the script.
+ return JobState.COMPLETE;
+ } else if (exitStatus == 271) {
+ return JobState.CANCELED;
+ } else {
+ return JobState.FAILED;
+ }
+ case ABORTED_BY_PBS_SERVER:
+ return JobState.FAILED;
+ default:
+ return JobState.UNKNOWN;
+ }
+ }
+
+ private int getExitStatus(String content) {
+ Pattern pattern = Pattern.compile(REGEX_EXIT_STATUS);
+ Matcher matcher = pattern.matcher(content);
+ if (matcher.find()) {
+ String group = matcher.group(EXIT_STATUS);
+ if (group != null && !group.trim().isEmpty()) {
+ return Integer.valueOf(group.trim());
+ }
+ }
+ return -1;
+ }
+
+}