You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2019/01/24 20:03:33 UTC

[airavata] branch develop updated: Pulling the parser image

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

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


The following commit(s) were added to refs/heads/develop by this push:
     new f798bdb  Pulling the parser image
f798bdb is described below

commit f798bdb246fac5725a3a015bc7a3d54162a26970
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Thu Jan 24 15:03:20 2019 -0500

    Pulling the parser image
---
 .../apache/airavata/helix/impl/task/parsing/DataParsingTask.java  | 8 ++++++++
 1 file changed, 8 insertions(+)

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 e051217..72a29ab 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
@@ -27,6 +27,7 @@ import com.github.dockerjava.api.model.Frame;
 import com.github.dockerjava.core.DefaultDockerClientConfig;
 import com.github.dockerjava.core.DockerClientBuilder;
 import com.github.dockerjava.core.command.LogContainerResultCallback;
+import com.github.dockerjava.core.command.PullImageResultCallback;
 import com.github.dockerjava.core.command.WaitContainerResultCallback;
 import org.apache.airavata.agents.api.AgentException;
 import org.apache.airavata.agents.api.StorageResourceAdaptor;
@@ -232,6 +233,13 @@ public class DataParsingTask extends AbstractTask {
 
         DockerClient dockerClient = DockerClientBuilder.getInstance(config).build();
 
+        logger.info("Pulling image " + parser.getImageName());
+        dockerClient.pullImageCmd(parser.getImageName().split(":")[0])
+                .withTag(parser.getImageName().split(":")[1])
+                .exec(new PullImageResultCallback()).awaitSuccess();
+
+        logger.info("Successfully pulled image " + parser.getImageName());
+
         CreateContainerResponse containerResponse = dockerClient.createContainerCmd(parser.getImageName()).withCmd("/bin/sh", "-c", parser.getExecutionCommand()).withName(containerId)
                 .withBinds(Bind.parse(localInputDir + ":" + parser.getInputDirPath()),
                         Bind.parse(localOutputDir + ":" + parser.getOutputDirPath()))