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

JCLOUDS-1328 Update ProfitBricks to the latest API version #408

Closed

Conversation

alibazlamit
Copy link
Contributor

@nacx ProfitBricks is back with a few updates and new features, this PR adds two of the important new features.

There is also the User Management API but i wanted to check with you first if that is something we need to have, in my opinion that is a feature to skip LMKWYT.

@alibazlamit
Copy link
Contributor Author

@nacx Friendly reminder

@nacx
Copy link
Member

nacx commented Sep 4, 2017

Apologies for the late reply; I've been on vacation :)

Changes LGTM. Could you share the output of the live tests?

@alibazlamit
Copy link
Contributor Author

What do you think about the User Management AP, is it something that will be handy for the Compute API?

@nacx
Copy link
Member

nacx commented Sep 4, 2017

I don't think so. It makes more sense to work on the current feature set to have it stable enough so we can promote it. Having live tests passing consistently is more important than adding other features not directly covered by the compute abstraction.

@alibazlamit
Copy link
Contributor Author

These are the two affected live tests results, let me know if you need other test results.

Thanks

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest
Configuring TestNG with: TestNG652Configurator
Starting test testCreateLan(org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest)
[pool-1-thread-1] Test testCreateLan(org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest) succeeded: 4941ms
Test suite progress: tests succeeded: 1, failed: 0, skipped: 0.
Starting test testList(org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest)
Starting test testUpdateLan(org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest)
Starting test testGetLan(org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest)
[pool-1-thread-2] Test testGetLan(org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest) succeeded: 213ms
Test suite progress: tests succeeded: 2, failed: 0, skipped: 0.
[pool-1-thread-3] Test testList(org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest) succeeded: 581ms
Test suite progress: tests succeeded: 3, failed: 0, skipped: 0.
[pool-1-thread-4] Test testUpdateLan(org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest) succeeded: 45278ms
Test suite progress: tests succeeded: 4, failed: 0, skipped: 0.
Starting test testDeleteLan(org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest)
[pool-1-thread-5] Test testDeleteLan(org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest) succeeded: 6694ms
Test suite progress: tests succeeded: 5, failed: 0, skipped: 0.
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 85.844 sec - in org.apache.jclouds.profitbricks.rest.features.LanApiLiveTest

Results :

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

------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 1:58.353s
Finished at: Mon Sep 04 12:12:33 EEST 2017
Final Memory: 10M/146M
------------------------------------------------------------------------



-Dtest=org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest
Configuring TestNG with: TestNG652Configurator
Starting test testCreateVolume(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest)
[pool-1-thread-1] Test testCreateVolume(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest) succeeded: 109124ms
Test suite progress: tests succeeded: 1, failed: 0, skipped: 0.
Starting test testGetVolume(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest)
Starting test testList(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest)
[pool-1-thread-2] Test testGetVolume(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest) succeeded: 251ms
Test suite progress: tests succeeded: 2, failed: 0, skipped: 0.
Starting test testUpdateVolume(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest)
[pool-1-thread-3] Test testList(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest) succeeded: 545ms
Test suite progress: tests succeeded: 3, failed: 0, skipped: 0.
[pool-1-thread-4] Test testUpdateVolume(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest) succeeded: 4603ms
Test suite progress: tests succeeded: 4, failed: 0, skipped: 0.
Starting test testCreateSnapshot(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest)
[pool-1-thread-5] Test testCreateSnapshot(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest) succeeded: 107025ms
Test suite progress: tests succeeded: 5, failed: 0, skipped: 0.
Starting test testRestoreSnapshot(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest)
[pool-1-thread-5] Test testRestoreSnapshot(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest) succeeded: 194446ms
Test suite progress: tests succeeded: 6, failed: 0, skipped: 0.
Starting test testDeleteVolume(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest)
[pool-1-thread-5] Test testDeleteVolume(org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest) succeeded: 11251ms
Test suite progress: tests succeeded: 7, failed: 0, skipped: 0.
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 436.896 sec - in org.apache.jclouds.profitbricks.rest.features.VolumeApiLiveTest

Results :

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

------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 7:18.586s
Finished at: Mon Sep 04 12:21:11 EEST 2017
Final Memory: 11M/309M
------------------------------------------------------------------------```

@nacx
Copy link
Member

nacx commented Sep 4, 2017

All tests are relevant, since the endpoint has changed, and the API version has changed too. Could you share the results of running the entire live tests tuite?

@alibazlamit
Copy link
Contributor Author

Compute live tests now fail even for the upstream version, i think profitbricks stopped supporting Ubuntu 12 version.

I get the error below, is there anyway to set a default image template to something higher than ubuntu 12?

java.util.NoSuchElementException
	at org.jclouds.compute.domain.internal.TemplateBuilderImpl.throwNoSuchElementExceptionAfterLoggingImageIds(TemplateBuilderImpl.java:738)
	at org.jclouds.compute.domain.internal.TemplateBuilderImpl.findSupportedImages(TemplateBuilderImpl.java:709)
	at org.jclouds.compute.domain.internal.TemplateBuilderImpl.build(TemplateBuilderImpl.java:691)
	at org.jclouds.compute.domain.internal.TemplateBuilderImpl.build(TemplateBuilderImpl.java:660)
	at org.jclouds.compute.internal.BaseTemplateBuilderLiveTest.testCompareSizes(BaseTemplateBuilderLiveTest.java:55)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:696)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:882)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1189)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

@nacx
Copy link
Member

nacx commented Sep 5, 2017

Yes, you can configure the default template in the provider metadata. Take azurecompute-arm as an example. The syntax of that template string is defined by this class.

@alibazlamit
Copy link
Contributor Author

alibazlamit commented Sep 6, 2017

I ran into a problem when compute live test wants to ssh into servers, ProfitBricks changed something in their API, now the public linux images can't use a password to log in anymore. Only SSH keys for remote acess.

I assume the solution to this would be creating servers with sshKey instead of passwords if the os family is linux.

WDYT?

@nacx
Copy link
Member

nacx commented Sep 7, 2017

To let the tests use by default SSH based authentication, you could add the following method to the ProfitBricksComputeServiceLiveTest class:

@Override
protected TemplateBuilder templateBuilder() {
   TemplateOptions authOptions = TemplateOptions.Builder
      .authorizePublicKey(keyPair.get("public"))
      .overrideLoginPrivateKey(keyPair.get("private"));
   return super.templateBuilder().options(authOptions);
}

The keyPair variable is created in the base class and contains an auto-generated SSH key pair, to be used in the tests. With this method, the selected image will be configured by default to use SSh authentication using that key pair.

@alibazlamit
Copy link
Contributor Author

alibazlamit commented Sep 7, 2017

Thanks @nacx all tests passes now.

Test Results

@nacx
Copy link
Member

nacx commented Sep 7, 2017

That's great, thanks @alibazlamit! Mind squashing the commits so we can cleanly merge the PR?

@alibazlamit
Copy link
Contributor Author

Done

@nacx
Copy link
Member

nacx commented Sep 8, 2017

Pushed to master and 2.0.x. Thanks!

@nacx nacx closed this Sep 8, 2017
@nacx
Copy link
Member

nacx commented Sep 8, 2017

all tests passes now.

@alibazlamit have you executed them with any custom parameter? I've run them just providing the credentials and I get authentication failures.

@alibazlamit
Copy link
Contributor Author

@nacx nothing other than the credentials, are your credentials working fine?

@nacx
Copy link
Member

nacx commented Sep 12, 2017

I meant, auth failures when tests try to access the nodes. Credentials are working fine. Aren't you using a custom image?

@alibazlamit
Copy link
Contributor Author

No, i have just changed the default template to start from Ubuntu 14.04.
The only problem i had with logging into servers was if the server was created with a password only. ProfitBricks allows only SSH keys for Linux authentication.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants