You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/12/18 22:57:50 UTC

[GitHub] rabbah commented on a change in pull request #2021: Implement a new ContainerPool based on reactive patterns

rabbah commented on a change in pull request #2021: Implement a new ContainerPool based on reactive patterns
URL: https://github.com/apache/incubator-openwhisk/pull/2021#discussion_r108955406
 
 

 ##########
 File path: core/invoker/src/main/scala/whisk/core/containerpool/DockerClient.scala
 ##########
 @@ -161,3 +116,66 @@ case class ContainerId(val asString: String) extends AnyVal
 case class ContainerIp(val asString: String) extends AnyVal
 
 case class DockerCommandException(code: Int, stdout: String, stderr: String) extends Exception(s"code: $code stdout: $stdout stderr: $stderr")
+
+trait DockerApi {
+    /**
+     * Spawns a container in detached mode.
+     *
+     * @param image the image to start the container with
+     * @param args arguments for the docker run command
+     * @param cmd the command to start the container with
+     * @param name an optional name for the container
+     * @return id of the started container
+     */
+    def run(image: String,
+            args: Seq[String] = Seq.empty[String],
+            cmd: Seq[String] = Seq.empty[String])(implicit transid: TransactionId): Future[ContainerId]
+
+    /**
+     * Gets the IP adress of a given container.
+     *
+     * @param id the id of the container to get the IP address from
+     * @return ip of the container
+     */
+    def inspectIPAddress(id: ContainerId)(implicit transid: TransactionId): Future[ContainerIp]
+
+    /**
+     * Pauses the container with the given id.
+     *
+     * @param id the id of the container to pause
+     * @return a Future completing according to the command's exit-code
+     */
+    def pause(id: ContainerId)(implicit transid: TransactionId): Future[Unit]
 
 Review comment:
   Unit, really? will the future fail if the pause (unpause, rm, etc. fail)?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services