Share /opt/TeamCity/work betwen teamcity agents

Here’s your text in English:

Hello everyone. I have one TeamCity server with three agents. I have a few projects (PHP, Node.js) with build configurations and templates.

When I change the branch, for example, I need to check out the code from this branch on all agents, and this takes time for the build process. Would it be a good idea to share the /opt/TeamCity/work directory via NFS between all agents to save build time and disk space?

Any ideas are welcome.

0
4 comments
Hi,

We strongly recommend against (https://www.jetbrains.com/help/teamcity/build-checkout-directory.html#Custom+checkout+directory) having multiple agents sharing the same `work` directory since agents are not aware of each other and may be interfering with each other.

Best regards,
Anton
0

Hello Anton Vakhtel 

Thank you very much for your answer – it was useful and clear.

What do you think about sharing checkout directories between agents? In my build process, there is no situation where two agents build the same subprojects.

Have a great day!

0
As per the docs I've shared:

Make sure the following conditions (for checkout directories) are satisfied:
• the checkout directory is not shared between build configurations with different VCS settings (otherwise, TeamCity will perform clean checkout (https://www.jetbrains.com/help/teamcity/clean-checkout.html) each time another build configuration is built in the directory);
• the content of the directory is not modified by processes other than those of a single TeamCity agent (otherwise, TeamCity might be unable to ensure consistent incremental sources update). If this cannot be eliminated, make sure to turn on the clean build checkout option for all the participating build configurations. This rule also applies to two TeamCity agents sharing the same working directory. As one TeamCity agent has no knowledge of another, the other agent appears as an external process to it.

So generally speaking, you can share the same checkout directory, but you need to ensure that only one build agent is accessing it at a time.

Best regards,
Anton
0

Hello again  Anton Vakhtel 

Thank you very much for your fast and clear answer. 

Have a great day.

0

Please sign in to leave a comment.