Skip to content

Commit

Permalink
Change the predict app path to / and fix a bug in admin
Browse files Browse the repository at this point in the history
  • Loading branch information
nailixing committed May 20, 2020
1 parent 00dbfa7 commit 968dbd9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 29 deletions.
2 changes: 1 addition & 1 deletion scripts/kubernetes/.env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export APP_SECRET=singa_auto

# Core external configuration for SINGA-auto
export KUBERNETES_NETWORK=singa_auto
export DOCKER_SWARM_ADVERTISE_ADDR=127.0.0.1
export KUBERNETES_ADVERTISE_ADDR=127.0.0.1
export SINGA_AUTO_VERSION=0.2.0
export SINGA_AUTO_ADDR=127.0.0.1
export ADMIN_EXT_PORT=3000
Expand Down
37 changes: 10 additions & 27 deletions singa_auto/admin/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ def get_running_inference_job(self, user_id, app, app_version=-1):
if inference_job is None:
raise InvalidRunningInferenceJobError()


predictor_service = self._meta_store.get_service(inference_job.predictor_service_id) \
if inference_job.predictor_service_id is not None else None
if self.container_model == 'K8S':
Expand All @@ -776,32 +775,16 @@ def get_running_inference_job(self, user_id, app, app_version=-1):
else:
predictor_host = None

return {
'id': inference_job.id,
'status': inference_job.status,
'train_job_id': train_job_id,
'app': app,
'app_version': app_version,
'datetime_started': inference_job.datetime_started,
'datetime_stopped': inference_job.datetime_stopped,
'predictor_host': predictor_host
}

def get_inference_jobs_of_app(self, user_id, app):
inference_jobs = self._meta_store.get_inference_jobs_of_app(user_id, app)
train_jobs = [self._meta_store.get_train_job(x.train_job_id) for x in inference_jobs]
return [
{
'id': inference_job.id,
'status': inference_job.status,
'train_job_id': train_job.id,
'app': train_job.app,
'app_version': train_job.app_version,
'datetime_started': inference_job.datetime_started,
'datetime_stopped': inference_job.datetime_stopped
}
for (inference_job, train_job) in zip(inference_jobs, train_jobs)
]
return {
'id': inference_job.id,
'status': inference_job.status,
'train_job_id': train_job_id,
'app': app,
'app_version': app_version,
'datetime_started': inference_job.datetime_started,
'datetime_stopped': inference_job.datetime_stopped,
'predictor_host': predictor_host
}

def get_inference_jobs_of_app(self, user_id, app):
inference_jobs = self._meta_store.get_inference_jobs_of_app(user_id, app)
Expand Down
2 changes: 1 addition & 1 deletion singa_auto/predictor/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def index():
return 'Predictor is up.'


@app.route('/predict', methods=['POST'])
@app.route('/', methods=['POST'])
def predict():

if request.files.getlist('img'):
Expand Down

0 comments on commit 968dbd9

Please sign in to comment.