This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/staging by this push:
     new 1cd1a3b  Externalizing the capability to delete the container after 
the parsing is completed
1cd1a3b is described below

commit 1cd1a3b0d900ed01fbe695815071f0fb4a78de87
Author: Dimuthu Wannipurage <[email protected]>
AuthorDate: Wed Jul 24 13:56:10 2019 -0400

    Externalizing the capability to delete the container after the parsing is 
completed
---
 .../templates/participant/airavata-server.properties.j2        |  7 ++++++-
 .../airavata/helix/impl/task/parsing/DataParsingTask.java      | 10 +++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git 
a/dev-tools/ansible/roles/helix_setup/templates/participant/airavata-server.properties.j2
 
b/dev-tools/ansible/roles/helix_setup/templates/participant/airavata-server.properties.j2
index 9394e84..5cb3c55 100644
--- 
a/dev-tools/ansible/roles/helix_setup/templates/participant/airavata-server.properties.j2
+++ 
b/dev-tools/ansible/roles/helix_setup/templates/participant/airavata-server.properties.j2
@@ -82,4 +82,9 @@ kafka.parsing.broker.publisher.id={{ 
parser_broker_publisher_id }}
 ###########################################################################
 enable.realtime.monitor=False
 
-local.data.location={{ local_data_location }}
\ No newline at end of file
+local.data.location={{ local_data_location }}
+
+###########################################################################
+# Data Parsing Task Level Configurations
+###########################################################################
+data.parser.delete.container=True
\ No newline at end of file
diff --git 
a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/parsing/DataParsingTask.java
 
b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/parsing/DataParsingTask.java
index a9f30eb..07c959f 100644
--- 
a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/parsing/DataParsingTask.java
+++ 
b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/parsing/DataParsingTask.java
@@ -229,7 +229,7 @@ public class DataParsingTask extends AbstractTask {
 
     }
 
-    private void runContainer(Parser parser, String containerId, String 
localInputDir, String localOutputDir, Map<String, String> properties) {
+    private void runContainer(Parser parser, String containerId, String 
localInputDir, String localOutputDir, Map<String, String> properties) throws 
ApplicationSettingsException {
         DefaultDockerClientConfig.Builder config = 
DefaultDockerClientConfig.createDefaultConfigBuilder();
 
         DockerClient dockerClient = 
DockerClientBuilder.getInstance(config).build();
@@ -288,8 +288,12 @@ public class DataParsingTask extends AbstractTask {
             logger.info("Container logs " + dockerLogs.toString());
         }
 
-        dockerClient.removeContainerCmd(containerResponse.getId()).exec();
-        logger.info("Successfully removed container with id " + 
containerResponse.getId());
+        if (ServerSettings.isSettingDefined("data.parser.delete.container") &&
+                
Boolean.parseBoolean(ServerSettings.getSetting("data.parser.delete.container")))
 {
+            dockerClient.removeContainerCmd(containerResponse.getId()).exec();
+            logger.info("Successfully removed container with id " + 
containerResponse.getId());
+        }
+
     }
 
     private StorageResourceAdaptor getStorageResourceAdaptor(String 
storageResourceId, AdaptorSupport adaptorSupport) throws TaskOnFailException, 
TException, AgentException {

Reply via email to