[ https://issues.apache.org/jira/browse/BEAM-3327?focusedWorklogId=94359&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-94359 ]
ASF GitHub Bot logged work on BEAM-3327: ---------------------------------------- Author: ASF GitHub Bot Created on: 23/Apr/18 23:03 Start Date: 23/Apr/18 23:03 Worklog Time Spent: 10m Work Description: jkff commented on a change in pull request #5189: [BEAM-3327] Basic Docker environment factory URL: https://github.com/apache/beam/pull/5189#discussion_r183562823 ########## File path: runners/java-fn-execution/src/test/java/org/apache/beam/runners/fnexecution/environment/DockerCommandTest.java ########## @@ -0,0 +1,51 @@ +/* + * 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.beam.runners.fnexecution.environment; + +import java.time.Duration; +import java.util.Arrays; +import java.util.Collections; +import org.apache.beam.runners.fnexecution.environment.testing.NeedsDocker; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Tests for {@link DockerCommand}. */ +@Category(NeedsDocker.class) +@RunWith(JUnit4.class) +public class DockerCommandTest { + + @Test + public void helloWorld() throws Exception { + DockerCommand docker = getWrapper(); + String container = docker.runImage("hello-world", Collections.emptyList()); + System.out.printf("Started container: %s%n", container); + } + + @Test + public void killContainer() throws Exception { + DockerCommand docker = getWrapper(); + String container = docker.runImage("debian", Arrays.asList("/bin/bash", "-c", "sleep 60")); + docker.killContainer(container); + } + + private static DockerCommand getWrapper() { + return DockerCommand.forCommand("docker", Duration.ofMillis(10000)); + } Review comment: <!--new_thread; commit:21a3ef1d6e9deb78705f7e006ab32e103101f6df; resolved:0--> Would be good to assert also that exceptions actually include the necessary output. ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 94359) Time Spent: 20h 10m (was: 20h) > Add abstractions to manage Environment Instance lifecycles. > ----------------------------------------------------------- > > Key: BEAM-3327 > URL: https://issues.apache.org/jira/browse/BEAM-3327 > Project: Beam > Issue Type: New Feature > Components: runner-core > Reporter: Thomas Groh > Assignee: Ben Sidhom > Priority: Major > Labels: portability > Time Spent: 20h 10m > Remaining Estimate: 0h > > This permits remote stage execution for arbitrary environments -- This message was sent by Atlassian JIRA (v7.6.3#76005)