aboutsummaryrefslogtreecommitdiffstats
path: root/docker-api
diff options
context:
space:
mode:
authorValerij Fredriksen <valerijf@oath.com>2018-03-01 09:25:13 +0100
committerValerij Fredriksen <valerijf@oath.com>2018-03-01 09:25:13 +0100
commitdf358608e3b15b12e49ebb93eef8b990b0700d87 (patch)
tree9b2b0d1b14e5b4ab65f758870cff34c2b8a4c027 /docker-api
parentbc3ccdb3552d0d3ff5dcc463308614e72e6abd3e (diff)
Remove unused methods
Diffstat (limited to 'docker-api')
-rw-r--r--docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/Docker.java7
-rw-r--r--docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java31
2 files changed, 4 insertions, 34 deletions
diff --git a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/Docker.java b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/Docker.java
index 04d4628d576..331779fb81c 100644
--- a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/Docker.java
+++ b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/Docker.java
@@ -1,7 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.dockerapi;
-import java.io.File;
import java.net.InetAddress;
import java.util.List;
import java.util.Map;
@@ -61,8 +60,6 @@ public interface Docker {
void connectContainerToNetwork(ContainerName containerName, String networkName);
- void copyArchiveToContainer(String sourcePath, ContainerName destinationContainer, String destinationPath);
-
List<Container> getAllContainersManagedBy(String manager);
List<ContainerName> listAllContainersManagedBy(String manager);
@@ -80,15 +77,13 @@ public interface Docker {
void deleteImage(DockerImage dockerImage);
- void buildImage(File dockerfile, DockerImage dockerImage);
-
/**
* Deletes the local images that are currently not in use by any container and not recently used.
*/
void deleteUnusedDockerImages();
/**
- * Execute a command in docker container as "yahoo". Will block until the command is finished.
+ * Execute a command in docker container as $VESPA_USER. Will block until the command is finished.
*
* @param containerName The name of the container
* @param command The command with arguments to run.
diff --git a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java
index 2da18e12e40..5facbc7104e 100644
--- a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java
+++ b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/DockerImpl.java
@@ -18,18 +18,17 @@ import com.github.dockerjava.core.DefaultDockerClientConfig;
import com.github.dockerjava.core.DockerClientConfig;
import com.github.dockerjava.core.DockerClientImpl;
import com.github.dockerjava.core.async.ResultCallbackTemplate;
-import com.github.dockerjava.core.command.BuildImageResultCallback;
import com.github.dockerjava.core.command.ExecStartResultCallback;
import com.github.dockerjava.core.command.PullImageResultCallback;
import com.github.dockerjava.jaxrs.JerseyDockerCmdExecFactory;
import com.google.inject.Inject;
+import com.yahoo.log.LogLevel;
import com.yahoo.vespa.hosted.dockerapi.metrics.CounterWrapper;
import com.yahoo.vespa.hosted.dockerapi.metrics.Dimensions;
import com.yahoo.vespa.hosted.dockerapi.metrics.MetricReceiverWrapper;
import javax.annotation.concurrent.GuardedBy;
import java.io.ByteArrayOutputStream;
-import java.io.File;
import java.io.IOException;
import java.net.Inet6Address;
import java.net.InetAddress;
@@ -68,8 +67,7 @@ public class DockerImpl implements Docker {
@GuardedBy("monitor")
private final Set<DockerImage> scheduledPulls = new HashSet<>();
- // Exposed for testing.
- DockerClient dockerClient;
+ private DockerClient dockerClient;
@Inject
public DockerImpl(DockerConfig config, MetricReceiverWrapper metricReceiverWrapper) {
@@ -145,18 +143,6 @@ public class DockerImpl implements Docker {
}
@Override
- public void copyArchiveToContainer(String sourcePath, ContainerName destinationContainer, String destinationPath) {
- try {
- dockerClient.copyArchiveToContainerCmd(destinationContainer.asString())
- .withHostResource(sourcePath).withRemotePath(destinationPath).exec();
- } catch (RuntimeException e) {
- numberOfDockerDaemonFails.add();
- throw new DockerException("Failed to copy container " + sourcePath + " to " +
- destinationContainer + ":" + destinationPath, e);
- }
- }
-
- @Override
public boolean pullImageAsyncIfNeeded(final DockerImage image) {
try {
synchronized (monitor) {
@@ -434,17 +420,6 @@ public class DockerImpl implements Docker {
}
@Override
- public void buildImage(File dockerfile, DockerImage image) {
- try {
- dockerClient.buildImageCmd(dockerfile).withTags(Collections.singleton(image.asString()))
- .exec(new BuildImageResultCallback()).awaitImageId();
- } catch (RuntimeException e) {
- numberOfDockerDaemonFails.add();
- throw new DockerException("Failed to build image " + image.asString(), e);
- }
- }
-
- @Override
public void deleteUnusedDockerImages() {
if (!dockerImageGC.isPresent()) return;
@@ -464,7 +439,7 @@ public class DockerImpl implements Docker {
@Override
public void onError(Throwable throwable) {
removeScheduledPoll(dockerImage);
- throw new DockerClientException("Could not download image: " + dockerImage);
+ logger.log(LogLevel.ERROR, "Could not download image " + dockerImage.asString(), throwable);
}