brooklyncentral / brooklyn

This project has moved and is now part of the ASF
https://github.com/apache/incubator-brooklyn
72 stars 27 forks source link

Server pool entity #1480

Closed sjcorbett closed 10 years ago

sjcorbett commented 10 years ago

A basic implementation of an entity whose locations can be reused by other applications. Inspiration taken from @grkvlt's work on brooklyn-docker and brooklyn-cloud.

Comments:

buildhive commented 10 years ago

Brooklyn Central » brooklyn #2522 SUCCESS This pull request looks good (what's this?)

grkvlt commented 10 years ago

@sjcorbett You could use something like the DockerHost entity for each machine. Rename it to MachineEntity and keep the CPU time, memory and uptime sensors, add an effector to run shell commands, and that would probably do.

buildhive commented 10 years ago

Brooklyn Central » brooklyn #2530 FAILURE Looks like there's a problem with this pull request (what's this?)

sjcorbett commented 10 years ago

The test failed because of an authentication issue SSHing to localhost:

brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at Application[Nk6MTB96]
    at net.schmizz.sshj.userauth.UserAuthImpl.authenticate(UserAuthImpl.java:114)
    at net.schmizz.sshj.SSHClient.auth(SSHClient.java:205)
    at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:305)
    at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:353)
    at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:283)
    at brooklyn.util.internal.ssh.sshj.SshjClientConnection.create(SshjClientConnection.java:191)
    at brooklyn.util.internal.ssh.sshj.SshjClientConnection.create(SshjClientConnection.java:1)
    at brooklyn.util.internal.ssh.sshj.SshjTool.acquire(SshjTool.java:363)
    at brooklyn.util.internal.ssh.sshj.SshjTool.connect(SshjTool.java:179)
    at brooklyn.location.basic.SshMachineLocation.connectSsh(SshMachineLocation.java:475)
    ...

@grkvlt Is this normally an issue? Should the test be marked @Integration?

sjcorbett commented 10 years ago

Thinking about it more, the tests can just use the original EmptySoftwareProcess can't they.

buildhive commented 10 years ago

Brooklyn Central » brooklyn #2536 FAILURE Looks like there's a problem with this pull request (what's this?)

aledsage commented 10 years ago

Looks really good - a few comments; happy for this to be merged once you've been through those.

grkvlt commented 10 years ago

@aledsage @sjcorbett What about brooklyn.entity.machine as a package? Or just leave in .pool? since I can still extend it in the Clocker code easily enough.

grkvlt commented 10 years ago

@sjcorbett I wanted to try out MachineEntity in my code immediately, so I made some changes and pushed them to a branch on my fork. If you fetch them, you can cherry-pick commit a9f2cca007ed0b6ec071286e86ebbee9f011bb32 here:

sjcorbett commented 10 years ago

Thanks for the thorough comments. Think I've addressed them all.

buildhive commented 10 years ago

Brooklyn Central » brooklyn #2541 SUCCESS This pull request looks good (what's this?)

grkvlt commented 10 years ago

I am going to transfer this pull request to https://github.com/apache/incubator-brooklyn