8000 Improved the agent demand calculation logic. by tamizhgeek · Pull Request #3 · indix/gocd-mesos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improved the agent demand calculation logic. #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tamizhgeek
Copy link
Contributor

A new agent is launched only when all of the below are true:

  1. The scheduled pending jobs should be either positive or constantly greater than 1, for last 5 times.
  2. The idle agents in the server should be 0.

@Sriram-R @ashwanthkumar

A new agent is launched only when all of the above are true:
1. The scheduled pending jobs should be either positive or constantly greater than 1, for last 5 times.
2. The idle agents in the server should be 0.
@@ -28,19 +52,48 @@ case class GOCDPoller(conf: FrameworkConfig) {
}

def goIdleAgentsCount() = {
println("Polling Go server for idle agents")
try {
val responseJson = jsonRequest(buildUrl() + "/go/api/agents")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tamizhgeek I know the api.go.cd response says this is the schema of the response, but can you quickly check the same on our servers? Our main build is running the latest 16.2.0. They look different actually. We might want to file a bug against it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashwanthkumar The difference in the responses are because of the Accept header we send. The difference is this:

curl -X GET http://build.gocd.io/go/api/agents -H "Authorization: Basic asdadsadasdasd="

and

curl -X GET http://build.gocd.io/go/api/agents -H "Authorization: Basic adsdasdasda=" -H "Accept: application/vnd.go.cd.v1+json"

:)

@ashwanthkumar
Copy link
Member

Some questions (pardon my ignorance)

  • From the set of changes, we don't seem to be doing Environment(s) and Resource(s) based scaling up.
  • Also we don't seem to be downscaling the agents.
    Are these features already present?

responseHistory += scheduled

}
if(responseHistory.size > 5) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would really like the 5 number (scheduledJobs > 5) to be a configuration :)

@tamizhgeek
Copy link
Contributor Author

@ashwanthkumar Yeah. We don't do any downscaling as of now. Also the agents are not launched specific to environment/resources. They are TODO stuff.

1. The scalar runs in a thread instead of the poller and supports scale down and scaleup.
2. The agents are remembered using a unique UUID after launch. This helps to find the agents launched by us vs other systems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0