This is an automated email from the ASF dual-hosted git repository.
yasithdev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/master by this push:
new e10475ccee Remove Helix/gfac-era dead orchestration code (#679)
e10475ccee is described below
commit e10475ccee0407ffc03f5c7f3233d99c850fcdb7
Author: Yasith Jayawardana <[email protected]>
AuthorDate: Sat Jun 13 11:25:55 2026 -0400
Remove Helix/gfac-era dead orchestration code (#679)
Thirty unreferenced classes under orchestration-service/task plus
email-config.yaml,
all leftover scaffolding from the pre-DB-transactional-executor
(Helix/gfac) era —
a closed set that nothing live references (the reactor compiles cleanly
without it):
- Email-monitor parsing: EmailParser +
PBS/SLURM/UGE/LSF/HTCondor/AiravataCustom
parsers + ResourceConfig + email-config.yaml (live monitoring uses squeue
polling;
ServerSettings.getEmailBasedMonitorAddress, still used by
GroovyMapBuilder, is kept).
- IServer lifecycle + its three impls (DataInterpreterService,
ProcessReschedulingService, ComputationalResourceMonitoringService) +
DataAnalyzer(Impl).
The impls carry no Spring stereotype, so component-scan never
instantiated them.
- Process scanner/scheduler/rescheduler cluster (ProcessScanner(Impl),
ProcessScheduler(Impl), ReScheduler, ExponentialBackOffReScheduler).
- Orphaned leaves: AbstractMonitor, RealtimeJobStatusParser,
JobStateValidator,
ParsingTaskInput/Inputs/Output/Outputs, AnalyzerConstants,
SchedulerConstants,
ProcessCompletionMessage.
---
.../orchestration/task/AbstractMonitor.java | 36 ----
.../task/AiravataCustomMailParser.java | 78 ---------
.../orchestration/task/AnalyzerConstants.java | 26 ---
.../ComputationalResourceMonitoringService.java | 102 -----------
.../airavata/orchestration/task/DataAnalyzer.java | 22 ---
.../orchestration/task/DataAnalyzerImpl.java | 78 ---------
.../orchestration/task/DataInterpreterService.java | 94 -----------
.../airavata/orchestration/task/EmailParser.java | 35 ----
.../task/ExponentialBackOffReScheduler.java | 186 ---------------------
.../orchestration/task/HTCondorEmailParser.java | 154 -----------------
.../orchestration/task/JobStateValidator.java | 92 ----------
.../orchestration/task/LSFEmailParser.java | 81 ---------
.../orchestration/task/PBSEmailParser.java | 103 ------------
.../orchestration/task/ParsingTaskInput.java | 68 --------
.../orchestration/task/ParsingTaskInputs.java | 63 -------
.../orchestration/task/ParsingTaskOutput.java | 59 -------
.../orchestration/task/ParsingTaskOutputs.java | 63 -------
.../task/ProcessCompletionMessage.java | 50 ------
.../task/ProcessReschedulingService.java | 97 -----------
.../orchestration/task/ProcessScanner.java | 26 ---
.../orchestration/task/ProcessScannerImpl.java | 64 -------
.../orchestration/task/ProcessScheduler.java | 44 -----
.../orchestration/task/ProcessSchedulerImpl.java | 154 -----------------
.../airavata/orchestration/task/ReScheduler.java | 32 ----
.../task/RealtimeJobStatusParser.java | 123 --------------
.../orchestration/task/ResourceConfig.java | 53 ------
.../orchestration/task/SLURMEmailParser.java | 87 ----------
.../orchestration/task/SchedulerConstants.java | 26 ---
.../orchestration/task/UGEEmailParser.java | 109 ------------
.../java/org/apache/airavata/server/IServer.java | 58 -------
.../src/main/resources/email-config.yaml | 29 ----
31 files changed, 2292 deletions(-)
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/AbstractMonitor.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/AbstractMonitor.java
deleted file mode 100644
index b8b9e26ac3..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/AbstractMonitor.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-/**
- * Functional contract for job monitors. Implementations receive job status
results
- * and are responsible for validating and forwarding them to the appropriate
queue.
- */
-public interface AbstractMonitor {
-
- /**
- * Submit a job status result for processing. Implementations should
validate
- * the result and publish it to the job status queue.
- *
- * @param jobStatusResult the status result to submit
- * @throws MonitoringException if submission fails
- */
- void submitJobStatus(JobStatusResult jobStatusResult) throws
MonitoringException;
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/AiravataCustomMailParser.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/AiravataCustomMailParser.java
deleted file mode 100644
index f319649561..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/AiravataCustomMailParser.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import jakarta.mail.Message;
-import jakarta.mail.MessagingException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.apache.airavata.exception.AiravataException;
-import org.apache.airavata.interfaces.RegistryHandler;
-import org.apache.airavata.model.status.proto.JobState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AiravataCustomMailParser implements EmailParser {
-
- private static final Logger log =
LoggerFactory.getLogger(SLURMEmailParser.class);
-
- private static final String REGEX = "[a-zA-Z]*_[a-z]*=(?<" + JOBID +
">\\d*)[ ]*[a-zA-Z]*=(?<" + JOBNAME
- + ">[a-zA-Z0-9-]*)[ ]*[a-zA-Z]*=(?<" + STATUS + ">[a-zA-Z]*).*";
-
- public static final String COMPLETED = "COMPLETED";
- private static final Pattern pattern = Pattern.compile(REGEX);
-
- @Override
- public JobStatusResult parseEmail(Message message, RegistryHandler
registryClient)
- throws MessagingException, AiravataException {
- JobStatusResult jobStatusResult = new JobStatusResult();
- parseSubject(message.getSubject(), jobStatusResult);
- return jobStatusResult;
- }
-
- private void parseSubject(String subject, JobStatusResult jobStatusResult)
throws MessagingException {
- Matcher matcher = pattern.matcher(subject);
- if (matcher.find()) {
- jobStatusResult.setJobId(matcher.group(JOBID));
- jobStatusResult.setJobName(matcher.group(JOBNAME));
- jobStatusResult.setState(getJobState(matcher.group(STATUS)));
- jobStatusResult.setAuthoritative(false);
-
- try {
- // Waiting some time for the scheduler to move the job from
completing to completed.
- Thread.sleep(5000);
- } catch (Exception ex) {
- }
-
- } else {
- log.error("[EJM]: No matched found for subject -> " + subject);
- }
- }
-
- private JobState getJobState(String state) {
- switch (state.trim()) {
- case COMPLETED:
- return JobState.COMPLETE;
- default:
- log.error("[EJM]: Job State " + state + " isn't handle by
Airavata custom parser");
- return JobState.JOB_STATE_UNKNOWN;
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/AnalyzerConstants.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/AnalyzerConstants.java
deleted file mode 100644
index ffcf24ff8c..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/AnalyzerConstants.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-public class AnalyzerConstants {
- public static final String METADATA_SCANNER_GROUP =
"metadata.scanner.group";
- public static final String METADATA_SCANNER_TRIGGER =
"metadata.scanner.trigger";
- public static final String METADATA_SCANNER_JOB = "metadata.scanner.job";
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ComputationalResourceMonitoringService.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ComputationalResourceMonitoringService.java
deleted file mode 100644
index 1295297b4a..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ComputationalResourceMonitoringService.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import java.time.Duration;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ScheduledFuture;
-import org.apache.airavata.config.ServerSettings;
-import org.apache.airavata.server.IServer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
-
-/**
- * Computational Resource Monitoring Service
- */
-public class ComputationalResourceMonitoringService implements IServer {
-
- private static final Logger logger =
LoggerFactory.getLogger(ComputationalResourceMonitoringService.class);
- private static final String SERVER_NAME = "Computational Resource
Monitoring";
-
- private static ServerStatus status;
- private ThreadPoolTaskScheduler taskScheduler;
- private final List<ScheduledFuture<?>> scheduledFutures = new
ArrayList<>();
-
- @Override
- public String getName() {
- return SERVER_NAME;
- }
-
- @Override
- public void run() {
- status = ServerStatus.STARTED;
- try {
- final String metaUsername =
ServerSettings.getMetaschedulerUsername();
- final String metaGatewayId =
ServerSettings.getMetaschedulerGateway();
- final String metaGroupResourceProfileId =
ServerSettings.getMetaschedulerGrpId();
- final int parallelJobs =
ServerSettings.getMetaschedulerNoOfScanningParallelJobs();
- final double scanningInterval =
ServerSettings.getMetaschedulerClusterScanningInterval();
-
- taskScheduler = new ThreadPoolTaskScheduler();
- taskScheduler.setPoolSize(parallelJobs);
- taskScheduler.setThreadNamePrefix("cr-monitor-");
- taskScheduler.initialize();
-
- Duration interval = Duration.ofSeconds((long) scanningInterval);
-
- for (int i = 0; i < parallelJobs; i++) {
- MonitoringJob job =
- new MonitoringJob(metaGatewayId,
metaGroupResourceProfileId, metaUsername, parallelJobs, i);
- ScheduledFuture<?> future =
taskScheduler.scheduleAtFixedRate(job, interval);
- scheduledFutures.add(future);
- }
-
- // Park here until interrupted (matching original IServer.run()
contract)
- while (!Thread.currentThread().isInterrupted()) {
- try {
- Thread.sleep(Long.MAX_VALUE);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- }
- }
- } catch (Exception e) {
- logger.error("ComputationalResourceMonitoringService failed", e);
- status = ServerStatus.FAILED;
- }
- }
-
- @Override
- public void stop() throws Exception {
- status = ServerStatus.STOPPING;
- scheduledFutures.forEach(f -> f.cancel(false));
- scheduledFutures.clear();
- if (taskScheduler != null) {
- taskScheduler.shutdown();
- }
- status = ServerStatus.STOPPED;
- }
-
- @Override
- public ServerStatus getStatus() {
- return status;
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/DataAnalyzer.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/DataAnalyzer.java
deleted file mode 100644
index 25a61deaff..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/DataAnalyzer.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-public interface DataAnalyzer extends Runnable {}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/DataAnalyzerImpl.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/DataAnalyzerImpl.java
deleted file mode 100644
index 2a4a9e1f01..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/DataAnalyzerImpl.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import java.util.Map;
-import org.apache.airavata.config.ServerSettings;
-import org.apache.airavata.interfaces.RegistryHandler;
-import org.apache.airavata.model.status.proto.JobState;
-import org.apache.airavata.model.status.proto.JobStatus;
-import org.apache.airavata.task.SchedulerUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DataAnalyzerImpl implements DataAnalyzer {
-
- private static final Logger LOGGER =
LoggerFactory.getLogger(DataAnalyzerImpl.class);
-
- protected static RegistryHandler registryHandler =
SchedulerUtils.getRegistryHandler();
-
- @Override
- public void run() {
-
- try {
- LOGGER.debug("Executing Data Analyzer ....... ");
-
- // TODO: handle multiple gateways
- String gateway = ServerSettings.getDataAnalyzingEnabledGateways();
-
- JobState state = JobState.SUBMITTED;
- JobStatus jobStatus =
JobStatus.newBuilder().setJobState(state).build();
- double time = ServerSettings.getDataAnalyzerTimeStep();
-
- int fiveMinuteCount = registryHandler.getJobCount(jobStatus,
gateway, 5);
-
- int tenMinuteCount = registryHandler.getJobCount(jobStatus,
gateway, 10);
-
- int fifteenMinuteCount = registryHandler.getJobCount(jobStatus,
gateway, 15);
-
- double fiveMinuteAverage = fiveMinuteCount * time / (5 * 60);
-
- double tenMinuteAverage = tenMinuteCount * time / (10 * 60);
-
- double fifteenMinuteAverage = fifteenMinuteCount * time / (10 *
60);
-
- LOGGER.info("service rate: 5 min avg " + fiveMinuteAverage + " 10
min avg " + tenMinuteAverage
- + " 15 min avg " + fifteenMinuteAverage);
-
- Map<String, Double> timeDistribution =
registryHandler.getAVGTimeDistribution(gateway, 15);
-
- String msg = "";
- for (Map.Entry<String, Double> entry :
timeDistribution.entrySet()) {
- msg = msg + " avg time " + entry.getKey() + " : " +
entry.getValue();
- }
- LOGGER.info(msg);
-
- } catch (Exception ex) {
- String msg = "Error occurred while executing data analyzer" +
ex.getMessage();
- LOGGER.error(msg, ex);
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/DataInterpreterService.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/DataInterpreterService.java
deleted file mode 100644
index 3d47d03bda..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/DataInterpreterService.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import java.time.Duration;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ScheduledFuture;
-import org.apache.airavata.config.ServerSettings;
-import org.apache.airavata.server.IServer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
-
-public class DataInterpreterService implements IServer {
-
- private static final Logger logger =
LoggerFactory.getLogger(DataInterpreterService.class);
- private static final String SERVER_NAME = "Data Interpreter Service";
-
- private static ServerStatus status;
- private ThreadPoolTaskScheduler taskScheduler;
- private final List<ScheduledFuture<?>> scheduledFutures = new
ArrayList<>();
-
- @Override
- public String getName() {
- return SERVER_NAME;
- }
-
- @Override
- public void run() {
- status = ServerStatus.STARTED;
- try {
- final int parallelJobs =
ServerSettings.getDataAnalyzerNoOfScanningParallelJobs();
- final double scanningInterval =
ServerSettings.getDataAnalyzerScanningInterval();
-
- taskScheduler = new ThreadPoolTaskScheduler();
- taskScheduler.setPoolSize(parallelJobs);
- taskScheduler.setThreadNamePrefix("data-analyzer-");
- taskScheduler.initialize();
-
- Duration interval = Duration.ofSeconds((long) scanningInterval);
-
- for (int i = 0; i < parallelJobs; i++) {
- ScheduledFuture<?> future =
taskScheduler.scheduleAtFixedRate(new DataAnalyzerImpl(), interval);
- scheduledFutures.add(future);
- }
-
- // Park here until interrupted (matching original IServer.run()
contract)
- while (!Thread.currentThread().isInterrupted()) {
- try {
- Thread.sleep(Long.MAX_VALUE);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- }
- }
- } catch (Exception e) {
- logger.error("DataInterpreterService failed", e);
- status = ServerStatus.FAILED;
- }
- }
-
- @Override
- public void stop() throws Exception {
- status = ServerStatus.STOPPING;
- scheduledFutures.forEach(f -> f.cancel(false));
- scheduledFutures.clear();
- if (taskScheduler != null) {
- taskScheduler.shutdown();
- }
- status = ServerStatus.STOPPED;
- }
-
- @Override
- public ServerStatus getStatus() {
- return status;
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/EmailParser.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/EmailParser.java
deleted file mode 100644
index 922c598e9f..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/EmailParser.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import jakarta.mail.Message;
-import jakarta.mail.MessagingException;
-import org.apache.airavata.exception.AiravataException;
-import org.apache.airavata.interfaces.RegistryHandler;
-
-public interface EmailParser {
- static final String STATUS = "status";
- static final String JOBID = "jobId";
- static final String JOBNAME = "jobName";
- static final String EXIT_STATUS = "exitStatus";
-
- JobStatusResult parseEmail(Message message, RegistryHandler registryClient)
- throws MessagingException, AiravataException;
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ExponentialBackOffReScheduler.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ExponentialBackOffReScheduler.java
deleted file mode 100644
index 9dc89d2abd..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ExponentialBackOffReScheduler.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import org.apache.airavata.config.ServerSettings;
-import org.apache.airavata.interfaces.RegistryHandler;
-import org.apache.airavata.model.application.io.proto.InputDataObjectType;
-import org.apache.airavata.model.experiment.proto.ExperimentModel;
-import org.apache.airavata.model.experiment.proto.UserConfigurationDataModel;
-import org.apache.airavata.model.process.proto.ProcessModel;
-import
org.apache.airavata.model.scheduling.proto.ComputationalResourceSchedulingModel;
-import org.apache.airavata.model.status.proto.ProcessState;
-import org.apache.airavata.model.status.proto.ProcessStatus;
-import org.apache.airavata.task.SchedulerUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ExponentialBackOffReScheduler implements ReScheduler {
-
- private static final Logger LOGGER =
LoggerFactory.getLogger(ExponentialBackOffReScheduler.class);
-
- protected RegistryHandler registryHandler =
SchedulerUtils.getRegistryHandler();
-
- @Override
- public void reschedule(ProcessModel processModel, ProcessState
processState) {
-
- try {
-
- int maxReschedulingCount =
ServerSettings.getMetaschedulerReschedulingThreshold();
- List<ProcessStatus> processStatusList =
processModel.getProcessStatusesList();
- ExperimentModel experimentModel =
registryHandler.getExperiment(processModel.getExperimentId());
- LOGGER.info("Rescheduling process with Id " +
processModel.getProcessId() + " experimentId "
- + processModel.getExperimentId());
- String selectionPolicyClass =
ServerSettings.getComputeResourceSelectionPolicyClass();
- ComputeResourceSelectionPolicy policy =
(ComputeResourceSelectionPolicy)
- Class.forName(selectionPolicyClass).newInstance();
- if (processState.equals(ProcessState.PROCESS_STATE_QUEUED)) {
- Optional<ComputationalResourceSchedulingModel>
computationalResourceSchedulingModel =
-
policy.selectComputeResource(processModel.getProcessId());
-
- if (computationalResourceSchedulingModel.isPresent()) {
- updateResourceSchedulingModel(processModel,
experimentModel, registryHandler);
- SchedulerUtils.updateProcessStatusAndPublishStatus(
- ProcessState.PROCESS_STATE_DEQUEUING,
- processModel.getProcessId(),
- processModel.getExperimentId(),
- experimentModel.getGatewayId());
- }
- } else if
(processState.equals(ProcessState.PROCESS_STATE_REQUEUED)) {
- int currentCount = getRequeuedCount(processStatusList);
- if (currentCount >= maxReschedulingCount) {
- SchedulerUtils.updateProcessStatusAndPublishStatus(
- ProcessState.PROCESS_STATE_FAILED,
- processModel.getProcessId(),
- processModel.getExperimentId(),
- experimentModel.getGatewayId());
- } else {
-
- registryHandler.deleteJobs(processModel.getProcessId());
- LOGGER.debug("Cleaned up current job stack for process "
+ processModel.getProcessId()
- + " experimentId " +
processModel.getExperimentId());
- ProcessStatus processStatus =
registryHandler.getProcessStatus(processModel.getProcessId());
- long pastValue = processStatus.getTimeOfStateChange();
-
- int value = fib(currentCount);
-
- long currentTime = System.currentTimeMillis();
-
- double scanningInterval =
ServerSettings.getMetaschedulerJobScanningInterval();
-
- if (currentTime >= (pastValue + value * scanningInterval *
1000)) {
- updateResourceSchedulingModel(processModel,
experimentModel, registryHandler);
- SchedulerUtils.saveAndPublishProcessStatus(
- ProcessState.PROCESS_STATE_DEQUEUING,
- processModel.getProcessId(),
- processModel.getExperimentId(),
- experimentModel.getGatewayId());
- }
- }
- }
- return;
- } catch (Exception exception) {
- LOGGER.error("Error rescheduling process " +
processModel.getProcessId(), exception);
- }
- }
-
- private int getRequeuedCount(List<ProcessStatus> processStatusList) {
- return (int) processStatusList.stream()
- .filter(x -> {
- if
(x.getState().equals(ProcessState.PROCESS_STATE_REQUEUED)) {
- return true;
- }
- return false;
- })
- .count();
- }
-
- private int fib(int n) {
- if (n <= 1) return n;
- return fib(n - 1) + fib(n - 2);
- }
-
- private void updateResourceSchedulingModel(
- ProcessModel processModel, ExperimentModel experimentModel,
RegistryHandler registryClient)
- throws Exception {
- String selectionPolicyClass =
ServerSettings.getComputeResourceSelectionPolicyClass();
- ComputeResourceSelectionPolicy policy =
(ComputeResourceSelectionPolicy)
- Class.forName(selectionPolicyClass).newInstance();
-
- Optional<ComputationalResourceSchedulingModel>
computationalResourceSchedulingModel =
- policy.selectComputeResource(processModel.getProcessId());
-
- if (computationalResourceSchedulingModel.isPresent()) {
- ComputationalResourceSchedulingModel resourceSchedulingModel =
computationalResourceSchedulingModel.get();
-
- List<InputDataObjectType> updatedExpInputs = new ArrayList<>();
- for (InputDataObjectType obj :
experimentModel.getExperimentInputsList()) {
- if (obj.getName().equals("Wall_Time")) {
- obj = obj.toBuilder()
- .setValue("-walltime=" +
resourceSchedulingModel.getWallTimeLimit())
- .build();
- } else if (obj.getName().equals("Parallel_Group_Count")) {
- obj = obj.toBuilder()
- .setValue("-mgroupcount=" +
resourceSchedulingModel.getMGroupCount())
- .build();
- }
- updatedExpInputs.add(obj);
- }
-
- List<InputDataObjectType> updatedProcInputs = new ArrayList<>();
- for (InputDataObjectType obj :
processModel.getProcessInputsList()) {
- if (obj.getName().equals("Wall_Time")) {
- obj = obj.toBuilder()
- .setValue("-walltime=" +
resourceSchedulingModel.getWallTimeLimit())
- .build();
- } else if (obj.getName().equals("Parallel_Group_Count")) {
- obj = obj.toBuilder()
- .setValue("-mgroupcount=" +
resourceSchedulingModel.getMGroupCount())
- .build();
- }
- updatedProcInputs.add(obj);
- }
-
- // update experiment model with selected compute resource
- UserConfigurationDataModel userConfigurationDataModel =
- experimentModel.getUserConfigurationData().toBuilder()
-
.setComputationalResourceScheduling(resourceSchedulingModel)
- .build();
- experimentModel = experimentModel.toBuilder()
- .clearExperimentInputs()
- .addAllExperimentInputs(updatedExpInputs)
- .clearProcesses() // avoid duplication issues
- .setUserConfigurationData(userConfigurationDataModel)
- .build();
- registryClient.updateExperiment(processModel.getExperimentId(),
experimentModel);
-
- processModel = processModel.toBuilder()
- .clearProcessInputs()
- .addAllProcessInputs(updatedProcInputs)
- .setProcessResourceSchedule(resourceSchedulingModel)
-
.setComputeResourceId(resourceSchedulingModel.getResourceHostId())
- .build();
- registryClient.updateProcess(processModel,
processModel.getProcessId());
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/HTCondorEmailParser.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/HTCondorEmailParser.java
deleted file mode 100644
index e54c3560eb..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/HTCondorEmailParser.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import jakarta.mail.Message;
-import jakarta.mail.MessagingException;
-import java.util.List;
-import java.util.Optional;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.apache.airavata.exception.AiravataException;
-import org.apache.airavata.interfaces.RegistryHandler;
-import org.apache.airavata.model.job.proto.JobModel;
-import org.apache.airavata.model.status.proto.JobState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class HTCondorEmailParser implements EmailParser {
- private static final Logger log =
LoggerFactory.getLogger(HTCondorEmailParser.class);
-
- // Group matterns to match against
- private static final String JOBID = "jobid";
- private static final String STATUS = "status";
-
- // Regex used to match desired information
- private static final String JOBID_REGEX =
- "(?<" + JOBID + ">\\d+)\\.\\d+"; // Regex pattern to match a Job
ID from an HTCondor email
- private static final String CONTENTS_REGEX =
"\\s*(?=exited\\s+\\S+\\s+with status\\s+(?<" + STATUS
- + ">-?\\d+\\.?\\d*))"; // Regex pattern to match a Job Status
-
- // Regex Patterns
- private static final Pattern jobIdPattern = Pattern.compile(JOBID_REGEX);
- private static final Pattern statusPattern =
Pattern.compile(CONTENTS_REGEX);
-
- /*
- * Name : JobStatusResult
- * Params : Message message : The email message that was received
- * Returns : JobStatusResult
- * Purpose : Responsible for parsing the email to access an HTCondor job
status
- */
- public JobStatusResult parseEmail(Message message, RegistryHandler
registryClient)
- throws MessagingException, AiravataException {
- // Job Status Results
- JobStatusResult jobStatusResult = new JobStatusResult();
-
- try {
- // Parse the Subject Line to get the job ID
- parseSubject(message.getSubject(), jobStatusResult);
-
- // Parse the email contents to get the job state
- parseJobState((String) message.getContent(), jobStatusResult);
-
- String processId = fetchProcessId((String) message.getContent());
- List<JobModel> jobs = registryClient.getJobs("processId",
processId);
- Optional<JobModel> firstJob = jobs.stream()
- .filter(job ->
job.getJobId().equals(jobStatusResult.getJobId()))
- .findFirst();
- if (firstJob.isPresent()) {
- jobStatusResult.setJobName(firstJob.get().getJobName());
- } else {
- throw new Exception("No job found matching job id " +
jobStatusResult.getJobId() + " for HTCondor");
- }
-
- } catch (Exception e) {
- throw new AiravataException(
- "[EJM]: There was an error while parsing the content of
the HTCondor email -> " + e);
- }
-
- return jobStatusResult;
- }
-
- /*
- * Name : parseSubject
- * Params : String subject : The email's subject line
- * JobStatusResult jobStatusResult : The JobStatusResult to fill
out
- * Returns : None
- * Purpose : To parse the HTCondor email subject line for the job ID
- */
- private void parseSubject(String subject, JobStatusResult jobStatusResult)
{
- // Create a new Matcher object to use for parsing the subject line
- Matcher matcher = jobIdPattern.matcher(subject);
-
- // Parse the job ID if the Job ID is available in the subject line
- if (matcher.find()) {
- jobStatusResult.setJobId(matcher.group(JOBID));
- } else {
- log.error("[EJM]: The Job ID was not found in the HTCondor email
subject -> " + subject);
- }
- }
-
- /*
- * Name : parseJobState
- * Params : String content : The email's message content
- * JobStatusResult jobStatusResult : The JobStatusResult to fill
out
- * Returns : None
- * Purpose : To parse the HTCondor email for the job status.
- * [NOTE] Due to the limited information available in the
HTCondor status emails, the only
- * statuses that may be parsed are FAILURE and COMPLETE
- */
-
- private String fetchProcessId(String content) {
- int start = content.indexOf("submitted from directory");
- int end = content.indexOf("\n", start);
- String path = content.substring(start + "submitted from
directory".length() + 1, end - 1);
- int pathSeperatorIndex = path.lastIndexOf("/");
- String processId = path.substring(pathSeperatorIndex + 1);
- return processId;
- }
-
- private void parseJobState(String content, JobStatusResult
jobStatusResult) {
- // Split message content into an array of lines
- // String[] messageArray = content.split("\n");
-
- // Access the line of the email with the status result
- // String statusLine = messageArray[5];
-
- // Match the job status in the status line
- Matcher matcher = statusPattern.matcher(content);
-
- // Determine the state that the job is in
- if (matcher.find()) {
- String status = matcher.group(STATUS);
-
- if (status.equals("0")) {
- jobStatusResult.setState(JobState.COMPLETE);
- } else if (!status.isEmpty()) {
- jobStatusResult.setState(JobState.FAILED);
- } else {
- log.error(
- "[EJM] An unknown job status result was found in the
content of the HTCondor email. Status found: "
- + status);
- }
- } else {
- log.error("[EJM]: The Job Status was not found in the content of
the HTCondor email.");
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/JobStateValidator.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/JobStateValidator.java
deleted file mode 100644
index 8853b59cbc..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/JobStateValidator.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import static org.apache.airavata.model.status.proto.JobState.ACTIVE;
-import static org.apache.airavata.model.status.proto.JobState.CANCELED;
-import static org.apache.airavata.model.status.proto.JobState.COMPLETE;
-import static org.apache.airavata.model.status.proto.JobState.FAILED;
-import static
org.apache.airavata.model.status.proto.JobState.JOB_STATE_UNKNOWN;
-import static
org.apache.airavata.model.status.proto.JobState.NON_CRITICAL_FAIL;
-import static org.apache.airavata.model.status.proto.JobState.QUEUED;
-import static org.apache.airavata.model.status.proto.JobState.SUBMITTED;
-import static org.apache.airavata.model.status.proto.JobState.SUSPENDED;
-
-import org.apache.airavata.model.status.proto.JobState;
-
-public class JobStateValidator {
-
- private static final Boolean[][] jobStateMachine = new
Boolean[JobState.values().length][JobState.values().length];
-
- private static void setTransition(JobState previous, JobState now, Boolean
value) {
- jobStateMachine[previous.getNumber()][now.getNumber()] = value;
- }
-
- static {
- int jobStates = JobState.values().length;
- for (int i = 0; i < jobStates; i++) {
- for (int j = 0; j < jobStates; j++) {
- jobStateMachine[i][j] = false;
- }
- }
-
- setTransition(SUBMITTED, QUEUED, true);
- setTransition(SUBMITTED, ACTIVE, true);
- setTransition(SUBMITTED, COMPLETE, true);
- setTransition(SUBMITTED, CANCELED, true);
- setTransition(SUBMITTED, FAILED, true);
- setTransition(SUBMITTED, SUSPENDED, true);
- setTransition(SUBMITTED, JOB_STATE_UNKNOWN, true);
- setTransition(SUBMITTED, NON_CRITICAL_FAIL, true);
-
- setTransition(QUEUED, ACTIVE, true);
- setTransition(QUEUED, COMPLETE, true);
- setTransition(QUEUED, CANCELED, true);
- setTransition(QUEUED, FAILED, true);
- setTransition(QUEUED, SUSPENDED, true);
- setTransition(QUEUED, JOB_STATE_UNKNOWN, true);
- setTransition(QUEUED, NON_CRITICAL_FAIL, true);
-
- setTransition(ACTIVE, COMPLETE, true);
- setTransition(ACTIVE, CANCELED, true);
- setTransition(ACTIVE, FAILED, true);
- setTransition(ACTIVE, SUSPENDED, true);
- setTransition(ACTIVE, JOB_STATE_UNKNOWN, true);
- setTransition(ACTIVE, NON_CRITICAL_FAIL, true);
-
- setTransition(NON_CRITICAL_FAIL, QUEUED, true);
- setTransition(NON_CRITICAL_FAIL, ACTIVE, true);
- setTransition(NON_CRITICAL_FAIL, COMPLETE, true);
- setTransition(NON_CRITICAL_FAIL, CANCELED, true);
- setTransition(NON_CRITICAL_FAIL, FAILED, true);
- setTransition(NON_CRITICAL_FAIL, SUSPENDED, true);
- setTransition(NON_CRITICAL_FAIL, JOB_STATE_UNKNOWN, true);
- }
-
- public static boolean isValid(JobState previousState, JobState newState) {
- if (previousState == null && newState != null) {
- return true;
- } else if (previousState != null && newState != null) {
- return
jobStateMachine[previousState.getNumber()][newState.getNumber()];
- } else {
- return false;
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/LSFEmailParser.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/LSFEmailParser.java
deleted file mode 100644
index 956cfd781f..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/LSFEmailParser.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import jakarta.mail.Message;
-import jakarta.mail.MessagingException;
-import java.io.IOException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.apache.airavata.exception.AiravataException;
-import org.apache.airavata.interfaces.RegistryHandler;
-import org.apache.airavata.model.status.proto.JobState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class LSFEmailParser implements EmailParser {
- private static final Logger log =
LoggerFactory.getLogger(LSFEmailParser.class);
- private static final String REGEX = "[a-zA-Z]+\\s+(?<" + JOBID +
">[\\d]+):\\s+<(?<" + JOBNAME
- + ">[a-zA-Z0-9]+)>\\s+(?<" + STATUS + ">[a-zA-Z]+)";
- public static final String STARTED = "started";
- public static final String COMPLETE = "Done";
- public static final String FAILED = "Exited";
-
- @Override
- public JobStatusResult parseEmail(Message message, RegistryHandler
registryClient)
- throws MessagingException, AiravataException {
- JobStatusResult jobStatusResult = new JobStatusResult();
-
- parseContent(message, jobStatusResult);
- return jobStatusResult;
- }
-
- private void parseContent(Message message, JobStatusResult jobStatusResult)
- throws MessagingException, AiravataException {
- String subject = message.getSubject();
- Pattern pattern = Pattern.compile(REGEX);
- Matcher matcher = pattern.matcher(subject);
- try {
- if (matcher.find()) {
- jobStatusResult.setJobId(matcher.group(JOBID));
- jobStatusResult.setJobName(matcher.group(JOBNAME));
- String content = (String) message.getContent();
- jobStatusResult.setState(getJobState(matcher.group(STATUS),
content));
- } else {
- log.error("[EJM]: No matched found for subject => \n" +
subject);
- }
- } catch (IOException e) {
- throw new AiravataException("[EJM]: Error while reading content of
the email message");
- }
- }
-
- private JobState getJobState(String status, String content) {
- switch (status) {
- case STARTED:
- return JobState.ACTIVE;
- case COMPLETE:
- return JobState.COMPLETE;
- case FAILED:
- return JobState.FAILED;
- default:
- return JobState.JOB_STATE_UNKNOWN;
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/PBSEmailParser.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/PBSEmailParser.java
deleted file mode 100644
index 7a048a1475..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/PBSEmailParser.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import jakarta.mail.Message;
-import jakarta.mail.MessagingException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.apache.airavata.exception.AiravataException;
-import org.apache.airavata.interfaces.RegistryHandler;
-import org.apache.airavata.model.status.proto.JobState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-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, RegistryHandler
registryClient)
- throws MessagingException, AiravataException {
- JobStatusResult jobStatusResult = new JobStatusResult();
- // log.info("Parsing -> " + message.getSubject());
- try {
- String content = ((String) message.getContent());
- parseContent(content, jobStatusResult);
- } 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) {
- 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.JOB_STATE_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;
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskInput.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskInput.java
deleted file mode 100644
index 5c222873c1..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskInput.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-public class ParsingTaskInput {
- private String id;
- private String name;
- private String contextVariableName;
- private String value;
- private String type;
-
- public String getContextVariableName() {
- return contextVariableName;
- }
-
- public void setContextVariableName(String contextVariableName) {
- this.contextVariableName = contextVariableName;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskInputs.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskInputs.java
deleted file mode 100644
index 9c419a8e27..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskInputs.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.airavata.task.TaskParamType;
-
-public class ParsingTaskInputs implements TaskParamType {
-
- private static final ObjectMapper MAPPER = new ObjectMapper();
-
- private List<ParsingTaskInput> inputs = new ArrayList<>();
-
- public List<ParsingTaskInput> getInputs() {
- return inputs;
- }
-
- public void setInputs(List<ParsingTaskInput> inputs) {
- this.inputs = inputs;
- }
-
- public void addInput(ParsingTaskInput input) {
- this.inputs.add(input);
- }
-
- @Override
- public String serialize() {
- try {
- return MAPPER.writeValueAsString(this);
- } catch (Exception e) {
- throw new RuntimeException("Failed to serialize
ParsingTaskInputs", e);
- }
- }
-
- @Override
- public void deserialize(String content) {
- try {
- ParsingTaskInputs parsingTaskInputs = MAPPER.readValue(content,
ParsingTaskInputs.class);
- this.inputs = parsingTaskInputs.getInputs();
- } catch (Exception e) {
- throw new RuntimeException("Failed to deserialize
ParsingTaskInputs", e);
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskOutput.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskOutput.java
deleted file mode 100644
index fa1f00aeac..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskOutput.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-public class ParsingTaskOutput {
- private String id;
- private String contextVariableName;
- private String storageResourceId;
- private String uploadDirectory;
-
- public String getContextVariableName() {
- return contextVariableName;
- }
-
- public void setContextVariableName(String contextVariableName) {
- this.contextVariableName = contextVariableName;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getStorageResourceId() {
- return storageResourceId;
- }
-
- public void setStorageResourceId(String storageResourceId) {
- this.storageResourceId = storageResourceId;
- }
-
- public String getUploadDirectory() {
- return uploadDirectory;
- }
-
- public void setUploadDirectory(String uploadDirectory) {
- this.uploadDirectory = uploadDirectory;
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskOutputs.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskOutputs.java
deleted file mode 100644
index 91bb97d6f8..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ParsingTaskOutputs.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.airavata.task.TaskParamType;
-
-public class ParsingTaskOutputs implements TaskParamType {
-
- private static final ObjectMapper MAPPER = new ObjectMapper();
-
- private List<ParsingTaskOutput> outputs = new ArrayList<>();
-
- public List<ParsingTaskOutput> getOutputs() {
- return outputs;
- }
-
- public void setOutputs(List<ParsingTaskOutput> outputs) {
- this.outputs = outputs;
- }
-
- public void addOutput(ParsingTaskOutput output) {
- outputs.add(output);
- }
-
- @Override
- public String serialize() {
- try {
- return MAPPER.writeValueAsString(this);
- } catch (Exception e) {
- throw new RuntimeException("Failed to serialize
ParsingTaskOutputs", e);
- }
- }
-
- @Override
- public void deserialize(String content) {
- try {
- ParsingTaskOutputs parsingTaskOutputs = MAPPER.readValue(content,
ParsingTaskOutputs.class);
- this.outputs = parsingTaskOutputs.getOutputs();
- } catch (Exception e) {
- throw new RuntimeException("Failed to deserialize
ParsingTaskOutputs", e);
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessCompletionMessage.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessCompletionMessage.java
deleted file mode 100644
index 553bb8b722..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessCompletionMessage.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-public class ProcessCompletionMessage {
- private String processId;
- private String experimentId;
- private String gatewayId;
-
- public String getProcessId() {
- return processId;
- }
-
- public void setProcessId(String processId) {
- this.processId = processId;
- }
-
- public String getExperimentId() {
- return experimentId;
- }
-
- public void setExperimentId(String experimentId) {
- this.experimentId = experimentId;
- }
-
- public String getGatewayId() {
- return gatewayId;
- }
-
- public void setGatewayId(String gatewayId) {
- this.gatewayId = gatewayId;
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessReschedulingService.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessReschedulingService.java
deleted file mode 100644
index a87b27caed..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessReschedulingService.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import java.time.Duration;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ScheduledFuture;
-import org.apache.airavata.config.ServerSettings;
-import org.apache.airavata.server.IServer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
-
-/**
- * Process rescheduling service to scann the Queue or Requeued services and
relaunch them.
- */
-public class ProcessReschedulingService implements IServer {
-
- private static final Logger logger =
LoggerFactory.getLogger(ProcessReschedulingService.class);
- private static final String SERVER_NAME = "Airavata Process Rescheduling
Service";
-
- private static ServerStatus status;
- private ThreadPoolTaskScheduler taskScheduler;
- private final List<ScheduledFuture<?>> scheduledFutures = new
ArrayList<>();
-
- @Override
- public String getName() {
- return SERVER_NAME;
- }
-
- @Override
- public void run() {
- status = ServerStatus.STARTED;
- try {
- final int parallelJobs =
ServerSettings.getMetaschedulerNoOfScanningParallelJobs();
- final double scanningInterval =
ServerSettings.getMetaschedulerJobScanningInterval();
-
- taskScheduler = new ThreadPoolTaskScheduler();
- taskScheduler.setPoolSize(parallelJobs);
- taskScheduler.setThreadNamePrefix("process-scanner-");
- taskScheduler.initialize();
-
- Duration interval = Duration.ofSeconds((long) scanningInterval);
-
- for (int i = 0; i < parallelJobs; i++) {
- ScheduledFuture<?> future =
taskScheduler.scheduleAtFixedRate(new ProcessScannerImpl(), interval);
- scheduledFutures.add(future);
- }
-
- // Park here until interrupted (matching original IServer.run()
contract)
- while (!Thread.currentThread().isInterrupted()) {
- try {
- Thread.sleep(Long.MAX_VALUE);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- }
- }
- } catch (Exception e) {
- logger.error("ProcessReschedulingService failed", e);
- status = ServerStatus.FAILED;
- }
- }
-
- @Override
- public void stop() throws Exception {
- status = ServerStatus.STOPPING;
- scheduledFutures.forEach(f -> f.cancel(false));
- scheduledFutures.clear();
- if (taskScheduler != null) {
- taskScheduler.shutdown();
- }
- status = ServerStatus.STOPPED;
- }
-
- @Override
- public ServerStatus getStatus() {
- return status;
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessScanner.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessScanner.java
deleted file mode 100644
index d0669f0aae..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessScanner.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-/**
- * This class scans all queued processes and relaunch them based on
- * activated rescheduling algorithm
- */
-public interface ProcessScanner extends Runnable {}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessScannerImpl.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessScannerImpl.java
deleted file mode 100644
index 39aa0328c7..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessScannerImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import java.util.List;
-import org.apache.airavata.config.ServerSettings;
-import org.apache.airavata.interfaces.RegistryHandler;
-import org.apache.airavata.model.process.proto.ProcessModel;
-import org.apache.airavata.model.status.proto.ProcessState;
-import org.apache.airavata.task.SchedulerUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ProcessScannerImpl implements ProcessScanner {
- private static final Logger LOGGER =
LoggerFactory.getLogger(ProcessScannerImpl.class);
-
- protected static RegistryHandler registryHandler =
SchedulerUtils.getRegistryHandler();
-
- @Override
- public void run() {
- try {
- LOGGER.debug("Executing Process scanner ....... ");
-
- ProcessState state = ProcessState.PROCESS_STATE_QUEUED;
- List<ProcessModel> processModelList =
registryHandler.getProcessListInState(state);
-
- String reSchedulerPolicyClass =
ServerSettings.getReSchedulerPolicyClass();
- ReScheduler reScheduler =
- (ReScheduler)
Class.forName(reSchedulerPolicyClass).newInstance();
-
- for (ProcessModel processModel : processModelList) {
- reScheduler.reschedule(processModel, state);
- }
-
- ProcessState ReQueuedState = ProcessState.PROCESS_STATE_REQUEUED;
- List<ProcessModel> reQueuedProcessModels =
registryHandler.getProcessListInState(ReQueuedState);
-
- for (ProcessModel processModel : reQueuedProcessModels) {
- reScheduler.reschedule(processModel, ReQueuedState);
- }
-
- } catch (Exception ex) {
- String msg = "Error occurred while executing job" +
ex.getMessage();
- LOGGER.error(msg, ex);
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessScheduler.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessScheduler.java
deleted file mode 100644
index cdd62e982c..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessScheduler.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-/**
- * Provides interfaces for Process related scheduling operations
- */
-public interface ProcessScheduler {
-
- /**
- * This method checks experiment can be instantly scheduled to a computer
resource,
- * If it can be scheduled, Processes are updated with selected Scheduling
resource otherwise all are
- * moved to Queued state
- * @param experimentId
- * @return boolean
- */
- boolean canLaunch(String experimentId);
-
- /**
- * This method can be used to reschedule a failed experiment.
- * If experiment can be scheduled instantly, Processes are updated with
scheduling resources, otherwise
- * is moved to Queued state
- * @param experimentId
- * @return boolean
- */
- boolean reschedule(String experimentId);
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessSchedulerImpl.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessSchedulerImpl.java
deleted file mode 100644
index 7550919e9e..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ProcessSchedulerImpl.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import org.apache.airavata.config.ServerSettings;
-import org.apache.airavata.interfaces.RegistryHandler;
-import org.apache.airavata.model.application.io.proto.InputDataObjectType;
-import org.apache.airavata.model.experiment.proto.ExperimentModel;
-import org.apache.airavata.model.experiment.proto.UserConfigurationDataModel;
-import org.apache.airavata.model.process.proto.ProcessModel;
-import
org.apache.airavata.model.scheduling.proto.ComputationalResourceSchedulingModel;
-import org.apache.airavata.model.status.proto.ProcessState;
-import org.apache.airavata.model.status.proto.ProcessStatus;
-import org.apache.airavata.task.SchedulerUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class provides implementation of the ProcessSchedule Interface
- */
-public class ProcessSchedulerImpl implements ProcessScheduler {
- private static Logger LOGGER =
LoggerFactory.getLogger(ProcessSchedulerImpl.class);
-
- private RegistryHandler registryHandler;
-
- public ProcessSchedulerImpl() {
- try {
- registryHandler = SchedulerUtils.getRegistryHandler();
- } catch (Exception e) {
- LOGGER.error("Error occurred while fetching registry handler", e);
- }
- }
-
- @Override
- public boolean canLaunch(String experimentId) {
- final RegistryHandler registryClient = this.registryHandler;
- try {
- List<ProcessModel> processModels =
registryClient.getProcessList(experimentId);
-
- ExperimentModel experiment =
registryClient.getExperiment(experimentId);
- boolean allProcessesScheduled = true;
-
- String selectionPolicyClass =
ServerSettings.getComputeResourceSelectionPolicyClass();
-
- ComputeResourceSelectionPolicy policy =
(ComputeResourceSelectionPolicy)
- Class.forName(selectionPolicyClass).newInstance();
-
- for (ProcessModel processModel : processModels) {
- ProcessStatus processStatus =
registryClient.getProcessStatus(processModel.getProcessId());
-
- if
(processStatus.getState().equals(ProcessState.PROCESS_STATE_CREATED)
- ||
processStatus.getState().equals(ProcessState.PROCESS_STATE_VALIDATED)) {
-
- Optional<ComputationalResourceSchedulingModel>
computationalResourceSchedulingModel =
-
policy.selectComputeResource(processModel.getProcessId());
-
- if (computationalResourceSchedulingModel.isPresent()) {
- ComputationalResourceSchedulingModel
resourceSchedulingModel =
- computationalResourceSchedulingModel.get();
-
- // Update experiment inputs with scheduling params
- List<InputDataObjectType> updatedExpInputs = new
ArrayList<>();
- for (InputDataObjectType obj :
experiment.getExperimentInputsList()) {
- if (obj.getName().equals("Wall_Time")) {
- obj = obj.toBuilder()
- .setValue("-walltime=" +
resourceSchedulingModel.getWallTimeLimit())
- .build();
- } else if
(obj.getName().equals("Parallel_Group_Count")) {
- obj = obj.toBuilder()
- .setValue("-mgroupcount=" +
resourceSchedulingModel.getMGroupCount())
- .build();
- }
- updatedExpInputs.add(obj);
- }
-
- // update experiment model with selected compute
resource
- UserConfigurationDataModel userConfigurationDataModel =
-
experiment.getUserConfigurationData().toBuilder()
-
.setComputationalResourceScheduling(resourceSchedulingModel)
- .build();
- experiment = experiment.toBuilder()
- .clearExperimentInputs()
- .addAllExperimentInputs(updatedExpInputs)
- .clearProcesses() // avoid duplication issues
-
.setUserConfigurationData(userConfigurationDataModel)
- .build();
- registryClient.updateExperiment(experimentId,
experiment);
-
- // Update process inputs with scheduling params
- List<InputDataObjectType> updatedProcInputs = new
ArrayList<>();
- for (InputDataObjectType obj :
processModel.getProcessInputsList()) {
- if (obj.getName().equals("Wall_Time")) {
- obj = obj.toBuilder()
- .setValue("-walltime=" +
resourceSchedulingModel.getWallTimeLimit())
- .build();
- } else if
(obj.getName().equals("Parallel_Group_Count")) {
- obj = obj.toBuilder()
- .setValue("-mgroupcount=" +
resourceSchedulingModel.getMGroupCount())
- .build();
- }
- updatedProcInputs.add(obj);
- }
-
- processModel = processModel.toBuilder()
- .clearProcessInputs()
- .addAllProcessInputs(updatedProcInputs)
-
.setProcessResourceSchedule(resourceSchedulingModel)
-
.setComputeResourceId(resourceSchedulingModel.getResourceHostId())
- .build();
-
- registryClient.updateProcess(processModel,
processModel.getProcessId());
-
- } else {
- ProcessStatus newProcessStatus =
ProcessStatus.newBuilder()
- .setState(ProcessState.PROCESS_STATE_QUEUED)
- .build();
- registryClient.updateProcessStatus(newProcessStatus,
processModel.getProcessId());
- allProcessesScheduled = false;
- }
- }
- }
- return allProcessesScheduled;
- } catch (Exception exception) {
- LOGGER.error(" Exception occurred while scheduling experiment with
Id {}", experimentId, exception);
- }
-
- return false;
- }
-
- @Override
- public boolean reschedule(String experimentId) {
- return false;
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ReScheduler.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ReScheduler.java
deleted file mode 100644
index 1d9193c5cc..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ReScheduler.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import org.apache.airavata.model.process.proto.ProcessModel;
-import org.apache.airavata.model.status.proto.ProcessState;
-
-/**
- * This is the interface class for ReScheduling
- * algorithm.
- */
-public interface ReScheduler {
-
- void reschedule(ProcessModel processModel, ProcessState processState);
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/RealtimeJobStatusParser.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/RealtimeJobStatusParser.java
deleted file mode 100644
index 46337f7356..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/RealtimeJobStatusParser.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import org.apache.airavata.interfaces.RegistryHandler;
-import org.apache.airavata.model.job.proto.JobModel;
-import org.apache.airavata.model.status.proto.JobState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RealtimeJobStatusParser {
-
- private static final Logger logger =
LoggerFactory.getLogger(RealtimeJobStatusParser.class);
- private static final ObjectMapper MAPPER = new ObjectMapper();
-
- private String getJobIdIdByJobNameWithRetry(String jobName, String taskId,
RegistryHandler registryClient)
- throws Exception {
- for (int i = 0; i < 3; i++) {
-
- List<JobModel> jobsOfTask = registryClient.getJobs("taskId",
taskId);
- if (jobsOfTask == null || jobsOfTask.isEmpty()) {
- // Retry after 2s
- logger.warn("No jobs for task {}. Retrying in 2 seconds",
taskId);
- Thread.sleep(2000);
- } else {
- Optional<JobModel> filtered = jobsOfTask.stream()
- .filter(job -> jobName.equals(job.getJobName()))
- .findFirst();
- if (filtered.isPresent()) {
- return filtered.get().getJobId();
- } else {
- logger.warn("No job for job name {} and task {}. Retrying
in 2 seconds", jobName, taskId);
- Thread.sleep(2000);
- }
- }
- }
- return null;
- }
-
- public JobStatusResult parse(String rawMessage, String publisherId,
RegistryHandler registryClient) {
-
- try {
- Map<String, String> asMap = MAPPER.readValue(rawMessage, new
TypeReference<Map<String, String>>() {});
- if (asMap.containsKey("jobName") && asMap.containsKey("status")) {
- String jobName = (String) asMap.get("jobName");
- String status = (String) asMap.get("status");
- String taskId = (String) asMap.get("task");
-
- if (jobName != null && status != null && taskId != null) {
-
- try {
- String jobId = getJobIdIdByJobNameWithRetry(jobName,
taskId, registryClient);
- if (jobId == null) {
- logger.error("No job id for job name {}", jobName);
- return null;
- }
-
- JobState jobState =
- switch (status) {
- case "RUNNING" -> JobState.ACTIVE;
- case "COMPLETED" -> JobState.COMPLETE;
- case "FAILED" -> JobState.FAILED;
- case "SUBMITTED" -> JobState.SUBMITTED;
- case "QUEUED" -> JobState.QUEUED;
- case "CANCELED" -> JobState.CANCELED;
- case "SUSPENDED" -> JobState.SUSPENDED;
- case "UNKNOWN" ->
JobState.JOB_STATE_UNKNOWN;
- case "NON_CRITICAL_FAIL" ->
JobState.NON_CRITICAL_FAIL;
- default -> null;
- };
-
- if (jobState == null) {
- logger.error("Invalid job state {}", status);
- return null;
- }
-
- JobStatusResult jobStatusResult = new
JobStatusResult();
- jobStatusResult.setJobId(jobId);
- jobStatusResult.setJobName(jobName);
- jobStatusResult.setState(jobState);
- jobStatusResult.setPublisherName(publisherId);
- return jobStatusResult;
- } catch (Exception e) {
- logger.error("Failed to fetch job id for job name {}",
jobName);
- return null;
- }
- } else {
- logger.error("Job name, taskId or status is null in
message {}", rawMessage);
- return null;
- }
- } else {
- logger.error("Data structure of message {} is not correct",
rawMessage);
- return null;
- }
- } catch (JsonProcessingException e) {
- logger.error("Failed to parse raw data {} to type Map",
rawMessage, e);
- return null;
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ResourceConfig.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ResourceConfig.java
deleted file mode 100644
index 967cf0b019..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/ResourceConfig.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import java.util.List;
-import
org.apache.airavata.model.appcatalog.computeresource.proto.ResourceJobManagerType;
-
-public class ResourceConfig {
- private ResourceJobManagerType jobManagerType;
- private String emailParser;
- private List<String> resourceEmailAddresses;
-
- public ResourceJobManagerType getJobManagerType() {
- return jobManagerType;
- }
-
- public void setJobManagerType(ResourceJobManagerType jobManagerType) {
- this.jobManagerType = jobManagerType;
- }
-
- public String getEmailParser() {
- return emailParser;
- }
-
- public void setEmailParser(String emailParser) {
- this.emailParser = emailParser;
- }
-
- public List<String> getResourceEmailAddresses() {
- return resourceEmailAddresses;
- }
-
- public void setResourceEmailAddresses(List<String> resourceEmailAddresses)
{
- this.resourceEmailAddresses = resourceEmailAddresses;
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/SLURMEmailParser.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/SLURMEmailParser.java
deleted file mode 100644
index 9debcc31df..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/SLURMEmailParser.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import jakarta.mail.Message;
-import jakarta.mail.MessagingException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.apache.airavata.exception.AiravataException;
-import org.apache.airavata.interfaces.RegistryHandler;
-import org.apache.airavata.model.status.proto.JobState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SLURMEmailParser implements EmailParser {
-
- private static final Logger log =
LoggerFactory.getLogger(SLURMEmailParser.class);
-
- private static final String REGEX = "[A-Z]*\\s[a-zA-Z]*_[a-z]*=(?<" +
JOBID + ">\\d*)[ ]*[a-zA-Z]*=(?<" + JOBNAME
- + ">[a-zA-Z0-9-]*)[ ]*(?<" + STATUS + ">[]a-zA-Z ]*),.*";
-
- public static final String BEGAN = "Began";
- public static final String STAGE_OUT = "Staged Out";
- public static final String ENDED = "Ended";
- public static final String FAILED = "Failed";
- private static final Pattern cancelledStatePattern =
Pattern.compile("CANCELLED");
- private static final Pattern pattern = Pattern.compile(REGEX);
-
- @Override
- public JobStatusResult parseEmail(Message message, RegistryHandler
registryClient)
- throws MessagingException, AiravataException {
- JobStatusResult jobStatusResult = new JobStatusResult();
- parseSubject(message.getSubject(), jobStatusResult);
- return jobStatusResult;
- }
-
- private void parseSubject(String subject, JobStatusResult jobStatusResult)
throws MessagingException {
- Matcher matcher = pattern.matcher(subject);
- if (matcher.find()) {
- jobStatusResult.setJobId(matcher.group(JOBID));
- jobStatusResult.setJobName(matcher.group(JOBNAME));
- jobStatusResult.setState(getJobState(matcher.group(STATUS),
subject));
- } else {
- log.error("[EJM]: No matched found for subject -> " + subject);
- }
- }
-
- private JobState getJobState(String state, String subject) {
- switch (state.trim()) {
- case BEGAN:
- case STAGE_OUT:
- return JobState.ACTIVE;
- case ENDED:
- Matcher matcher = cancelledStatePattern.matcher(subject);
- if (matcher.find()) {
- return JobState.CANCELED;
- }
- return JobState.COMPLETE;
- case FAILED:
- if (subject.contains("NODE_FAIL")) {
- return JobState.NON_CRITICAL_FAIL;
- } else {
- return JobState.FAILED;
- }
- default:
- log.error("[EJM]: Job State " + state + " isn't handle by
SLURM parser");
- return JobState.JOB_STATE_UNKNOWN;
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/SchedulerConstants.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/SchedulerConstants.java
deleted file mode 100644
index 16ac0ca65b..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/SchedulerConstants.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-public class SchedulerConstants {
- public static final String PROCESS_SCANNER_GROUP = "process.scanner.group";
- public static final String PROCESS_SCANNER_TRIGGER =
"prcoess.scanner.trigger";
- public static final String PROCESS_SCANNER_JOB = "process.scanner.job";
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/UGEEmailParser.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/UGEEmailParser.java
deleted file mode 100644
index b1c7e4d8d9..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/task/UGEEmailParser.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
-*
-* 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.orchestration.task;
-
-import jakarta.mail.Message;
-import jakarta.mail.MessagingException;
-import java.io.IOException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.apache.airavata.exception.AiravataException;
-import org.apache.airavata.interfaces.RegistryHandler;
-import org.apache.airavata.model.status.proto.JobState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class UGEEmailParser implements EmailParser {
-
- private static final Logger log =
LoggerFactory.getLogger(UGEEmailParser.class);
- private static final String REGEX = "[\\w]*[ ]*(?<" + JOBID + ">[\\d]*)[
]*\\((?<" + JOBNAME
- + ">[a-zA-Z0-9]*)\\)[ ]*(?<" + STATUS + ">[a-zA-Z]*)";
- public static final String STARTED = "Started";
- public static final String COMPLETE = "Complete";
- public static final String FAILED = "Failed";
- public static final String KILLED = "Killed";
- private static final String REGEX_EXIT_STATUS = "Exit Status[ ]*=[ ]*(?<"
+ EXIT_STATUS + ">[\\d]+)";
- public static final String ABORTED = "Aborted";
-
- @Override
- public JobStatusResult parseEmail(Message message, RegistryHandler
registryClient)
- throws MessagingException, AiravataException {
- JobStatusResult jobStatusResult = new JobStatusResult();
-
- parseContent(message, jobStatusResult);
- return jobStatusResult;
- }
-
- private void parseContent(Message message, JobStatusResult jobStatusResult)
- throws MessagingException, AiravataException {
- String subject = message.getSubject();
-
- // FIXME - HACK to handle Little Dog email issue from SIU
- subject = subject.replace("Set in error state", "Failed");
-
- Pattern pattern = Pattern.compile(REGEX);
- Matcher matcher = pattern.matcher(subject);
- try {
- if (matcher.find()) {
- jobStatusResult.setJobId(matcher.group(JOBID));
- jobStatusResult.setJobName(matcher.group(JOBNAME));
- String content = (String) message.getContent();
- jobStatusResult.setState(getJobState(matcher.group(STATUS),
content));
- } else {
- log.error("[EJM]: No matched found for subject => \n" +
subject);
- }
- } catch (IOException e) {
- throw new AiravataException("[EJM]: Error while reading content of
the email message");
- }
- }
-
- private JobState getJobState(String status, String content) {
- switch (status) {
- case STARTED:
- return JobState.ACTIVE;
- case COMPLETE:
- int exitStatus = getExitStatus(content);
- if (exitStatus == 0) {
- return JobState.COMPLETE;
- } else {
- log.info("[EJM]: Job returns with Exit Status = " +
exitStatus + " , Marked as Failed");
- return JobState.FAILED;
- }
- case FAILED:
- return JobState.FAILED;
- case ABORTED:
- return JobState.CANCELED;
- default:
- return JobState.JOB_STATE_UNKNOWN;
- }
- }
-
- private int getExitStatus(String content) {
- Pattern statusPattern = Pattern.compile(REGEX_EXIT_STATUS);
- Matcher statusMatcher = statusPattern.matcher(content);
- if (statusMatcher.find()) {
- String group = statusMatcher.group(EXIT_STATUS);
- if (group != null && !group.trim().isEmpty()) {
- return Integer.valueOf(group.trim());
- }
- }
- return -1;
- }
-}
diff --git a/airavata-api/src/main/java/org/apache/airavata/server/IServer.java
b/airavata-api/src/main/java/org/apache/airavata/server/IServer.java
deleted file mode 100644
index f405716997..0000000000
--- a/airavata-api/src/main/java/org/apache/airavata/server/IServer.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
-*
-* 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.server;
-
-import java.util.Calendar;
-import java.util.Date;
-
-/**
- * Common lifecycle interface for all Airavata server components.
- * Extends Runnable — implementations put blocking work in run().
- * Thread creation is handled by the caller (e.g.
AiravataServer.registerAndStart()).
- */
-public interface IServer extends Runnable {
-
- enum ServerStatus {
- STOPPED,
- STARTING,
- STARTED,
- STOPPING,
- FAILED;
-
- private Date timestamp;
-
- public void updateTime() {
- timestamp = Calendar.getInstance().getTime();
- }
-
- public Date getTime() {
- return timestamp;
- }
- }
-
- /** Human-readable name for logging and diagnostics. */
- String getName();
-
- /** Stop this component. */
- void stop() throws Exception;
-
- /** Current lifecycle status. */
- ServerStatus getStatus();
-}
diff --git a/airavata-server/src/main/resources/email-config.yaml
b/airavata-server/src/main/resources/email-config.yaml
deleted file mode 100644
index 6577c32d6b..0000000000
--- a/airavata-server/src/main/resources/email-config.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-config:
- resources:
- - jobManagerType: PBS
- emailParser: org.apache.airavata.monitor.email.parser.PBSEmailParser
- resourceEmailAddresses:
- - [email protected] # gordon
- - [email protected] # Bigred2
- - root <[email protected]> # Bigred2
- - root <[email protected]> # alamo
-
- - jobManagerType: SLURM
- emailParser: org.apache.airavata.monitor.email.parser.SLURMEmailParser
- resourceEmailAddresses:
- - SDSC Admin <[email protected]> # comet
- - [email protected] # stampede
- - [email protected]
-
- - jobManagerType: UGE
- emailParser: org.apache.airavata.monitor.email.parser.UGEEmailParser
- resourceEmailAddresses:
- - ls4.tacc.utexas.edu # contain Lonestar
-
- - jobManagerType: HTCONDOR
- emailParser: org.apache.airavata.monitor.email.parser.HTCondorEmailParser
- resourceEmailAddresses:
- - [email protected]
- - Owner of HTCondor Daemons <[email protected]> #EHT Condor
Access point
- - Owner of HTCondor Daemons <[email protected]>
- - [email protected] # AutoDock_Vina