i have deployed my front end application through a deployment.yaml
file using minikube having swagger-ui
. This application simply takes in json queries and starts jobs on minikube which runs and terminates relevant containers.
currently i have built 1 docker image on my minikube cluster which starts downloading satellite images after the job is started.
Now whenever i pass a json query to swagger-ui, it gives me the following response where the job status is PENDING
:
{
"workflowId": "2a94d0e3-7245-47e4-a9ce-821efce42eb8",
"workflowName": "monitoring1",
"status": "PENDING",
"submittedAt": "2019-08-29T08:22:59.599469Z",
"completedAt": null,
"jobs": [
Job watcher
var jobStatus = JobStatus.PENDING
when (action) {
Watcher.Action.ADDED -> {
if (job.status.startTime != null && job.status.active >= 0) {
jobStatus = JobStatus.RUNNING
}
}
Watcher.Action.MODIFIED -> {
if (job.status.completionTime != null && job.status.succeeded >= 0) {
jobStatus = JobStatus.COMPLETED
} else if (job.status.failed != null) {
jobStatus = JobStatus.ERROR
}
}
Watcher.Action.DELETED -> {
log.info("DELETED")
}
Watcher.Action.ERROR -> {
jobStatus = JobStatus.ERROR
}
}
on the minikuber side, the job starts and terminates after some time but on the side of swagger, the status of job never changes. However, when i try to run a GET
query to list all jobs, there i see the completed job. My question is how can i update status or notify the user once the job completes?.