-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add SurveyJob Support in Foreman #724
Conversation
nomad_client = Nomad(nomad_host, port=int(nomad_port), timeout=5) | ||
if dispatch: | ||
nomad_response = nomad_client.job.dispatch_job("SURVEYOR", meta={"JOB_NAME": "SURVEYOR", | ||
"JOB_ID": str(job.id)}) |
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.
Maybe we should switch surveyor jobs over to be expecting these meta values, however they are not currently what is accepted by surveyor jobs. They just need an accession.
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.
Besides the one comment I left, I think there's a couple things that need to be done still. The first is that this only deals with SURVEYOR
jobs and doesn't do much for SURVEYOR_DISPATCHER
jobs. The other is adding an interrupt handler to both types of jobs so if a deploy interrupts them they will mark themselves as failed and decrement their num_retries.
Can you take another look at this? Has support for RAM increasing on surveyors now. |
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.
There's a few more changes to make but this looks pretty good. Besides the unit test you added here, have you tested this?
job_type, nomad_job, nomad_host, nomad_port, job=str(new_job.id)) | ||
except Exception as e: | ||
logger.exception('Unable to Dispatch Nomad Job.', | ||
job_name=job_type.value, |
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.
job_type
is undefined
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.
As is nomad_job
except URLNotFoundNomadException: | ||
logger.error("Dispatching Surveyor Nomad job to host %s and port %s failed.", | ||
job_type, nomad_job, nomad_host, nomad_port, accession_code=accession) | ||
SURVEYOR_JOB_NAME, nomad_job, nomad_host, nomad_port, accession_code=accession) |
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.
nomad_job
is undefined.
except Exception as e: | ||
logger.exception('Unable to Dispatch Nomad Job.', | ||
job_name=job_type.value, | ||
job_name=SURVEYOR_JOB_NAME, | ||
job_id=str(job.id), |
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.
job
is undefined.
I think |
…into miserlou/715
…into miserlou/715
From the staging test:
You never ran half the code in this PR.... dude, you gotta start testing your stuff better |
Add SurveyJob Support in Foreman
Issue Number
#715
Purpose/Implementation Notes
Adds SurveyJob Support in Foreman. Pretty simple implementation, uses the existing pattern.
Types of changes
Functional tests
New test