TeamCity + Amazon EC2
I'd really like to utilize Amazon's EC2 service for building all my services. What would be involved in writing a plugin for TeamCity that would dynamically send requests to the EC2 APIs to start remote VMs (which would in turn start an agent that checks in for work)?
I think the key is that the plugin would need to monitor the queue length and make decisions about how many VMs are needed based on the queue size and frequency.
Please sign in to leave a comment.
I have absolutely no idea how to do it, but I must say that the idea of having TeamCity automatically spin up build agents in Amazon's cloud just tickles me. Very cool concept. Basically, you end would end up with a "build fog", which automatically utilizes as many build machines as it would need, and bills you based on usage at the end of the month. Perfect for startups. Excellent. Good luck.
--Dave Griffith
Check out http://info.rightscale.com/
Regards,
--Venkat.
Venkat,
As cool as Rightscale is, I don't see anything that specifically has to do w/ my question.
Pat,
Using EC2 for the TeamCity build fog (as Dave named it) is a wonderful idea.
From the TeamCity part, this seems to be possible. The plugin can look into the build queue ( jetbrains.buildServer.serverSide.BuildQueue interface) to determine when new agents are needed, then start the new VM with appropriate environment. It is up to VM to ensure each new agent will get a unique name. When new agent connects, it should be authorized to get the builds. This can also be done within the plugin, while can need some enhancements to the TeamCity open API.
There are also some issues that probably need to be resolved, like: ability to preserve build directories on the agent so that next time the agent starts clean checkout is not required; ability to handle several types of VMs to add agents with the environment needed for the builds in the queue; for automatic agent's authorizing, a good way to tell friendly agents from possible alien ones, etc, etc.
Do not hesitate to contact us if you have any questions regarding TeamCity open API or plugin abilities.
--
Best regards,
Yegor Yarko
Quality Assurance Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
I can add that we already experimenting with agent virtualization.
Our current goals are reduction of agent pool maintenance cost, ability
to change pool configuration on demand etc. Although now we are
targeting not EC2 but our internal build farm this two options have much
in common.
We are not yet planning to release this functionality but will gradually
enhance our APIs to ease such integration.
We plan to share our experience and are very interested in other.
--
Alexey Gopachenko
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
I tried building my own plugin, but I can't even find the openApi-xxx.jar file that is referenced in the documentation. I found openApi-help.jar (javadocs) and openApi-sources.jar (source code), but no actual compiled jar. I did fine openapi.jar in the webapp's WEB-INF/lib directory, but that looks like it's the IntelliJ IDEA API, not the TeamCity one.
Where is the actual binaries I can compile against?
Pat,
There is more then single jar (webapps\ROOT\WEB-INF\lib\server-openapi.jar) that is needed to use TeamCity openAPI. Please add all the jars in the directory ]]>\webapps\ROOT\WEB-INF\lib as dependencies for your project.
Please also find attached a sample IntelliJ IDEA project that can be used as a starting point for plugin development. We plan to provide this sample plugin as part of our distribution. Please let us know if you find any discrepancies in it.
--
Best regards,
Yegor Yarko
Quality Assurance Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Attachment(s):
samplePlugin.zip
Hi Yegor,
An eclipse sample project would be great too! :>
Scott
This is a very old thread, but I'm wondering if anyone has had any luck with a plugin for TeamCity that would automatically spin up agents at Amazon?
Thanks,
-c
How about at least starting back up instances that shutdown because of being idle for too long? It seems like this is a manual thing at the moment that if a build triggers via a vcs checkin that if the ec2 instance is down it should start up and run the build. Has anyone been able to do this?
Yes, see http://teamcity.jetbrains.net
Jason, you may create 2 profiles for amazon. One profile should contain longer idle time and a limit of 1 running machine (this would be backup agent's account). The second account is the same account with ordinary timeout. Please feel free to post an issue for us on that as http://youtrack.jetbrains.net
Please see (and vote?) for this http://youtrack.jetbrains.net/issue/TW-13620
Thanks Eugene,
I created a ticket here:
http://youtrack.jetbrains.net/issue/TW-13700
and also voted yes for other issue you linked.