Managing agents in the cloud?

I have a set of integration tests that I run on a virtual machine. When the tests are complete, the machine is polluted, e.g. it would take longer to restore the machine to its initial conditions then it would to simply deploy a fresh copy.

I have configured team city to work within this paradigm by writing a script that does the following when a build is triggered.

·         Deploy the VM

·         SSH into the VM

o   Pull the code

o   Run the tests

·         Undeploy the VM

The agent controlling this runs on the team city machine. The “real build” is running on the VM which exists only for the duration of the test. The build output for this is really just a copy of the SSH log. I would rather have TeamCity process the build output directly as it does when the build is run by the real agent and not "proxied" thorugh SSH.

What I would prefer to do is deploy a VM that contains an agent that can be used only once. I thought about using the agent push feature in TC 6.5 however I was unable to locate an API for it. If an agent push scenario could be implemented, the SSH step described above would be replaced  by an agent push step followed by a wait until completion prior to unregistering, undeploying, deploying new, and registering a new agent.

An alternative possibility might be to implement a BuildServerListener that  could unregister and my VM when it had comleted a build, and deploy/register a new VM to be ready for the next invocation.

Does anyone out there have any thoughts on how one might best manage agents in a virtual environment such as I have described?

 

Thanks,

 

Michael Ottati

 

 

 

2 comments
Comment actions Permalink

Michael,

What virtualization platform do you use?
have you seen our VMware plugin?

0
Comment actions Permalink

I came across this today. The Google Compute Engine cloud agent plugin allows you to tick an option "After first build" that uses each instance for one build only, I believe.

https://blog.jetbrains.com/teamcity/2017/06/run-teamcity-ci-builds-in-google-cloud/

0

Please sign in to leave a comment.