-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Kurtwheeler/fix survey jobs #773
Conversation
…ode, and properly tests it.
…or running things locally.
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 left two comments.
@@ -68,6 +68,8 @@ def send_job(job_type: Enum, job) -> bool: | |||
raise ValueError(NONE_JOB_ERROR_TEMPLATE.format(job_type.value, "Processor", job_id)) | |||
elif job_type in list(Downloaders): | |||
nomad_job = NOMAD_DOWNLOADER_JOB | |||
elif job_type in list (SurveyJobTypes): |
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.
You may want to remove the space after between list
and (
.
run_nomad.sh
Outdated
|
||
echo "Registering surveyor_dispatch.nomad$TEST_POSTFIX" | ||
nomad run foreman/nomad-job-specs/surveyor_dispatcher.nomad"$TEST_POSTFIX" | ||
for job_spec in $(ls -1 foreman/nomad-job-specs | grep "\.nomad$TEST_POSTFIX$"); do |
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 think this line can be simplified into:
for job_spec in foreman/nomad-job-specs/*.nomad$TEST_POSTFIX; do
Kurtwheeler/fix survey jobs
Issue Number
#724 (comment)
Purpose/Implementation Notes
Surveyor jobs were broken because the model didn't change but new fields on the SurveyJob model were referenced. We didn't know this because there was only one unit test for the Foreman involving SurveyJobs and it was so limited it didn't trigger any of the issues.
The surveyor dispatcher was also broken because it referenced a variable that wasn't defined.
I've updated the model, added migrations, changed the way survey jobs are queued to match the pattern of downloader and processor jobs so everything is consistent, added a lot more unit tests to the Foreman for survey jobs, and updated the surveyor dispatcher code to actually work.
Types of changes
Functional tests
I temporarily modified the message queue like so:
so that the surveyor disptacher jobs could queue surveyor jobs but those surveyor jobs wouldn't queue additional work themselves.
Then I setup my local nomad like so:
And submitted a SURVEYOR_DISPATCHER job like so:
I made sure my job queued some work:
And that the jobs it queued completed successfully:
Checklist