-
Notifications
You must be signed in to change notification settings - Fork 448
Logic improvements for tasking #1020
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
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
… bigger error messages in db
Let me know if you would prefer if this PR was split into smaller ones. |
thats fine. amazing work on this. Special thanks for the tags that removes some stuff that i had pending but never had time to review properly |
btw amazing summary, forgot to say |
Thanks a lot |
tbeadle
pushed a commit
to tbeadle/CAPEv2
that referenced
this pull request
Aug 1, 2022
kevoreilly#1020 introduced a regression in selection of VM's for x86 tasks where it would no longer allow selection of an x64 VM. This reintroduces that ability so that x86 tasks will select x86 OR x64 machines, preferring x86 over x64.
doomedraven
pushed a commit
that referenced
this pull request
Aug 2, 2022
* Fix regression in VM selection. #1020 introduced a regression in selection of VM's for x86 tasks where it would no longer allow selection of an x64 VM. This reintroduces that ability so that x86 tasks will select x86 OR x64 machines, preferring x86 over x64. * Fix formatting. Co-authored-by: Tommy Beadle
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.
The goal of this PR started out as being able to handle tasks that require machines with specific tags, but then it got WAY bigger!
Things that I have improved:
conf/az.conf
,modules/machinery/az.py
conf/web.conf
,lib/cuckoo/common/web_utils.py
,lib/cuckoo/core/database.py
lib/cuckoo/common/abstracts.py
,lib/cuckoo/core/database.py
lib/cuckoo/common/web_utils
true
/false
,yes
/no
,on
/off
,0
/1
and can be any case.utils/db_migration/versions/2_3_3_expand_error_message.py
,lib/cuckoo/core/database.py
message
field because it could not contain theCuckooGuestCriticalTimeout
erroralembic
SCHEMA_VERSION
of thedatabase.py
filelib/cuckoo/core/scheduler.py
,lib/cuckoo/core/database.py
is_relevant_machine_available
method that determines if a machine is relevant to a task and available to be assignedfetch
method intofetch_task
for tasks that do not require a VM. This really simplifies the logic for this method.lib/cuckoo/core/database.py
guest_stop
method, we should check if the guest exists before trying to shut it down. This can occur in dynamic machineries such asaz
oraws
.list_machines
so that you can also filter bylocked
asTrue
/False
, machine label and the machine architecturelock_machine
to include the selection criteria that was attemptedget_available_machines
now joins ontags
options_not_like
inlist_tasks
since this is a way that we can replicate the use ofnot_("node=")
in the originalfetch
method https://github.com/kevoreilly/CAPEv2/blob/master/lib/cuckoo/core/database.py#L815order_by
keyword argument inlist_tasks
, so that we can pass multiple items tolist_tasks
to order tasks bylib/cuckoo/core/plugins.py
lib/cuckoo/core/resultserver.py
lib/cuckoo/core/scheduler.py
check_file
method, we should check if sample exists before trying to access it'ssha256
attribute.acquire
, determine which task tags are the architecture and which are just tags, and then pass these values toacquire
CuckooGuestCriticalTimeout
error that will unlock the machinemodules/machinery/az.py
number_of_new_cpus_available
according to the quota is less than 0, and if so, set the minimumnumber_of_relevant_machines_required
. This was causing errors when the 5 VM buffer was too close to the limit.tests/test_scheduler.py
acquire
andmock_tags
utils/cleaners.py