How does the vcs cache work?

Hi,

I'm currently evaluating TeamCity 5.0 and I have a question regarding VCS caching.  We use an externally hosted Subversion server and I have to be mindful of source pulls since the archives can be quite large.  I have read the documentation and a couple posts regarding the two checkout modes.  I'd like to understand the VCS behavior of TeamCity better.

1. Does the cache have any pruning behavior or are all VCS roots cached forever?  
2. I couldn't find any .svn directories on the server anywhere, where does the server keep the cache?  
3. When I combine checkout mode 'on server' and Clean all files before build, what happens?  My assumption is it just runs an svn update on the server in the cache directory, deletes everything on the build agent and then transfers the working copy from the server to the agent.  Is that correct?
4. Do the build agents keep the sources they've used forever, or is there a pruning behavior?

Any help understanding how TeamCity works is greatly appreciated.

Thanks,
-Nelson Wolf

3 comments
Comment actions Permalink

TeamCity caches clean patches only, i.e full source tree exports from VCS repository. The key of the cached entry is VCS root settings + checkout rules. There is no automated cache cleaning procedure at the moment, however the whole cache can be cleaned by "Enforce clean checkout" action available in the build configuration actions menu.

Cached patches are stored in TeamCity own format and since these are exports, there won't be any .svn or CVS directories. Patches are in the .BuildServer/system/caches/sources directory. Note that some VCSs maintain their own caches, in particular this is true for Git & Mercurial.

> 3. When I combine checkout mode 'on server' and Clean all files before build, what happens?  My assumption is it just runs an svn update on the server in the cache directory, deletes
> everything on the build agent and then transfers the working copy from the server to the agent.  Is that correct?

If there is no  cached clean patch on the server, TeamCity performs export from VCS and stores patch in the system/caches/sources directory. Then patch is transferred to an agent. Another agent asked for the sources from the same VCS root will be given this patch + one more incremental patch if agent asks for later revision.

> 4. Do the build agents keep the sources they've used forever, or is there a pruning behavior?

Agents keep sources until disk space reaches some limit (configurable via system property), after that agent will try to prune some rarely used working copies. Read more here: http://www.jetbrains.net/confluence/display/TCD5/Build+Checkout+Directory (see "Automatic checkout directory cleaning" section).

More on checkout modes: http://www.jetbrains.net/confluence/display/TCD5/VCS+Checkout+Mode

0
Comment actions Permalink

Hi Pavel,

That is very useful information, thank you.

I have found and am testing the Swabra plugin.  I believe it gives me the functionality I'm looking for, which is to cache files on the server, but give the effect of a fresh checkout by deleting modified and unversioned.  I found another post that said it wasn't going to be packaged with 5.0 because it wasn't quite ready.  Is there a ETA when it will be considered stable?

Thanks,
-Nelson

0
Comment actions Permalink

The plugin still needs some testing and if it will become necessary part of TeamCity for our users we will bundle it. So far we need more feedback to make a decision.

0

Please sign in to leave a comment.