From 7c0415850923a9256a468f6ab9a35264a656b277 Mon Sep 17 00:00:00 2001 From: mudler Date: Sat, 20 May 2023 14:25:53 +0200 Subject: [PATCH] fix: uid -> uuid --- README.md | 7 ++++--- api/api_test.go | 8 ++++---- api/gallery.go | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 007802a0..e71a56de 100644 --- a/README.md +++ b/README.md @@ -869,17 +869,18 @@ curl http://localhost:8080/models/apply -H "Content-Type: application/json" -d ' "uri": "", "sha256": "", "name": "" - } + }, + "overrides": { "backend": "...", "f16": true } ] } ``` -An optional, list of additional files can be specified to be downloaded. The `name` allows to override the model name. +An optional, list of additional files can be specified to be downloaded within `files`. The `name` allows to override the model name. Finally it is possible to override the model config file with `override`. Returns an `uuid` and an `url` to follow up the state of the process: ```json -{ "uid":"251475c9-f666-11ed-95e0-9a8a4480ac58", "status":"http://localhost:8080/models/jobs/251475c9-f666-11ed-95e0-9a8a4480ac58"} +{ "uuid":"251475c9-f666-11ed-95e0-9a8a4480ac58", "status":"http://localhost:8080/models/jobs/251475c9-f666-11ed-95e0-9a8a4480ac58"} ``` To see a collection example of curated models definition files, see the [model-gallery](https://github.com/go-skynet/model-gallery). diff --git a/api/api_test.go b/api/api_test.go index 071ceb97..f061527f 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -147,9 +147,9 @@ var _ = Describe("API test", func() { }, }) - Expect(response["uid"]).ToNot(BeEmpty(), fmt.Sprint(response)) + Expect(response["uuid"]).ToNot(BeEmpty(), fmt.Sprint(response)) - uuid := response["uid"].(string) + uuid := response["uuid"].(string) Eventually(func() bool { response := getModelStatus("http://127.0.0.1:9090/models/jobs/" + uuid) @@ -172,9 +172,9 @@ var _ = Describe("API test", func() { Overrides: map[string]string{}, }) - Expect(response["uid"]).ToNot(BeEmpty(), fmt.Sprint(response)) + Expect(response["uuid"]).ToNot(BeEmpty(), fmt.Sprint(response)) - uuid := response["uid"].(string) + uuid := response["uuid"].(string) Eventually(func() bool { response := getModelStatus("http://127.0.0.1:9090/models/jobs/" + uuid) diff --git a/api/gallery.go b/api/gallery.go index 6178b5a8..591b1b7a 100644 --- a/api/gallery.go +++ b/api/gallery.go @@ -163,7 +163,7 @@ func (request ApplyGalleryModelRequest) DecodeURL() (string, error) { func getOpStatus(g *galleryApplier) func(c *fiber.Ctx) error { return func(c *fiber.Ctx) error { - status := g.getstatus(c.Params("uid")) + status := g.getstatus(c.Params("uuid")) if status == nil { return fmt.Errorf("could not find any status for ID") } @@ -189,7 +189,7 @@ func applyModelGallery(modelPath string, cm *ConfigMerger, g chan galleryOp) fun id: uuid.String(), } return c.JSON(struct { - ID string `json:"uid"` + ID string `json:"uuid"` StatusURL string `json:"status"` }{ID: uuid.String(), StatusURL: c.BaseURL() + "/models/jobs/" + uuid.String()}) }