Hi,
I’m trying to understand the repository sync mechanism from Server to Agent.
How I thought it would work
The Server monitors external repositories and updates its local repositories in [Server storage]\Rc[Repository ID]. When a build starts and the Agent is determined, the relevant Continua (Mercurial) repositories are synced from the Server to the Agent (I guess using some hg pull mechanism). Each agent has a similar storage location on [Agent storage (CI_WS)]\Repos[Repository ID]. The Agent then can retrieve source files from its local cache during any build action/step. This is efficient because DVCS are built for this purpose and subsequent builds should start immediately without repository sync, or at least, only new changesets are sent from Server to Agent.
How it appears to work
Subsequent builds take some time to start, even when nothing or little has changes in a repository. We do have a large (Subversion) repository and if used in a build, each build’s “Server To Agent Workspace Sync” would take at least one minute. When enabling “Log repository files copied”, it appears that all source files for this repository’s branch are copied from Server to Agent. When restarting the build, the same files are copied, even though no files have changed (e.g. no new changesets have been added to the branch since the last build).
A few questions come to mind:
- What’s the purpose of the local Agent repository cache [Agent storage (CI_WS)]\Repos[Repository ID] ? When looking at the Repository Sync log, I’d conclude it’s not being used, or otherwise it’s not being updated in an efficient way.
- Wouldn’t it be more efficient to have the Agent sync it’s Mercurial repository with the server (e.g. pull all new changes from all (or relevant/required) branches) instead of copying all source files each time?
I’m probably overlooking something here (wouldn’t be surprised) but I’m interested in how it works and should work. We’re sometimes stuggling with the repository sync mechanism and during analysis of some issues I encountered this one.
Kind regards,Remko Seelig