Teamcity with 3 build agents

I am trying to get teamcity to work with 3 build agents. I can start the 3 agents and make them work in teamcity. I have configured each agent to use its own work and temp dir, have its own port and name. The first "stage" of a build happens in the directories set for that particular agent (say /opt/teamcity/agent1/work etc.), but later on the agents insist on using /opt/teamcity/buildagent/work etc.) where buildagent is the default agent. Even if that agent doesn't exist and I remove that directory, it will be recreated.

The result of this is that when agents work parallel they will start overwriting eachother's files and cause errors. I would like to know how to make the agents totally use their own directories. I must be overlooking something really obvious, but I have yet been unable, with the aid of the documentation to find out what I did wrong.

Thank you for any help.

7 comments

Hello kroshka,

What os do you use?
What distribution of TeamCity server do you use? And how do you start TeamCity?
What version of TeamCity?

Please check is /buildagent folder exists on you machine, if so, please have a look ot /buildagent/conf/buildagent.properties Could you please submit all ']]>/conf/buildagent.properties' files from
your agents.

How do you start agents? From what folder?

Thanks!

--
Eugene Petrenko
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I am trying to get teamcity to work with 3 build agents. I can start
the 3 agents and make them work in teamcity. I have configured each
agent to use its own work and temp dir, have its own port and name.
The first "stage" of a build happens in the directories set for that
particular agent (say /opt/teamcity/agent1/work etc.), but later on
the agents insist on using /opt/teamcity/buildagent/work etc.) where
buildagent is the default agent. Even if that agent doesn't exist and
I remove that directory, it will be recreated.

The result of this is that when agents work parallel they will start
overwriting eachother's files and cause errors. I would like to know
how to make the agents totally use their own directories. I must be
overlooking something really obvious, but I have yet been unable, with
the aid of the documentation to find out what I did wrong.

Thank you for any help.



0

Thanks for your reply. Sorry for not giving all details.

What os do you use?


Linux debian etch.

What distribution of TeamCity server do you use? And


TeamCity Version 2.1.1(build 4261)

how do you start TeamCity?


In the rc.local init script, basically /root/scripts/teamcity_start.sh
And teamcity_start.sh reads:
#!/bin/sh
source /root/.bashrc
/opt/TeamCity/bin/runAll.sh start

What version of TeamCity?


See above I think?

Please check is <teamcity>/buildagent folder exists
on you machine, if so,
lease have a look ot
<teamcity>/buildagent/conf/buildagent.properties
Could you please submit all
'<agent>/conf/buildagent.properties' files from
our agents.


I left out the comments.

/opt/TeamCity/buildAgent/conf/buildAgent.properties:
name=Default agent1
ownPort=9090
serverUrl=http://localhost/
workDir=/opt/TeamCity/buildAgent/work
tempDir=/opt/TeamCity/buildAgent/temp

/opt/TeamCity/buildAgent2/conf/buildAgent.properties:
name=Default agent2
ownPort=9091
serverUrl=http://localhost/
workDir=/opt/TeamCity/buildAgent2/work
tempDir=/opt/TeamCity/buildAgent2/temp

/opt/TeamCity/buildAgent3/conf/buildAgent.properties:
name=Default agent3
ownPort=9092
serverUrl=http://localhost/
workDir=/opt/TeamCity/buildAgent3/work
tempDir=/opt/TeamCity/buildAgent3/temp

How do you start agents? From what folder?


I start them as root like this:
/opt/TeamCity/buildAgent/bin/agent.sh start
Although when the server reboots it would be started in runAll.sh like this:
cd /opt/TeamCity/buildAgent/bin
./agent.sh $1

Would the problem be that I do not cd into /opt/TeamCity/buildAgent/bin when I start them by hand?

I did try and have an agent running under its own username (agent2) and have another agent running as stated above. So 2 in total, but agent2 will still start working with the directories in /opt/TeamCity/buildAgent/ after a while.

Thank you

0

I am still stuck with this and was wondering if anyone could point me to a possible solution.

0

It's not much help, but it should work. I have a similar setup and it
is working fine. I actually use the same binary directories and just
have different $CONFIG_FILE and $LOG_DIR per agent env variables, plus
different config files, but I have never seen the symptoms that you are
describing.
Sorry,
R

0

Hello kroshka,

Several improvements of agents scripts has been done.
I have tried to reprocude your problem by the following steps:
1. unzip buildagent.zip 3 times to 3 different folders
2. for each agent create ]]>/conf/buildAgent.properties file. Simply
copy buildAgent.dist.properties and change build agent's name
3. for each agent cd to it's bin folder, chmod agent.sh and call agent.sh
start
4. Open web interface and authorize my new agents

Does it works for you?

Is works even if to start agent.sh from any directory

--
Eugene Petrenko
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I am still stuck with this and was wondering if anyone could point me
to a possible solution.



0

Thanks for your reply.

I have tried to reprocude your problem by the
following steps:
4. Open web interface and authorize my new agents
does it works for you?
Is works even if to start agent.sh from any directory


It works in the way that I can start all 3 agents and have them do whatever they need to do. The problem is that at some point they'll start overwriting eachother's stuff in a standard default directory, as opposed to the directories configured in their config file.

Each agent will do a build run of a version of the source and will work in its designated folders. Later on the agents will start working from a default folder, if more than one happens to do that at the same time they will overwrite things and may error complaining files are missing. It might be tricky to reproduce. It is also possible some variable in Teamcity has been incorrectly configured, but I do not know what that could be.

0

Hi,

No idea what the problem can be with TC 2.1.1, but please try TeamCity 3.0 released recently. If you'll still encounter the problems, please file a Jira issue and provide as much details as possible, project configuration files, logs, etc.

Regards,
KIR

0

Please sign in to leave a comment.