Skip to content

Commit

Permalink
fix: revert missing (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
yetone authored Jan 24, 2025
1 parent 93f171f commit 4af9182
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions controllers/resources/bentorequest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3096,6 +3096,11 @@ echo "Done"

cmd := shquot.POSIXShell(append(command, args...))

type ModelSpec struct {
Tag string `json:"tag"`
DownloadURL string `json:"download_url"` // nolint:tagliatelle
}

if imageStoredInS3 {
builderImage = "quay.io/bentoml/bento-image-builder:0.0.26"
extraFlags := ""
Expand All @@ -3108,6 +3113,24 @@ echo "Done"
if containerImageS3EnableStargz {
extraFlags += " --enable-stargz"
}
models := make([]ModelSpec, 0, len(opt.BentoRequest.Spec.Models))
for _, model := range opt.BentoRequest.Spec.Models {
models = append(models, ModelSpec{
Tag: model.Tag,
DownloadURL: model.DownloadURL,
})
}
var modelsJSON []byte
modelsJSON, err = json.Marshal(models)
if err != nil {
err = errors.Wrap(err, "failed to marshal models")
return
}

if len(models) > 0 {
extraFlags += " --models " + base64.StdEncoding.EncodeToString(modelsJSON)
}

var cmdOutput bytes.Buffer
err = template.Must(template.New("script").Parse(`
set -ex
Expand Down

0 comments on commit 4af9182

Please sign in to comment.