Skip to content

Commit

Permalink
Merge branch 'main' into fix-logs-api
Browse files Browse the repository at this point in the history
  • Loading branch information
ariefrahmansyah authored Oct 23, 2023
2 parents e737ada + 288ceb7 commit 8c733c7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
13 changes: 10 additions & 3 deletions api/queue/work/model_service_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,9 @@ func (depl *ModelServiceDeployment) Deploy(job *queue.Job) error {
}

defer func() {
deploymentCounter.WithLabelValues(model.Project.Name, model.Name, fmt.Sprint(endpoint.Status), fmt.Sprint(isRedeployment)).Inc()
deploymentCounter.WithLabelValues(model.Project.Name, model.Name, fmt.Sprint(deployment.Status), fmt.Sprint(isRedeployment)).Inc()

// record the deployment result
deployment.Status = endpoint.Status
deployment.Error = endpoint.Message
deployment.UpdatedAt = time.Now()
if _, err := depl.DeploymentStorage.Save(deployment); err != nil {
log.Warnf("unable to update deployment history", err)
Expand All @@ -125,19 +123,26 @@ func (depl *ModelServiceDeployment) Deploy(job *queue.Job) error {

modelOpt, err := depl.generateModelOptions(ctx, model, version)
if err != nil {
deployment.Status = models.EndpointFailed
deployment.Error = err.Error()
endpoint.Message = err.Error()
return err
}

modelService := models.NewService(model, version, modelOpt, endpoint)
ctl, ok := depl.ClusterControllers[endpoint.EnvironmentName]
if !ok {
deployment.Status = models.EndpointFailed
deployment.Error = err.Error()
endpoint.Message = err.Error()
return fmt.Errorf("unable to find cluster controller for environment %s", endpoint.EnvironmentName)
}

svc, err := ctl.Deploy(ctx, modelService)
if err != nil {
log.Errorf("unable to deploy version endpoint for model: %s, version: %s, reason: %v", model.Name, version.ID, err)
deployment.Status = models.EndpointFailed
deployment.Error = err.Error()
endpoint.Message = err.Error()
return err
}
Expand All @@ -154,6 +159,8 @@ func (depl *ModelServiceDeployment) Deploy(job *queue.Job) error {
endpoint.InferenceServiceName = svc.CurrentIsvcName
endpoint.Message = "" // reset message

deployment.Status = endpoint.Status

return nil
}

Expand Down
3 changes: 2 additions & 1 deletion python/pyfunc-server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ argparse>=1.4.0
numpy >= 1.8.2
cloudpickle==2.0.0
prometheus_client==0.14.1
uvloop>=0.15.2
#TODO: Remove uvloop pinning once we drop Python 3.7 support
uvloop>=0.15.2,<0.18.0
orjson>=2.6.8
tornado
caraml-upi-protos
Expand Down
8 changes: 5 additions & 3 deletions ui/src/pages/version/HistoryDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ const DeploymentStatus = ({
if (status === "running" || status === "serving") {
if (
deployment.id === deployedRevision.id &&
(endpointStatus === "running" || endpointStatus === "serving")
(endpointStatus === "pending" ||
endpointStatus === "running" ||
endpointStatus === "serving")
) {
return <EuiHealth color="success">Deployed</EuiHealth>;
}
Expand All @@ -44,7 +46,8 @@ const RevisionPanel = ({ deployments, deploymentsLoaded, endpoint }) => {

const deployedRevision = orderedDeployments.find(
(deployment) =>
deployment.status === "running" || deployment.status === "serving"
(deployment.status === "running" || deployment.status === "serving") &&
deployment.error === ""
) || { id: null };

const canBeExpanded = (deployment) => {
Expand Down Expand Up @@ -92,7 +95,6 @@ const RevisionPanel = ({ deployments, deploymentsLoaded, endpoint }) => {
{deployment.id === deployedRevision.id && (
<EuiBadge color="default">Current</EuiBadge>
)}
{/* {JSON.stringify(deployment.id)} */}
</>
),
},
Expand Down

0 comments on commit 8c733c7

Please sign in to comment.