From 8c33cacb4cc501517f64081aef114867bb8c115c Mon Sep 17 00:00:00 2001 From: Tio Pramayudi Date: Wed, 13 Dec 2023 15:31:08 +0700 Subject: [PATCH] Fix: image build process on pyfunc v3 model (#505) **What this PR does / why we need it**: In v0.37.0 the image building is triggered when deploying pyfunc_v3, but in the recent release the image building process is skip for pyfunc_v3 hence the deployment will fail **Which issue(s) this PR fixes**: Trigger image building process for pyfunc_v3 deployment Fixes # **Does this PR introduce a user-facing change?**: ```release-note ``` **Checklist** - [ ] Added unit test, integration, and/or e2e tests - [ ] Tested locally - [ ] Updated documentation - [ ] Update Swagger spec if the PR introduce API changes - [ ] Regenerated Golang and Python client if the PR introduce API changes --- api/queue/work/model_service_deployment.go | 2 +- api/queue/work/model_service_deployment_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/queue/work/model_service_deployment.go b/api/queue/work/model_service_deployment.go index e76756994..2690d58c7 100644 --- a/api/queue/work/model_service_deployment.go +++ b/api/queue/work/model_service_deployment.go @@ -184,7 +184,7 @@ func (depl *ModelServiceDeployment) Deploy(job *queue.Job) error { func (depl *ModelServiceDeployment) generateModelOptions(ctx context.Context, model *models.Model, version *models.Version, endpoint *models.VersionEndpoint) (*models.ModelOption, error) { modelOpt := &models.ModelOption{} switch model.Type { - case models.ModelTypePyFunc: + case models.ModelTypePyFunc, models.ModelTypePyFuncV3: imageRef, err := depl.ImageBuilder.BuildImage(ctx, model.Project, model, version, endpoint.ImageBuilderResourceRequest) if err != nil { return modelOpt, err diff --git a/api/queue/work/model_service_deployment_test.go b/api/queue/work/model_service_deployment_test.go index c8dadfd0a..a75484751 100644 --- a/api/queue/work/model_service_deployment_test.go +++ b/api/queue/work/model_service_deployment_test.go @@ -250,7 +250,7 @@ func TestExecuteDeployment(t *testing.T) { }, imageBuilder: func() *imageBuilderMock.ImageBuilder { mockImgBuilder := &imageBuilderMock.ImageBuilder{} - mockImgBuilder.On("BuildImage", context.Background(), project, mock.Anything, mock.Anything). + mockImgBuilder.On("BuildImage", context.Background(), project, mock.Anything, mock.Anything, mock.Anything). Return("gojek/mymodel-1:latest", nil) return mockImgBuilder },