-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
:)
Some questions (pardon my ignorance)
|
responseHistory += scheduled | ||
|
||
} | ||
if(responseHistory.size > 5) { |
There was a problem hiding this comment.
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 :)
@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.
A new agent is launched only when all of the below are true:
@Sriram-R @ashwanthkumar