Skip to content

Commit

Permalink
Merge pull request #14 from JWGmeligMeyling/spotify-client
Browse files Browse the repository at this point in the history
Spotify Docker client for Build Manager
  • Loading branch information
michaeldejong committed Apr 20, 2015
2 parents db87e2b + 85f12ff commit e6ed44d
Show file tree
Hide file tree
Showing 41 changed files with 664 additions and 1,535 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ build-models/.settings

build-server/target/
build-server/.settings
.DS_Store
.idea/
*.iml
6 changes: 6 additions & 0 deletions build-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>${resteasy.version}</version>
<exclusions>
<exclusion>
<artifactId>slf4j-simple</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>nl.tudelft.ewi.build</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public class BuildRequest {

private String callbackUrl;

private int timeout;
private Integer timeout;

}
21 changes: 21 additions & 0 deletions build-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
</dependency>

<!-- Utilities -->

<dependency>
<groupId>com.spotify</groupId>
<artifactId>docker-client</artifactId>
<version>2.7.19</version>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
Expand All @@ -44,6 +50,21 @@
<artifactId>jtar</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-guice</artifactId>
<version>${resteasy.version}</version>
<exclusions>
<exclusion>
<artifactId>slf4j-simple</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>httpclient</artifactId>
<groupId>org.apache.httpcomponents</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.inject.AbstractModule;
import com.spotify.docker.client.DefaultDockerClient;
import com.spotify.docker.client.DockerClient;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import nl.tudelft.ewi.build.docker.DockerManager;
import nl.tudelft.ewi.build.docker.DockerManagerImpl;
import nl.tudelft.ewi.build.jaxrs.json.MappingModule;

import org.jboss.resteasy.plugins.guice.ext.JaxrsModule;
import org.jboss.resteasy.plugins.guice.ext.RequestScopeModule;
import org.reflections.Reflections;
Expand All @@ -25,6 +28,7 @@ public BuildServerModule(Config config) {
}

@Override
@SneakyThrows
protected void configure() {
install(new RequestScopeModule());
install(new JaxrsModule());
Expand All @@ -39,7 +43,9 @@ public ObjectMapper get() {
}
});

bind(DockerManager.class).to(DockerManagerImpl.class);
bind(DockerClient.class).toInstance(DefaultDockerClient.fromEnv()
.readTimeoutMillis(DefaultDockerClient.NO_TIMEOUT)
.build());

findResourcesWith(Path.class);
findResourcesWith(Provider.class);
Expand Down
2 changes: 0 additions & 2 deletions build-server/src/main/java/nl/tudelft/ewi/build/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ public interface Config {

int getMaximumConcurrentJobs();

String getDockerHost();

String getStagingDirectory();

String getWorkingDirectory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ public int getMaximumConcurrentJobs() {
return Integer.parseInt(properties.getProperty("docker.max-containers"));
}

public String getDockerHost() {
return properties.getProperty("docker.host", "http://localhost:4243");
}

public String getStagingDirectory() {
return properties.getProperty("docker.staging-directory");
}
Expand Down
18 changes: 0 additions & 18 deletions build-server/src/main/java/nl/tudelft/ewi/build/SimpleConfig.java

This file was deleted.

Loading

0 comments on commit e6ed44d

Please sign in to comment.