-
Notifications
You must be signed in to change notification settings - Fork 37
feat: add exclude_agents field to job data to allow jobs to skip specific agents #850
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: main
Are you sure you want to change the base?
Conversation
- Add exclude_agents field to job schema to exclude specific agents from running a job - Validate exclude_agents is a list and at least one available agent can run the job - Update job_get endpoint to require agent_name cookie and filter jobs by excluded agents - Update pop_job to respect exclude_agents when assigning jobs to agents - Set agent_name cookie on agent registration for future request identification - Update CLI to support exclude_agents field and validate it's properly formatted - Add comprehensive tests for exclude_agents validation and job assignment
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #850 +/- ##
==========================================
+ Coverage 71.31% 71.46% +0.14%
==========================================
Files 108 108
Lines 9651 9707 +56
Branches 858 864 +6
==========================================
+ Hits 6883 6937 +54
- Misses 2595 2596 +1
- Partials 173 174 +1
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
| "test_path", | ||
| [ | ||
| "path" | ||
| "path", |
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.
This appeared to be a mistake and was getting reformatted by uvx ruff format
…ERTF-697-exclude-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.
#852 has many of the same changes, but also changes webdav to WebDAV (appropriately)
Description
Added the ability to specify that select agents are not to be used to run a given job, even if they are in the specified queue.
Agents will now be required to POST to
/agents/data/<agent_name>before they are able to GET a/jobto work. The response message from registering the agent will return a cookie which will identify the agent on subsequent calls to fetch a job to work on.Resolved issues
Resolves Jira CERTTF-697
Documentation
Examples and references data updated in
docs/.Web service API changes
Job data may now include
exclude_agentsat the top level, e.g. alongsidejob_queue, for example:Added a cookie in the response to POST
/agents/data/<agent_name>which is required to then GET a/job. This is done to ensure that agents getting work are who they say they are and without introducing any new agent code to do so. Therequestslibrary is already configured to respond with cookies it it given and the agents are already configured to register before they look for work.exclude_agentswas added to the database job schema in support of this.When there are excluded agents, they will be considered when checking against the relevant queues upon job scheduling and assignment so that jobs with no agents will be prevented from being scheduled and agents will not be blocked from doing other work for which they are not excluded from running.
Tests
Tests were added to CLI and server to ensure new functionality is tested.
cd cli && uvx toxcd server && uvx tox