Skip to content
This repository has been archived by the owner on Jul 25, 2020. It is now read-only.

Vagrant provider #160

Closed
wants to merge 1 commit into from
Closed

Vagrant provider #160

wants to merge 1 commit into from

Conversation

neykov
Copy link
Member

@neykov neykov commented Apr 2, 2015

Implements ComputeServiceAdapter for Vagrant.

How to use:

  • install virtualbox
  • install vagrant
  • download a vagrant box: vagrant box add ubuntu/trusty64
  • create a template using the box: compute.templateBuilder().imageId("ubuntu/trusty64").build();
  • create nodes with the template

The machines in a single group will be created as a multi-machine config in vagrant.

Uses https://github.com/neykov/vagrant-java-bindings to drive vagrant.

@nacx
Copy link
Member

nacx commented Apr 8, 2015

Thanks @neykov!
So this seems to be useful to manage local boxes, as Vagrant does not have an API. Unlike other providers, the jclouds code will deploy nodes int he same machine where the code runs, instead of deploying them in a target provider/api/endpoint.
With my limited experience with vagrant, I'd say the implementation is quite simple (which is good), and has a good structure, so it is a good starting point!
Out of curiosity, which is the use case for this, or how are you using it?

@neykov
Copy link
Member Author

neykov commented Apr 9, 2015

As suggested by @andreaturli remote support could be added with the help of https://github.com/fjsanpedro/vagrant-node, but local is where vagrant is most useful.
I am mostly using it through the Apache Brooklyn project while developing/testing, when I don't want to wait for remote cloud machines to spin up.

@neykov neykov force-pushed the vagrant branch 2 times, most recently from 0217443 to 4329f93 Compare March 6, 2016 19:24
@neykov
Copy link
Member Author

neykov commented Mar 6, 2016

Added live tests and missing functionality. I've been using the provider the whole time since creating it and it's been working great. Good to review.

@neykov
Copy link
Member Author

neykov commented Mar 29, 2016

bump @nacx, @andreaturli
Let me know if anything else needed for a review.

@neykov
Copy link
Member Author

neykov commented Mar 29, 2016

A couple of unit tests missing, but will be easy to add if everything else is good to go.

@nacx
Copy link
Member

nacx commented Mar 30, 2016

Thanks @neykov! Looking at it, the bindings just run the required vagrant commands, so there is no actual API exposed by vagrant, right? In that case I'd say ti is OK for us to add the bindings dependency (given it has no transitive dependencies), but we can't rely on a snapshot version that is not publicly available. We can only depend on fixed versions that are available in Maven Central, so this would be the first thing to address.

@neykov neykov force-pushed the vagrant branch 2 times, most recently from 1d7e6ac to 2ebedbc Compare September 27, 2016 06:39
@neykov
Copy link
Member Author

neykov commented Sep 27, 2016

@nacx There's no vagrant API, so it's using the cli under the hood. It's possible to install a plugin which exposes an API, but since the provider makes most sense when used locally better not introduce another abstraction layer (and add extra setup steps for users).

I've updated the dependency to a released version (no transitive dependencies there) and rebased. Live tests are passing.

@neykov neykov force-pushed the vagrant branch 4 times, most recently from 36389c3 to b463c65 Compare September 28, 2016 06:46
@neykov
Copy link
Member Author

neykov commented Dec 10, 2016

Hi @nacx. Bumped version to 2.1.0-SNAPSHOT.
What work would be needed to get this merged into labs?

@nacx
Copy link
Member

nacx commented Dec 12, 2016

My apologies @neykov. This pull request got lost in my review queue. I'll review it later today and make sure we move forward with this.

Copy link
Member

@nacx nacx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @neykov! I've reviewed the PR and added my comments.

* `git clone https://github.com/neykov/jclouds-vagrant`
* `cd jclouds-vagrant/vagrant`
* `mvn clean install`
* Copy `target/vagrant-2.0.0-SNAPSHOT.jar` to jcloud's classpath
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this. The bindings are in Maven Central and the project can be build just as any other jclouds provider.

<packaging>bundle</packaging>

<properties>
<jclouds.version>2.1.0-SNAPSHOT</jclouds.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this and use project.parent.version consistently for all dependencies.

import org.jclouds.compute.config.ComputeServiceProperties;
import org.jclouds.vagrant.config.VagrantComputeServiceContextModule;

public class VagrantApiMetadata extends BaseApiMetadata {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the auto-service dependency:

<dependency>
  <groupId>com.google.auto.service</groupId>
  <artifactId>auto-service</artifactId>
  <scope>provided</scope>
</dependency>

And annotate this as @AutoService(ApiMetadata.class).

public class VagrantComputeServiceAdapter implements ComputeServiceAdapter<VagrantNode, Hardware, Box, Location> {
private File nodeContainer;
// TODO FIXME - use just as cache, expire items
private static Map<String, VagrantNode> machines = new HashMap<String, VagrantNode>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a proper Guava LoadingCache then?

import vagrant.api.domain.SshConfig;

public class VagrantComputeServiceAdapter implements ComputeServiceAdapter<VagrantNode, Hardware, Box, Location> {
private File nodeContainer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be final?

}

@Override
@Test(enabled = false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like in the other tests, better leave it enabled, but doing nothing.

assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getHardware().getName(), "micro");
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test class is used to make sure jclouds is up to date with the Image offering of the providers. Given that this works only for local images, it does not really make sense to have this test class.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean this particular test or the class altogether?
Seems there are useful tests in there that still apply to this provider. For example all of the testAuto* methods. I think it's worth keeping it.


public class BoxToImageTest {

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implement the tests.


public class MachineStateToJcloudsStatusTest {

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.


public class MachineToNodeMetadataTest {

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@neykov
Copy link
Member Author

neykov commented Dec 13, 2016

Thanks for taking the time to go through the code. Will implement the changes and get back to you.

@andreaturli
Copy link
Contributor

thx @neykov, sorry for being late in this discussion.

Just thinking aloud, would it be acceptable for you to donate the https://github.com/neykov/vagrant-java-bindings to jclouds as well? I'm seeing it as a maven submodule of jclouds-vagrant which is completely in sync with the jclouds-vagrant requirements. @neykov @nacx wdyt?

* `mvn clean install`
* Copy `target/vagrant-2.0.0-SNAPSHOT.jar` to jcloud's classpath

Using in Apache Brooklyn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is pretty standard, not sure it needs to be in this README, wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The catch is that Vagrant doesn't have credential and identity, while Brooklyn requires them. Setting any values will do, but it needs to be there.
Agree it's too user specific, so here's probably not the best place to put it.
Let's keep it around for some more time until moved to a better place.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed now.

Local caching proxy
-------------------

### Polipo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super-useful, thanks!


Use `polipo` for caching proxy. On OS X install with
```
sudo brew install polipo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it require sudo?


* `sudo chown root:wheel /Library/LaunchDaemons/fr.jussieu.pps.polipo.plist`
* `sudo chmod 755 /Library/LaunchDaemons/fr.jussieu.pps.polipo.plist`
* `sudo launchctl -w load /Library/LaunchDaemons/fr.jussieu.pps.polipo.plist`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which os x version have you tested these notes ? I get

$ sudo launchctl -w load /Library/LaunchDaemons/fr.jussieu.pps.polipo.plist
Unrecognized subcommand: -w
Usage: launchctl <subcommand> ... | help [subcommand]
Many subcommands take a target specifier that refers to a domain or service

using macOS 10.12.1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's sudo launchctl load -w - updated the README and suggested a change in the linked SO answer.


Download a Vagrant box:
```
vagrant box add ubuntu/trustry64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be useful to reference this issue Varying-Vagrant-Vagrants/VVV#354 as I'm hitting it :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually sudo rm /opt/vagrant/embedded/bin/curl doesn't help for me. can you double-check?

Copy link
Member Author

@neykov neykov Dec 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's core vagrant functionality. If box add doesn't work, then there's something broken in your vagrant install.

Some things to try:

  • running it with --debug at the end - any giveaways there?
  • does it fail with any box or just ubuntu/trusty64?
  • what's in your ~/.vagrant.d/boxes folder?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried with debug, not much more there, it fails only with ubuntu/trusty64 so it is probably my setup. thanks for checking

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one could be related as well - hashicorp/vagrant#7997

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possibly in my case it was a combination of the above and a previously downloaded ubuntu/trusty64 on my machine, thx

@neykov
Copy link
Member Author

neykov commented Dec 29, 2016

Addressed all comments I haven't replied directly to. Also a lot of improvements all around the board.

@neykov
Copy link
Member Author

neykov commented Dec 29, 2016

@andreaturli Don't mind moving the project under the jclouds umbrella. What I'd like though is to keep it self-contained without any additional dependencies like guice, guava or jclouds logging. That's to allow anyone using it without pulling in jclouds dependencies.
Don't think that would fit with the dev/support model of jclouds, wdyt?

@nacx
Copy link
Member

nacx commented Dec 29, 2016

What I'd like though is to keep it self-contained without any additional dependencies like guice, guava or jclouds logging. That's to allow anyone using it without pulling in jclouds dependencies.
Don't think that would fit with the dev/support model of jclouds, wdyt?

There are no issues for keeping a the non-dependency approach (I love that!). However, if we want the project to be part of jclouds we should stick to some conventions (such as using the jclouds logging). jclouds is about portability, and that not only refers to implement some interfaces, but also to having common ways and patterns to configure stuff and operate. jclouds users should "feel" they use consistent APIs that follow a concrete set of principles, not that jclouds is a "grouping" of random libraries.

With this considerations in mind, I'd say it is better to keep the project as an external dependency, if you prefer to keep it as-is.

@neykov
Copy link
Member Author

neykov commented Dec 30, 2016

Fully agree @nacx, that was my point as well.

If you prefer to avoid the additional dependency I can bring in just the bits that are needed for the jclouds provider?

@nacx
Copy link
Member

nacx commented Jan 3, 2017

If you prefer to avoid the additional dependency I can bring in just the bits that are needed for the jclouds provider?

Your call :) I don't have a special issue with this dependency, because it does not add any transitive dependencies that conflict in how jclouds works. We usually recommend not adding dependencies because that often leads to use existing api clients instead of following the jclouds mechanisms, but I'd say it is OK to have dependencies like this one. It is important to note, however, that is is easier to keep things under control if they are in the jclouds source tree (for example if future versions of your library add other dependencies or change behaviour, etc). But your call :)

@neykov
Copy link
Member Author

neykov commented Jan 4, 2017

thanks @nacx and @andreaturli for your opinions - here's what I'll end up doing then:

  • keep the vagrant-java-binding dependency - this will allow others to use it without pulling in jclouds dependencies
  • abstract the access to the library in the provider so it can be switched at any time
  • in the the case that the dependency becomes a liability let's pull in the bits that are needed in jclouds

@nacx
Copy link
Member

nacx commented Jan 5, 2017

Sounds like a plan! Thanks!

@neykov
Copy link
Member Author

neykov commented Jan 9, 2017

I've abstracted away the access to vagrant - it's all in VagrantCliProvider now.

Copy link
Member

@nacx nacx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new approach; it is much clean. I've just added a small comment and I think once done we can start thinking about merging it.
Do you have an example live test output, so we can see the state of the actual implementation?

static class VagrantCliFacade implements VagrantApiFacade<Box> {

private final VagrantApi vagrant;
private final VagrantOutputRecorder outputRecorder;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Function interface is not the best one to create instances of VagrantCliFacade. What about Guice assisted inject? This is how this is done in jclouds, and having a factory instead of a function makes more sense in this case.

public class VagrantCliFacade implements VagrantApiFacade<Box> {
   interface Factory {
      VagrantCliFacade create(File path);
   }

   private final VagrantApi vagrant;
   private final VagrantOutputRecorder outputRecorder;
   
   @Inject
   VagrantCliFacade(VagrantWireLogger wireLogger, @Assisted File path) {
      this.outputRecorder = new VagrantOutputRecorder(wireLogger);
      this.vagrant = Vagrant.forPath(path, outputRecorder);
   }
   ...
}

Then just add the following to the VagrantComputeServiceContextModule:

 install(new FactoryModuleBuilder().build(VagrantCliFacade.Factory.class));

And now you can inject the VagrantCliFacade.Factory object to the compute service adapter, and call its create method where needed to produce the facade.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree a factory would be better suited. That's a nice trick, I've implemented it.

@neykov
Copy link
Member Author

neykov commented Jan 9, 2017

Here's an example output from a test run:

$ mvn clean install -Plive -Dtest=UbuntuXenialLiveTest#testGet
...
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.jclouds.vagrant.compute.UbuntuXenialLiveTest
Configuring TestNG with: TestNG652Configurator
I 09, 2017 9:20:42 PM org.jclouds.vagrant.compute.VagrantComputeServiceAdapterLiveTest setupProperties
INFO: Home for ubuntu/xenial64 at /Users/svet/.jclouds/vagrant/tests/ubuntu_xenial64
I 09, 2017 9:20:43 PM org.jclouds.vagrant.compute.VagrantComputeServiceAdapterLiveTest setupProperties
INFO: Home for ubuntu/xenial64 at /Users/svet/.jclouds/vagrant/tests/ubuntu_xenial64
Starting test testGet(org.jclouds.vagrant.compute.UbuntuXenialLiveTest)
2017-01-09 21:20:44,370 DEBUG [jclouds.wire] [user thread 0] << "[vagrant, up, e7e, --machine-readable]"
2017-01-09 21:20:45,790 DEBUG [jclouds.wire] [user thread 0] >> "1483989645,e7e,metadata,provider,virtualbox[\n]"
2017-01-09 21:20:45,868 DEBUG [jclouds.wire] [user thread 0] >> "1483989645,,ui,info,Bringing machine 'e7e' up with 'virtualbox' provider...[\n]"
2017-01-09 21:20:45,874 DEBUG [jclouds.wire] [user thread 0] >> "1483989645,e7e,action,up,start[\n]"
2017-01-09 21:20:46,302 DEBUG [jclouds.wire] [user thread 0] >> "1483989646,e7e,ui,info,==> e7e: Cloning VM...[\n]"
2017-01-09 21:20:46,527 DEBUG [jclouds.wire] [user thread 0] >> "1483989646,e7e,ui,info,==> e7e: Matching MAC address for NAT networking...[\n]"
2017-01-09 21:20:47,071 DEBUG [jclouds.wire] [user thread 0] >> "1483989647,e7e,ui,info,==> e7e: Setting the name of the VM: vagrant-_e7e_1483989647028_57915[\n]"
2017-01-09 21:20:48,250 DEBUG [jclouds.wire] [user thread 0] >> "1483989648,e7e,ui,info,==> e7e: Clearing any previously set network interfaces...[\n]"
2017-01-09 21:20:48,458 DEBUG [jclouds.wire] [user thread 0] >> "1483989648,e7e,ui,output,==> e7e: Preparing network interfaces based on configuration...[\n]"
2017-01-09 21:20:48,459 DEBUG [jclouds.wire] [user thread 0] >> "1483989648,e7e,ui,detail,    e7e: Adapter 1: nat[\n]"
2017-01-09 21:20:48,459 DEBUG [jclouds.wire] [user thread 0] >> "1483989648,e7e,ui,detail,    e7e: Adapter 2: hostonly[\n]"
2017-01-09 21:20:48,503 DEBUG [jclouds.wire] [user thread 0] >> "1483989648,e7e,ui,output,==> e7e: Forwarding ports...[\n]"
2017-01-09 21:20:48,566 DEBUG [jclouds.wire] [user thread 0] >> "1483989648,e7e,ui,detail,    e7e: 22 (guest) => 2222 (host) (adapter 1)[\n]"
2017-01-09 21:20:48,688 DEBUG [jclouds.wire] [user thread 0] >> "1483989648,e7e,ui,info,==> e7e: Running 'pre-boot' VM customizations...[\n]"
2017-01-09 21:20:48,936 DEBUG [jclouds.wire] [user thread 0] >> "1483989648,e7e,ui,info,==> e7e: Booting VM...[\n]"
2017-01-09 21:20:49,137 DEBUG [jclouds.wire] [user thread 0] >> "1483989649,e7e,ui,output,==> e7e: Waiting for machine to boot. This may take a few minutes...[\n]"
2017-01-09 21:20:49,370 DEBUG [jclouds.wire] [user thread 0] >> "1483989649,e7e,ui,detail,    e7e: SSH address: 127.0.0.1:2222[\n]"
2017-01-09 21:20:49,370 DEBUG [jclouds.wire] [user thread 0] >> "1483989649,e7e,ui,detail,    e7e: SSH username: ubuntu[\n]"
2017-01-09 21:20:49,370 DEBUG [jclouds.wire] [user thread 0] >> "1483989649,e7e,ui,detail,    e7e: SSH auth method: password[\n]"
2017-01-09 21:21:41,779 DEBUG [jclouds.wire] [user thread 0] >> "1483989701,e7e,ui,detail,    e7e: Warning: Remote connection disconnect. Retrying...[\n]"
2017-01-09 21:21:44,967 DEBUG [jclouds.wire] [user thread 0] >> "1483989704,e7e,ui,detail,    e7e: Warning: Authentication failure. Retrying...[\n]"
2017-01-09 21:21:46,693 DEBUG [jclouds.wire] [user thread 0] >> "1483989706,e7e,ui,detail,    e7e: \n    e7e: Inserting generated public key within guest...[\n]"
2017-01-09 21:21:46,791 DEBUG [jclouds.wire] [user thread 0] >> "1483989706,e7e,ui,detail,    e7e: Removing insecure key from the guest if it's present...[\n]"
2017-01-09 21:21:46,885 DEBUG [jclouds.wire] [user thread 0] >> "1483989706,e7e,ui,detail,    e7e: Key inserted! Disconnecting and reconnecting using new SSH key...[\n]"
2017-01-09 21:21:48,316 DEBUG [jclouds.wire] [user thread 0] >> "1483989708,e7e,ui,output,==> e7e: Machine booted and ready![\n]"
2017-01-09 21:21:48,317 DEBUG [jclouds.wire] [user thread 0] >> "1483989708,e7e,ui,output,==> e7e: Checking for guest additions in VM...[\n]"
2017-01-09 21:21:48,425 DEBUG [jclouds.wire] [user thread 0] >> "1483989708,e7e,ui,info,==> e7e: Configuring and enabling network interfaces...[\n]"
2017-01-09 21:21:48,623 DEBUG [jclouds.wire] [user thread 0] >> "1483989708,e7e,ui,info,==> e7e: Configuring proxy for Apt...[\n]"
2017-01-09 21:21:48,811 DEBUG [jclouds.wire] [user thread 0] >> "1483989708,e7e,ui,info,==> e7e: Configuring proxy environment variables...[\n]"
2017-01-09 21:21:49,236 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,ui,info,==> e7e: Running provisioner: shell...[\n]"
2017-01-09 21:21:49,404 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,ui,detail,    e7e: Running: inline script[\n]"
2017-01-09 21:21:49,419 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,ui,info,==> e7e: mesg: [\n]"
2017-01-09 21:21:49,419 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,ui,info,==> e7e: ttyname failed[\n]"
2017-01-09 21:21:49,419 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,ui,info,==> e7e: : [\n]"
2017-01-09 21:21:49,420 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,ui,info,==> e7e: Inappropriate ioctl for device[\n]"
2017-01-09 21:21:49,421 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,ui,info,==> e7e: ================= Networks start =================[\n]"
2017-01-09 21:21:49,421 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,ui,info,==> e7e:     inet 10.0.2.15/24 brd 10.0.2.255 scope global enp0s3\n==> e7e:     inet 172.28.128.3/24 brd 172.28.128.255 scope global enp0s8[\n]"
2017-01-09 21:21:49,422 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,ui,info,==> e7e: ================= Networks end ===================\n==> e7e: ================= Hostname start ==========================[\n]"
2017-01-09 21:21:49,422 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,ui,info,==> e7e: ubuntu-xenial[\n]"
2017-01-09 21:21:49,422 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,ui,info,==> e7e: ================= Hostname end ============================[\n]"
2017-01-09 21:21:49,573 DEBUG [jclouds.wire] [user thread 0] >> "1483989709,e7e,action,up,end[\n]"
[TestNG] Test testGet(org.jclouds.vagrant.compute.UbuntuXenialLiveTest) succeeded: 68572ms
Test suite progress: tests succeeded: 1, failed: 0, skipped: 0.
2017-01-09 21:21:55,851 DEBUG [org.jclouds.vagrant.compute.VagrantComputeServiceAdapter] [user thread 0] Deleting machine vagrant-/e7e
2017-01-09 21:21:55,851 DEBUG [org.jclouds.vagrant.compute.VagrantComputeServiceAdapter] [user thread 0] Machine vagrant-/e7e is last in group, deleting Vagrant folder /Users/svet/.jclouds/vagrant/tests/ubuntu_xenial64/vagrant-
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 74.278 sec - in org.jclouds.vagrant.compute.UbuntuXenialLiveTest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

protected TemplateBuilder templateBuilder() {
return super.templateBuilder()
.imageId(getImageId());
}
Copy link
Member

@nacx nacx Jan 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just seen this. Instead of hardcoding the fact that you want to use a custom image to run the tests, use the existing "jclouds.template" property. If you use that property, you can safely remove this method and the "getImage" one.

You can configure a default value in the pom.xml (like in digitalocean2 for example), and run the tests with -Dtest.vagrant.template="imageId=foo/bar". This will keep the tests aligned with the rest of the providers.

@nacx
Copy link
Member

nacx commented Jan 9, 2017

Here's an example output from a test run

Can you share the results of running the entire UbuntuXenialLiveTest class, not just one method? (without the wire logs, I'm just interested in seeing which tests pass and which ones fail). That class is the contract of our ComputeService interface. We need them passing to be confident that the provider properly implements the interface and meets the portability expectations of the compute abstraction.

It is not a merge-blocker If many of them fail, but we need them passing if we want to promote the provider out of labs.

@neykov
Copy link
Member Author

neykov commented Jan 10, 2017

https://paste.apache.org/vdES

Tests run: 28, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1,651.118 sec - in org.jclouds.vagrant.compute.UbuntuXenialLiveTest

@nacx
Copy link
Member

nacx commented Jan 12, 2017

Thanks! Mind squashing the commits into a single one to make the merge cleaner? I'll have a final look then and merge the PR. Thanks!

@neykov neykov force-pushed the vagrant branch 2 times, most recently from 55c1fcd to 6e48429 Compare January 13, 2017 18:10
@neykov
Copy link
Member Author

neykov commented Jan 13, 2017

Happy to hear that @nacx. Squashed.

@nacx
Copy link
Member

nacx commented Jan 25, 2017

Thanks for all the effort @neykov! Pushed to master and 2.0.x.

@nacx nacx closed this Jan 25, 2017
@andreaturli
Copy link
Contributor

YAY! congrats @neykov!

Thanks @nacx for the great review!

@neykov
Copy link
Member Author

neykov commented Jan 25, 2017

🎉 thanks @nacx @andreaturli.

@neykov neykov deleted the vagrant branch January 25, 2017 10:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants