great @nacx! Thanks again for your valuable reviews
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-48165987
Closed #57.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#event-138666393
Rebased and
[merged](https://git-wip-us.apache.org/repos/asf?p=jclouds-labs.git;a=commit;h=9b124ee9f12e0392b6d2f083308297bfcca8ea79).
Huge thanks @andreaturli!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-48159799
> +
> + if (templateOptions.getCommands().isPresent()) {
> + containerConfigBuilder.cmd(templateOptions.getCommands().get());
> + }
> +
> + if (templateOptions.getMemory().isPresent()) {
> + containerConfigBuilder.memory(templateOptions.getMemory().get());
> + }
[jclouds-labs-pull-requests
#205](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/205/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-47840689
[jclouds » jclouds-labs
#1258](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1258/)
SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pul
> + return this;
> + }
> +
> + public TemplateOptions commands(Iterable commands) {
> + for (String command : checkNotNull(commands, "commands"))
> + checkNotNull(command, "all commands must be non-empty");
> + this.commands = Optional.>
> of(ImmutableList.copyOf(command
> +
> + if (templateOptions.getCommands().isPresent()) {
> + containerConfigBuilder.cmd(templateOptions.getCommands().get());
> + }
> +
> + if (templateOptions.getMemory().isPresent()) {
> + containerConfigBuilder.memory(templateOptions.getMemory().get());
> + }
> + return this;
> + }
> +
> + public TemplateOptions commands(Iterable commands) {
> + for (String command : checkNotNull(commands, "commands"))
> + checkNotNull(command, "all commands must be non-empty");
> + this.commands = Optional.>
> of(ImmutableList.copyOf(command
[jclouds » jclouds-labs
#1244](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1244/)
SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pul
[jclouds-labs-pull-requests
#204](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/204/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-47683209
[jclouds » jclouds-labs
#1243](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1243/)
SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pul
[jclouds-labs-pull-requests
#203](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/203/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-47680678
[jclouds » jclouds-labs
#1242](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1242/)
UNSTABLE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/
[jclouds-labs-pull-requests
#202](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/202/)
UNSTABLE
Looks like there's a problem with this pull request
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-47677495
Here you can find the result of `mvn clean install -Plive`
https://gist.github.com/andreaturli/595ce6e44a987ed5be06
unfortunately there are still issue with the DockerComputeServiceLiveTest but I
think it is good to be accepted on jclouds-labs at least and fix liveTests
there, if you agree
---
[jclouds-labs-pull-requests
#184](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/184/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-47081238
[jclouds » jclouds-labs
#1208](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1208/)
SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pul
Thanks @andreaturli! All the points in the checklist have been addressed, and I
think it is almost ready to be merged. Could you address the last comments?
(Don't forget about [this
one](https://github.com/jclouds/jclouds-labs/pull/57/files#r14173875) and [this
one](https://github.com/jclouds/j
> +import org.jclouds.sshj.config.SshjSshClientModule;
> +import org.testng.annotations.AfterMethod;
> +import org.testng.annotations.BeforeMethod;
> +import org.testng.annotations.Test;
> +
> +import javax.annotation.Resource;
> +import javax.inject.Named;
> +import java.io.IOException;
> +import
> +
> +import com.google.common.io.CharStreams;
> +
> +@Test(groups = "unit", testName = "BindInputStreamToRequestTest")
> +public class BindInputStreamToRequestTest {
> +
> + @Test
> + public void testBindInputStreamToRequest() throws IOException {
> + BindInputStreamToRequest binder = ne
> +throw Throwables.propagate(e);
> + }
> + command.setException(exception);
> + }
> + }
> +
> + public String parseMessage(HttpResponse response) {
> + if (response.getPayload() == null)
> + return null;
> + try {
> + return Strings2.t
> + .hardware(new HardwareBuilder()
> + .id("")
> + .ram(container.getContainerConfig().getMemory())
> + .processor(new
> Processor(container.getContainerConfig().getCpuShares(),
> container.getContainerConfig().getCpuSha
> +
> + @Resource
> + @Named(ComputeServiceConstants.COMPUTE_LOGGER)
> + private Logger logger = Logger.NULL;
> + private final DockerApi api;
> + private final ListeningExecutorService userExecutor;
> + private final Predicate> imageAvailablePredicate;
> + private final ImageToImage
> +import org.jclouds.rest.Binder;
> +
> +import com.google.common.base.Throwables;
> +import com.google.common.io.Files;
> +
> +/**
> + * @author Andrea Turli
> + */
> +@Singleton
> +public class BindInputStreamToRequest implements Binder {
> +
> + @Resource
> + @Named(ComputeServiceConstants.
> + * 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.jclouds.docker;
> +##Components
> +
> +- jclouds \- acts as a java client to access to docker features
> +- DOCKER_HOST \- hosts Docker API, NB: jclouds-docker assumes that the
> latest Docker is installed
> +- Image \- it is a docker image that can be started.
> +- Node \- is a docker container
> +
> +## Assumpt
[jclouds » jclouds-labs
#1158](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1158/)
SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pul
[jclouds-labs-pull-requests
#176](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/176/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-45945836
[jclouds » jclouds-labs
#1150](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1150/)
SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pul
[jclouds-labs-pull-requests
#175](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/175/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-45648690
[jclouds-labs-pull-requests
#174](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/174/)
SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-45491046
[jclouds » jclouds-labs
#1139](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1139/)
SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pul
> + destroyNode(container.getId());
> + throw new IllegalStateException(String.format("Container %s has not
> started correctly", container.getId()));
> + }
> + return new NodeAndInitialCredentials(container,
> container.getId(),
> +
> LoginCredentials.buil
@andreaturli
I found several problems while trying to run a docker container (apache2) and
sent PR to your forked branch:
https://github.com/andreaturli/jclouds-labs/pull/2 WDYT?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-
Thanks all for the quick responses!
@andrewgaul
Yes Stopwatch constructor has been made private in com.google.guava 17.0.
That's the reason why I think we see this problem.
@andreaturli
I think I found the problem. I was able to build jclouds-labs master branch
without any problem therefore I
@imesh Thanks for your feedback.
That's odd because I can see
```
$ mvn dependency:tree|grep guava
[INFO] | \- com.google.guava:guava:jar:17.0:compile
```
and I can build jclouds docker master
Are you using jclouds-docker from another application as @andrewgaul was
guessing?
---
Reply to this
@imesh jclouds master branch uses Guava 17.0 which makes ```Stopwatch```
constructors private access. The jclouds dependency supersedes your
application dependency on an older version of Guava. You should update your
application dependency to 17.0 and address the Guava API changes and
depreca
@imesh @andreaturli It looks like an explicit dependency on Guava might be
required?
```XML
com.google.guava
guava
17.0
```
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-45006489
@andreaturli I just tried to build this pr but I get the following error: Any
thoughts?
jclouds-labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/CreateAndInstallVm.java:[109,29]
cannot find symbol
symbol : constructor Stopwatch()
location: class com.google.common.base.Stopwatch
-
@andreaturli would be nice to be able to set `Memory` and `CpuShares` in`
Config` from the template options.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-44749515
> + checkArgument(baseDir.isDirectory(), "%s is not a directory", baseDir);
> + File[] files = baseDir.listFiles();
> + File tarFile = new File(archivePath);
> +
> + String token = getLast(Splitter.on("/").split(archivePath.substring(0,
> archivePath.lastIndexOf("/";
> +
>
> + }
> +
> + @Override
> + public Iterable listLocations() {
> + return ImmutableSet.of();
> + }
> +
> + @Override
> + public Container getNode(String id) {
> + return api.getRemoteApi().inspectContainer(id);
> + }
> +
> + @Override
> + public void destroyNode(String id
Thanks for the detailed review, @nacx!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-44155452
> +*/
> + @Named("images:list")
> + @GET
> + @Path("/images/json")
> + @Fallback(Fallbacks.EmptySetOnNotFoundOr404.class)
> + Set listImages(ListImageOptions options);
> +
> + /**
> +* Inspect an image
> +*
> +* @param imageId The id of the image to inspect.
> +* @re
> +
> + @Inject
> + public DockerComputeServiceAdapter(DockerApi api) {
> + this.api = checkNotNull(api, "api");
> + }
> +
> + @Override
> + public NodeAndInitialCredentials
> createNodeWithGroupEncodedIntoName(String group, String name,
> +
> + }
> +
> + @Override
> + public Iterable listLocations() {
> + return ImmutableSet.of();
> + }
> +
> + @Override
> + public Container getNode(String id) {
> + return api.getRemoteApi().inspectContainer(id);
> + }
> +
> + @Override
> + public void destroyNode(String id
> + }
> +
> + @Override
> + public Iterable listLocations() {
> + return ImmutableSet.of();
> + }
> +
> + @Override
> + public Container getNode(String id) {
> + return api.getRemoteApi().inspectContainer(id);
> + }
> +
> + @Override
> + public void destroyNode(String id
> +
> + @Inject
> + public DockerComputeServiceAdapter(DockerApi api) {
> + this.api = checkNotNull(api, "api");
> + }
> +
> + @Override
> + public NodeAndInitialCredentials
> createNodeWithGroupEncodedIntoName(String group, String name,
> +
> + @SuppressWarnings("unchecked")
> + @Override
> + public R bindToRequest(R request, Object input) {
> + checkArgument(checkNotNull(input, "input") instanceof File, "this
> binder is only valid for File!");
> + checkNotNull(request, "request");
> +
> + File dockerFile = (Fi
> +
> + @Inject
> + public DockerComputeServiceAdapter(DockerApi api) {
> + this.api = checkNotNull(api, "api");
> + }
> +
> + @Override
> + public NodeAndInitialCredentials
> createNodeWithGroupEncodedIntoName(String group, String name,
> +
> + .id("")
> + .ram(container.getConfig().getMemory())
> + .processor(new
> Processor(container.getConfig().getCpuShares(),
> container.getConfig().getCpuShares()))
> + .build());
> + // TODO Set up location
> +
> builder.operatingSystem(OperatingSystem.builder().description("linux").family(OsFamily.LINUX).build());
> + return builder.build();
> + }
> +
> + private String cleanUpName(String name) {
> + return name.startsWith("/") ? name.substring(1) : name;
> + }
> +
> + private
> + .id("")
> + .ram(container.getConfig().getMemory())
> + .processor(new
> Processor(container.getConfig().getCpuShares(),
> container.getConfig().getCpuShares()))
> + .build());
> + // TODO Set up location
> + @SuppressWarnings("unchecked")
> + @Override
> + public R bindToRequest(R request, Object input) {
> + checkArgument(checkNotNull(input, "input") instanceof File, "this
> binder is only valid for File!");
> + checkNotNull(request, "request");
> +
> + File dockerFile = (Fi
> + checkArgument(baseDir.isDirectory(), "%s is not a directory", baseDir);
> + File[] files = baseDir.listFiles();
> + File tarFile = new File(archivePath);
> +
> + String token = getLast(Splitter.on("/").split(archivePath.substring(0,
> archivePath.lastIndexOf("/";
> +
>
Please run through Checkstyle.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57#issuecomment-43858507
> + }
> + assertRequestHasCommonFields(server.takeRequest(), "POST",
> "/build");
> + } finally {
> + dockerFile.deleteOnExit();
> + api.close();
> + server.shutdown();
> + }
> + }
> +
> + private File createDockerFile(String content) {
> +
Thanks for the contribution @andreaturli! I look forward to have this merged!
Next steps should be:
**General**
- [ ] Address all review comments.
- [ ] Make all constructors for the domain objects that have a builder
`protected`, to enforce the use of the builder.
- [ ] Run `mvn checkstyle:check
> + try {
> + remoteApi.deleteImage("1");
> + assertRequestHasCommonFields(server.takeRequest(), "DELETE",
> "/images/1");
> + } finally {
> + api.close();
> + server.shutdown();
> + }
> + }
> +
> + public void testDeleteNotExistingImage() throws
> + try {
> + remoteApi.stopContainer("1");
> + assertRequestHasCommonFields(server.takeRequest(), "POST",
> "/containers/1/stop");
> + } finally {
> + api.close();
> + server.shutdown();
> + }
> + }
> +
> + public void testStopNonExistingContaine
> + assertRequestHasParameters(server.takeRequest(), "POST",
> "/images/create", ImmutableMultimap.of("fromImage",
> + "base"));
> + } finally {
> + api.close();
> + server.shutdown();
> + }
> + }
> +
> + public void testCreateImageFailure() th
> + server.shutdown();
> + }
> + }
> +
> + public void testStartNonExistingContainer() throws Exception {
> + MockWebServer server = mockWebServer();
> + server.enqueue(new MockResponse().setResponseCode(204));
> + DockerApi api = api(server.getUrl("/"));
> + Re
> + remoteApi.removeContainer(containerId);
> + assertRequestHasCommonFields(server.takeRequest(), "DELETE",
> "/containers/"+containerId);
> + } finally {
> + api.close();
> + server.shutdown();
> + }
> + }
> +
> + public void testRemoveNonExistingCon
> +
> + DockerApi api = api(server.getUrl("/"));
> + RemoteApi remoteApi = api.getRemoteApi();
> +
> + String content = new String(payloadFromResource("/Dockerfile"));
> + File dockerFile = createDockerFile(content);
> + try {
> + try {
> +remoteApi.buil
> + MockWebServer server = mockWebServer();
> + server.enqueue(new
> MockResponse().setBody(payloadFromResource("/container-creation.json")));
> +
> + DockerApi api = api(server.getUrl("/"));
> + RemoteApi remoteApi = api.getRemoteApi();
> + Config config = Config.builder(
> + dockerFile.deleteOnExit();
> + api.close();
> + server.shutdown();
> + }
> + }
> +
> + private File createDockerFile(String content) {
> + File newTempDir = Files.createTempDir();
> + File dockerFile = new File(newTempDir + "/dockerFile");
> + try
> + String content = new String(payloadFromResource("/Dockerfile"));
> + File dockerFile = createDockerFile(content);
> + try {
> + try {
> +remoteApi.build(dockerFile, BuildOptions.NONE);
> +fail("Build container should fail on 404");
> + } ca
> + public void testListContainers() throws Exception {
> + MockWebServer server = mockWebServer();
> + server.enqueue(new
> MockResponse().setBody(payloadFromResource("/containers.json")));
> +
> + DockerApi api = api(server.getUrl("/"));
> + RemoteApi remoteApi = api.getRem
> + MockWebServer server = mockWebServer();
> + server.enqueue(new
> MockResponse().setBody(payloadFromResource("/containers.json")));
> +
> + DockerApi api = api(server.getUrl("/"));
> + RemoteApi remoteApi = api.getRemoteApi();
> +
> + try {
> + Set containers =
> + assertNull(api().inspectImage(image.getId()));
> + }
> +
> + @Test(dependsOnMethods = "testDeleteImage")
> + public void testBuildImage() throws IOException, InterruptedException,
> URISyntaxException {
> + BuildOptions options =
> BuildOptions.Builder.tag("testBuildImage").ve
> + public void testVersion() {
> + Assert.assertEquals(api().getVersion().getVersion(), "0.9.0");
> + }
> +
> + @Test(dependsOnMethods = "testVersion")
> + public void testCreateImage() throws IOException, InterruptedException {
> + CreateImageOptions options =
> CreateImageOpti
> + public void testVersion() {
> + Assert.assertEquals(api().getVersion().getVersion(), "0.9.0");
> + }
> +
> + @Test(dependsOnMethods = "testVersion")
> + public void testCreateImage() throws IOException, InterruptedException {
> + CreateImageOptions options =
> CreateImageOpti
> +import org.testng.annotations.Test;
> +
> +import javax.annotation.Resource;
> +import javax.inject.Named;
> +import java.io.IOException;
> +import java.util.Map;
> +import java.util.Set;
> +
> +import static org.testng.Assert.assertEquals;
> +import static org.testng.Assert.assertTrue;
> +
> +/
> + return result;
> + }
> +
> + protected Payload createPayload() throws IOException {
> + String folderPath = System.getProperty("user.dir") +
> "/docker/src/test/resources";
> + File parentDir = new File(folderPath + "/archive");
> + parentDir.mkdirs();
> + URL url
> + public NodeMetadata apply(Container container) {
> + String name = cleanUpName(container.getName());
> + String group = nodeNamingConvention.extractGroup(name);
> + NodeMetadataBuilder builder = new NodeMetadataBuilder();
> + builder.ids(container.getId())
> +
> + * 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.jclouds.docker.options;
> +
> +import org.jclouds.http.options.BaseHttpRequestOptions;
> + private final String gateway;
> + @SerializedName("Bridge")
> + private final String bridge;
> + @SerializedName("PortMapping")
> + private final String portMapping;
> + @SerializedName("Ports")
> + private final Map>> ports;
> +
> + @ConstructorProperties({ "IpAddress", "IpPref
> + @SerializedName("Binds")
> + private final List binds;
> + @SerializedName("Privileged")
> + private final boolean privileged;
> + @SerializedName("PortBindings")
> + private final Map>> portBindings;
> + @SerializedName("Links")
> + private final List links;
> + @SerializedNa
> +import java.util.Set;
> +
> +import static com.google.common.base.Preconditions.checkNotNull;
> +
> +/**
> + * @author Andrea Turli
> + */
> +public class ExposedPorts {
> +
> + private final String portAndProtocol;
> + private final Set hostPorts;
> +
> + @ConstructorProperties({ "PortAnd
> +
> +import com.google.common.base.Objects;
> +import com.google.common.collect.ImmutableSet;
> +
> +import java.beans.ConstructorProperties;
> +import java.util.Set;
> +
> +import static com.google.common.base.Preconditions.checkNotNull;
> +
> +/**
> + * @author Andrea Turli
> + */
> +public cla
> +String image, NetworkSettings networkSettings, String
> resolvConfPath,
> +String driver, String execDriver, Map
> volumes, Map volumesRW,
> +String command, String status, HostConfig hostConfig,
> List ports) {
> + this.id = c
> + this.created = checkNotNull(created, "created");
> + this.path = checkNotNull(path, "path");
> + this.args = checkNotNull(args, "args");
> + this.config = checkNotNull(config, "config");
> + this.state = checkNotNull(state, "state");
> + this.image = checkNotNull(i
> +String driver, String execDriver, Map
> volumes, Map volumesRW,
> +String command, String status, HostConfig hostConfig,
> List ports) {
> + this.id = checkNotNull(id, "id");
> + this.name = checkNotNull(name, "name");
> + this.created = c
> + this.user = user;
> + this.memory = checkNotNull(memory, "memory");
> + this.memorySwap = checkNotNull(memorySwap, "memorySwap");
> + this.cpuShares = checkNotNull(cpuShares, "cpuShares");
> + this.attachStdin = checkNotNull(attachStdin, "attachStdin");
> + this.at
> + }
> +
> + @Override
> + public Iterable listLocations() {
> + return ImmutableSet.of();
> + }
> +
> + @Override
> + public Container getNode(String id) {
> + return api.getRemoteApi().inspectContainer(id);
> + }
> +
> + @Override
> + public void destroyNode(String id
> + //return api.getRemoteApi().listImages();
> + Set images = Sets.newHashSet();
> + for (Image image : api.getRemoteApi().listImages()) {
> + // less efficient than just listNodes but returns richer json that
> needs repoTags coming from listImages
> + Image inspec
> + }, null);
> + }
> +
> + @Override
> + public Iterable listNodes() {
> + Set containers = Sets.newHashSet();
> + for (Container container : api.getRemoteApi().listContainers()) {
> + // less efficient than just listNodes but returns richer json
> +
> contain
> + }
> +
> + @Override
> + public Iterable listHardwareProfiles() {
> + Set hardware = Sets.newLinkedHashSet();
> + // todo they are only placeholders at the moment
> + hardware.add(new
> HardwareBuilder().ids("micro").hypervisor("lxc").name("micro").ram(512).build());
> +
> + destroyNode(container.getId());
> + throw new IllegalStateException(String.format("Container %s has not
> started correctly", container.getId()));
> + }
> + return new NodeAndInitialCredentials(container,
> container.getId(),
> +
> LoginCredentials.buil
> +
> + @Inject
> + public DockerComputeServiceAdapter(DockerApi api) {
> + this.api = checkNotNull(api, "api");
> + }
> +
> + @Override
> + public NodeAndInitialCredentials
> createNodeWithGroupEncodedIntoName(String group, String name,
> +
> +
> +import com.google.common.base.Objects;
> +import com.google.common.base.Optional;
> +import com.google.common.collect.ImmutableMap;
> +
> +/**
> + * Contains options supported in the {@code ComputeService#runNode}
> operation on the
> + * "docker" provider. Usage The recommended way to inst
> +import org.jclouds.compute.options.TemplateOptions;
> +import org.jclouds.domain.LoginCredentials;
> +import org.jclouds.scriptbuilder.domain.Statement;
> +
> +import com.google.common.base.Objects;
> +import com.google.common.base.Optional;
> +import com.google.common.collect.ImmutableMap;
> +
> +/**
> + * @author Andrea Turli
> + */
> +public class ImageToImage implements
> Function {
> +
> + private static final String CENTOS = "centos";
> + private static final String UBUNTU = "ubuntu";
> +
> + @Resource
> + @Named(ComputeServiceConstants.COMPUTE_LOGGER)
> + protected Logge
> + }
> +
> + private Iterable getPrivateIpAddresses(Container container) {
> + if (container.getNetworkSettings() == null) return ImmutableList.of();
> + return ImmutableList.of(container.getNetworkSettings().getIpAddress());
> + }
> +
> + private List getPublicIpAddresses() {
>
> +
> builder.operatingSystem(OperatingSystem.builder().description("linux").family(OsFamily.LINUX).build());
> + return builder.build();
> + }
> +
> + private String cleanUpName(String name) {
> + return name.startsWith("/") ? name.substring(1) : name;
> + }
> +
> + private
> @@ -0,0 +1,275 @@
> +/*
The entire `features` package must be moved outside the `compute` one.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57/files#r12936907
> + checkArgument(baseDir.isDirectory(), "%s is not a directory", baseDir);
> + File[] files = baseDir.listFiles();
> + File tarFile = new File(archivePath);
> +
> + String token = getLast(Splitter.on("/").split(archivePath.substring(0,
> archivePath.lastIndexOf("/";
> +
>
> + .id("")
> + .ram(container.getConfig().getMemory())
> + .processor(new
> Processor(container.getConfig().getCpuShares(),
> container.getConfig().getCpuShares()))
> + .build());
> + // TODO Set up location
> + TarArchiveEntry tarEntry = new TarArchiveEntry(file);
> + tarEntry.setName("/" +
> getLast(Splitter.on(token).split(file.toString(;
> + tos.putArchiveEntry(tarEntry);
> + if (!file.isDirectory()) {
> +FileInputStream fin = new FileInputStream(fil
1 - 100 of 184 matches
Mail list logo