-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement Job Scheduler logic #103
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Not functional yet
Not functional yet
…dexer-plugins into 65-job-scheduler-research
AlexRuiz7
force-pushed
the
87-implement-job-schduler-logic
branch
from
October 14, 2024 16:26
d2d8680
to
7f03e48
Compare
Applies Spotless
Signed-off-by: Álex Ruiz <[email protected]>
AlexRuiz7
approved these changes
Dec 4, 2024
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.
Commands sent to the API are indexed.
Details
{
"took": 8,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 5,
"relation": "eq"
},
"max_score": 1,
"hits": [
{
"_index": ".commands",
"_id": "SklIkpMBrdRQWmVi5DGO",
"_score": 1,
"_source": {
"agent": {
"groups": [
"groups000"
]
},
"command": {
"source": "Engine",
"user": "user53",
"target": {
"type": "agent",
"id": "target4"
},
"action": {
"name": "restart",
"args": [
"/path/to/executable/arg6",
"/path/to/executable/arg6"
],
"version": "v4"
},
"timeout": 30,
"status": "PENDING",
"order_id": "QUlIkpMBrdRQWmVi5DGO",
"request_id": "QElIkpMBrdRQWmVi5DGO"
},
"@timestamp": "2024-12-04T15:27:50Z",
"delivery_timestamp": "2024-12-04T15:28:20Z"
}
},
{
"_index": ".commands",
"_id": "S0lIkpMBrdRQWmVi5DGP",
"_score": 1,
"_source": {
"agent": {
"groups": [
"groups000"
]
},
"command": {
"source": "Engine",
"user": "user53",
"target": {
"type": "agent",
"id": "target4"
},
"action": {
"name": "restart",
"args": [
"/path/to/executable/arg6",
"/path/to/executable/arg6",
"/path/to/executable/arg6",
"/path/to/executable/arg6"
],
"version": "v4"
},
"timeout": 30,
"status": "PENDING",
"order_id": "Q0lIkpMBrdRQWmVi5DGO",
"request_id": "QklIkpMBrdRQWmVi5DGO"
},
"@timestamp": "2024-12-04T15:27:50Z",
"delivery_timestamp": "2024-12-04T15:28:20Z"
}
},
{
"_index": ".commands",
"_id": "TElIkpMBrdRQWmVi5DGP",
"_score": 1,
"_source": {
"agent": {
"groups": [
"groups000"
]
},
"command": {
"source": "Engine",
"user": "user53",
"target": {
"type": "agent",
"id": "target4"
},
"action": {
"name": "restart",
"args": [
"/path/to/executable/arg6",
"/path/to/executable/arg6",
"/path/to/executable/arg6"
],
"version": "v4"
},
"timeout": 30,
"status": "PENDING",
"order_id": "RUlIkpMBrdRQWmVi5DGO",
"request_id": "RElIkpMBrdRQWmVi5DGO"
},
"@timestamp": "2024-12-04T15:27:50Z",
"delivery_timestamp": "2024-12-04T15:28:20Z"
}
},
{
"_index": ".commands",
"_id": "TUlIkpMBrdRQWmVi5DGP",
"_score": 1,
"_source": {
"agent": {
"groups": [
"groups000"
]
},
"command": {
"source": "Engine",
"user": "user53",
"target": {
"type": "agent",
"id": "target4"
},
"action": {
"name": "restart",
"args": [
"/path/to/executable/arg6",
"/path/to/executable/arg6",
"/path/to/executable/arg6",
"/path/to/executable/arg6"
],
"version": "v4"
},
"timeout": 30,
"status": "PENDING",
"order_id": "R0lIkpMBrdRQWmVi5DGO",
"request_id": "RklIkpMBrdRQWmVi5DGO"
},
"@timestamp": "2024-12-04T15:27:50Z",
"delivery_timestamp": "2024-12-04T15:28:20Z"
}
},
{
"_index": ".commands",
"_id": "TklIkpMBrdRQWmVi5DGP",
"_score": 1,
"_source": {
"agent": {
"groups": [
"groups000"
]
},
"command": {
"source": "Engine",
"user": "user53",
"target": {
"type": "agent",
"id": "target4"
},
"action": {
"name": "restart",
"args": [],
"version": "v4"
},
"timeout": 30,
"status": "PENDING",
"order_id": "SUlIkpMBrdRQWmVi5DGO",
"request_id": "SElIkpMBrdRQWmVi5DGO"
},
"@timestamp": "2024-12-04T15:27:50Z",
"delivery_timestamp": "2024-12-04T15:28:20Z"
}
}
]
}
}
After 1m, we can see these are processed.
Details
{
"took": 7,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 5,
"relation": "eq"
},
"max_score": 1,
"hits": [
{
"_index": ".commands",
"_id": "S0lIkpMBrdRQWmVi5DGP",
"_score": 1,
"_source": {
"agent": {
"groups": [
"groups000"
]
},
"@timestamp": "2024-12-04T15:27:50Z",
"delivery_timestamp": "2024-12-04T15:28:20Z",
"command": {
"action": {
"args": [
"/path/to/executable/arg6",
"/path/to/executable/arg6",
"/path/to/executable/arg6",
"/path/to/executable/arg6"
],
"name": "restart",
"version": "v4"
},
"source": "Engine",
"user": "user53",
"order_id": "Q0lIkpMBrdRQWmVi5DGO",
"request_id": "QklIkpMBrdRQWmVi5DGO",
"timeout": 30,
"target": {
"id": "target4",
"type": "agent"
},
"status": "SENT"
}
}
},
{
"_index": ".commands",
"_id": "SklIkpMBrdRQWmVi5DGO",
"_score": 1,
"_source": {
"agent": {
"groups": [
"groups000"
]
},
"@timestamp": "2024-12-04T15:27:50Z",
"delivery_timestamp": "2024-12-04T15:28:20Z",
"command": {
"action": {
"args": [
"/path/to/executable/arg6",
"/path/to/executable/arg6"
],
"name": "restart",
"version": "v4"
},
"source": "Engine",
"user": "user53",
"order_id": "QUlIkpMBrdRQWmVi5DGO",
"request_id": "QElIkpMBrdRQWmVi5DGO",
"timeout": 30,
"target": {
"id": "target4",
"type": "agent"
},
"status": "SENT"
}
}
},
{
"_index": ".commands",
"_id": "TUlIkpMBrdRQWmVi5DGP",
"_score": 1,
"_source": {
"agent": {
"groups": [
"groups000"
]
},
"@timestamp": "2024-12-04T15:27:50Z",
"delivery_timestamp": "2024-12-04T15:28:20Z",
"command": {
"action": {
"args": [
"/path/to/executable/arg6",
"/path/to/executable/arg6",
"/path/to/executable/arg6",
"/path/to/executable/arg6"
],
"name": "restart",
"version": "v4"
},
"source": "Engine",
"user": "user53",
"order_id": "R0lIkpMBrdRQWmVi5DGO",
"request_id": "RklIkpMBrdRQWmVi5DGO",
"timeout": 30,
"target": {
"id": "target4",
"type": "agent"
},
"status": "SENT"
}
}
},
{
"_index": ".commands",
"_id": "TElIkpMBrdRQWmVi5DGP",
"_score": 1,
"_source": {
"agent": {
"groups": [
"groups000"
]
},
"@timestamp": "2024-12-04T15:27:50Z",
"delivery_timestamp": "2024-12-04T15:28:20Z",
"command": {
"action": {
"args": [
"/path/to/executable/arg6",
"/path/to/executable/arg6",
"/path/to/executable/arg6"
],
"name": "restart",
"version": "v4"
},
"source": "Engine",
"user": "user53",
"order_id": "RUlIkpMBrdRQWmVi5DGO",
"request_id": "RElIkpMBrdRQWmVi5DGO",
"timeout": 30,
"target": {
"id": "target4",
"type": "agent"
},
"status": "SENT"
}
}
},
{
"_index": ".commands",
"_id": "TklIkpMBrdRQWmVi5DGP",
"_score": 1,
"_source": {
"agent": {
"groups": [
"groups000"
]
},
"@timestamp": "2024-12-04T15:27:50Z",
"delivery_timestamp": "2024-12-04T15:28:20Z",
"command": {
"action": {
"args": [],
"name": "restart",
"version": "v4"
},
"source": "Engine",
"user": "user53",
"order_id": "SUlIkpMBrdRQWmVi5DGO",
"request_id": "SElIkpMBrdRQWmVi5DGO",
"timeout": 30,
"target": {
"id": "target4",
"type": "agent"
},
"status": "SENT"
}
}
}
]
}
}
In the Imposter logs, we can see the reception:
16:28:31 INFO i.g.i.p.o.s.ResponseTransmissionServiceImpl - Serving mock example for POST https://127.0.0.1:55000/orders with status code 200 (response body 225 bytes)
16:28:31 DEBUG i.g.i.h.AbstractResourceMatcher - Matched resource config for POST https://127.0.0.1:55000/orders
16:28:31 WARN i.g.i.s.ResponseServiceImpl - Response file and data are blank for [873be66d-e438-4bfa-afc8-da78abcd036d] POST https://127.0.0.1:55000/orders
16:28:31 DEBUG i.g.i.p.o.OpenApiPluginImpl - Setting content type [application/json] from specification for POST https://127.0.0.1:55000/orders
16:28:31 DEBUG i.g.i.p.o.s.ExampleServiceImpl - No exact match found for accepted content types - choosing first item found (application/json) from specification. You can switch off this behaviour by setting configuration option 'pickFirstIfNoneMatch: false'
16:28:31 INFO i.g.i.p.o.s.ResponseTransmissionServiceImpl - Serving mock example for POST https://127.0.0.1:55000/orders with status code 200 (response body 225 bytes)
16:28:31 DEBUG i.g.i.h.AbstractResourceMatcher - Matched resource config for POST https://127.0.0.1:55000/orders
16:28:31 WARN i.g.i.s.ResponseServiceImpl - Response file and data are blank for [4d1758df-c0b7-4177-a0a2-12198f26e683] POST https://127.0.0.1:55000/orders
16:28:31 DEBUG i.g.i.p.o.OpenApiPluginImpl - Setting content type [application/json] from specification for POST https://127.0.0.1:55000/orders
16:28:31 DEBUG i.g.i.p.o.s.ExampleServiceImpl - No exact match found for accepted content types - choosing first item found (application/json) from specification. You can switch off this behaviour by setting configuration option 'pickFirstIfNoneMatch: false'
mcasas993
approved these changes
Dec 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds job scheduler logic to the
command-manager
plugin.Issues Resolved
Resolves #87