[Anthill-pro] Is this a feature, a bug, or user error?
Ryan Smith
rws at urbancode.com
Thu May 22 14:07:44 CDT 2008
Peter,
We recognize that this is not ideally implemented right now and we have a developer making changes to it right now. When the change goes in, -1 will mean all the agents returned by the agent filter and not all agents in the environment. If any of the agents returned are offline, it will throw an exception. This should be available shortly.
Ryan Smith
Peter Steele wrote:
> I’ve simplified this case to help debug what’s going on. I created a
> simple secondary workflow that doesn’t really do anything other than run
> and exit. I have an agent filter called “FreeBSD” that simply matches
> any agent with os.name equal to “FreeBSD”. If I set the agent count to 1
> and run the workflow with this filter, it works fine, even if some
> agents are offline in the environment. However, if I set the agent count
> to -1, the job will not run if any agent in the environment is offline.
> I think this is the core of the problem in my original posting. So, how
> do I get around this problem? For example, how could I write a “FreeBSD”
> filter that would select all online agents, ignoring any that are offline?
>
>
>
> *From:* Peter Steele
> *Sent:* Thursday, May 22, 2008 7:43 AM
> *To:* 'rws at urbancode.com'; AnthillPro user and support list.
> *Subject:* RE: [Anthill-pro] Is this a feature, a bug, or user error?
>
>
>
> [I'm resending my reply to this since it apparently got rejected due to
> the attachment. I've moved the attachment to here
> <http://home.comcast.net/~pwsteele/deploy.jpg>. The original message
> follows:]
>
>
>
> The agent filter is set to "Scripted", pointing to the "All Agents From
> List" script I wrote, and the Agent Quantity field is set to -1. A user
> can select any number of agents out of the chosen environment on any
> given run of the deploy workflow. I've attached a sample launch screen.
> In this example, the user has selected "Rack 5" as the environment and
> further filtered the list of servers to populate to just three servers.
> The Rack 5 environment has over 20 servers in it. The problem is that
> the deploy script fails to pick any agents if even one of the agents in
> the selected environment is offline. In this example for instance the
> user has selected systems 2, 3, and 4. However, if some system other
> than these three was offline for some reason, the deploy script fails
> with Anthill reporting "Not all agents in server group Rack 5 were online."
>
>
>
> I've tested my script, and on input the agents array contains the list
> of currently online agents from the chosen environment, just as I'd
> assume. On output, the filtered list correctly contains the subset of
> agents the user specifies via the input field "agentNames". The job
> still fails to run if any of the full set of agents is offline. This
> will be a very likely scenario, especially with the large number of test
> servers we have. Is there a solution to this problem?
>
>
>
>
>
> -----Original Message-----
> From: anthill-pro-bounces at lists.urbancode.com
> [mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of Ryan Smith
> Sent: Wednesday, May 21, 2008 7:10 AM
> To: AnthillPro user and support list.
> Subject: Re: [Anthill-pro] Is this a feature, a bug, or user error?
>
>
>
> Peter,
>
>
>
> Is the user always selecting 5 agents and is the job going to run on
> each of those agents? On the agent filter of the job, what do you have
> the Agent Quantity set to?
>
>
>
>
>
> Ryan Smith
>
>
>
> Peter Steele wrote:
>
> > We’ve just come across a situation that may cause us problems down the
>
> > road. We’ve installed agents on a large number test servers, with the
>
> > intent that our daily builds will be deployed to these systems by
>
> > various engineers for testing purposes. These agents are grouped into
>
> > various environments based on who will be using the systems. For
>
> > example, we have an environment called “Rack 5” consisting of 20 agents
>
> > that are used by SQA engineers. A given SQA engineer signs out some
>
> > subset of the Rack 5 servers for doing whatever testing is planned. I’ve
>
> > written a secondary deploy workflow that the users run against a build
>
> > to install the software on the set of target servers assigned to each
>
> > user. To do this I wrote an agent filter called “All Agents From List”
>
> > that takes as input the list of agents that the user wants to select
>
> > from the indicated environment. This all works fine except for one
>
> > problem: if even one agent is offline when the workflow is run, Anthill
>
> > reports the error “Not all agents in server group Rack 5 were online.”
>
> > This is a reasonable error of course if one of the agents the user has
>
> > selected is offline. However, the error occurs even if one of the agents
>
> > not selected by the user is offline. For example, the user might select
>
> > systems 1-5 from environment Rack 5 to deploy the build on. If system 15
>
> > is currently offline though the secondary workflow does not run.
>
> >
>
> >
>
> >
>
> > So, is there a solution to this? I’ve included the agent filter I wrote
>
> > below to select the agents to install the build on. The input agent
>
> > array is the full list of servers in the environment, and the output is
>
> > the filtered list of agents that the user has entered via a field in the
>
> > GUI (property agentNames). How can we make Anthill consider only the
>
> > status of these selected systems instead of the whole environment?
>
> >
>
> >
>
> >
>
> > *import* com.urbancode.anthill3.domain.agent.Agent;
>
> > *import* com.urbancode.anthill3.runtime.scripting.helpers.*;
>
> >
>
> > Where anyWhere = new Where()
>
> > {
>
> > public Agent[] filter(Agent[] agents)
>
> > {
>
> > String agentNames =
>
> > BuildRequestLookup.getCurrent().getProperty("agentNames");
>
> > if (agentNames.equals("all")) return agents;
>
> >
>
> > List agentList = new ArrayList();
>
> > for (String agentName : (agentNames+",").split(","))
>
> > {
>
> > for (int i = 0; i < agents.length; i++)
>
> > {
>
> > if (agents[i].name.equals(agentName))
>
> > {
>
> > agentList.add(agents[i]);
>
> > break;
>
> > }
>
> > }
>
> > }
>
> > Agent[] selectedAgents = new Agent[agentList.size()];
>
> > for (int i = 0; i < selectedAgents.length; i++)
>
> > {
>
> > selectedAgents[i] = (Agent)agentList.get(i);
>
> > }
>
> >
>
> > return selectedAgents;
>
> > }
>
> > };
>
> >
>
> > return Where.is(anyWhere);
>
> >
>
> >
>
> >
>
> >
>
> > ------------------------------------------------------------------------
>
> >
>
> > _______________________________________________
>
> > Anthill-pro mailing list
>
> > Anthill-pro at lists.urbancode.com
>
> > http://lists.urbancode.com/mailman/listinfo/anthill-pro
>
>
>
> --
>
> ===========================================================
>
> Ryan Smith. 2044 Euclid Ave., Suite 600
>
> Developer Cleveland, Ohio 44115
>
> Urbancode, Inc.
>
> email: rws at urbancode.com
>
> web: www.urbancode.com phone: 216-858-9000
>
> web: www.anthillpro.com fax: 216-858-9602
>
> ===========================================================
>
> _______________________________________________
>
> Anthill-pro mailing list
>
> Anthill-pro at lists.urbancode.com
>
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>
--
===========================================================
Ryan Smith. 2044 Euclid Ave., Suite 600
Developer Cleveland, Ohio 44115
Urbancode, Inc.
email: rws at urbancode.com
web: www.urbancode.com phone: 216-858-9000
web: www.anthillpro.com fax: 216-858-9602
===========================================================
More information about the Anthill-pro
mailing list