diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33d7860c..f98a82af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,22 +22,13 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.21' - - name: Install Protoc - uses: arduino/setup-protoc@v3 - with: - version: "24.3" - repo-token: ${{ secrets.GITHUB_TOKEN }} + go-version: "1.21" - name: Set up Python uses: actions/setup-python@v5 with: python-version: 3.9 - - name: Install makefile dependencies - run: make deps - - name: Clean - run: make clean - name: Build - run: make build + run: make clean build - name: Check if there are uncommitted file changes run: | clean=$(git status --porcelain) diff --git a/Makefile b/Makefile index c8d6cc98..b15a0cdd 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) PROJECT_PATH := $(patsubst %/,%,$(dir $(MKFILE_PATH))) PROJECT_BIN := $(PROJECT_PATH)/bin -GO := $(PROJECT_BIN)/go1.21.9 +GO ?= "$(shell which go)" # add tools bin directory PATH := $(PROJECT_BIN):$(PATH) @@ -108,10 +108,6 @@ clean: clean/odh: rm -Rf ./model-registry -bin/go: - GOBIN=$(PROJECT_BIN) go install golang.org/dl/go1.21.9@latest - $(PROJECT_BIN)/go1.21.9 download - bin/protoc: ./scripts/install_protoc.sh @@ -155,7 +151,7 @@ clean/deps: rm -Rf bin/* .PHONY: deps -deps: bin/go bin/protoc bin/go-enum bin/protoc-gen-go bin/protoc-gen-go-grpc bin/golangci-lint bin/goverter bin/openapi-generator-cli +deps: bin/protoc bin/go-enum bin/protoc-gen-go bin/protoc-gen-go-grpc bin/golangci-lint bin/goverter bin/openapi-generator-cli .PHONY: vendor vendor: diff --git a/README.md b/README.md index 910857cd..35990d44 100644 --- a/README.md +++ b/README.md @@ -132,3 +132,19 @@ End-to-end testing is developed with Robot Framework; this higher-lever layer of - demonstrate *User Stories* from high level perspective - demonstrate coherent logical data mapping by performing the same high level capabilities, using REST API flow Vs Python client flow, directly checking the end results in the backend gRPC MLMD server. + +## Tips +### Pull image rate limiting + +Ocassionally you may encounter an 'ImagePullBackOff' error when deploying the Model Registry manifests. See example below for the `model-registry-db` container. + +``` +Failed to pull image “mysql:8.3.0”: rpc error: code = Unknown desc = fetching target platform image selected from image index: reading manifest sha256:f9097d95a4ba5451fff79f4110ea6d750ac17ca08840f1190a73320b84ca4c62 in docker.io/library/mysql: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit +``` + +This error is triggered by the rate limits from docker.io; in this example specifically about the image `mysql:8.3.0` (the expanded reference is `docker.io/library/mysql:8.3.0`). To mitigate against this error you could [authenticate using image pull secrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) for _local development_; or replace the image used with alternative mirrored images, for instance with the following example: +``` +manifests/kustomize/overlays/db/model-registry-db-deployment.yaml file. + +spec.template.spec.containers.image: public.ecr.aws/docker/library/mysql:8.3.0 +``` diff --git a/api/openapi/model-registry.yaml b/api/openapi/model-registry.yaml index 362b9f6f..15e8cef7 100644 --- a/api/openapi/model-registry.yaml +++ b/api/openapi/model-registry.yaml @@ -1023,10 +1023,18 @@ components: - $ref: "#/components/schemas/BaseResourceList" RegisteredModelCreate: description: A registered model in model registry. A registered model has ModelVersion children. + required: + - name allOf: - type: object - $ref: "#/components/schemas/BaseResourceCreate" - $ref: "#/components/schemas/RegisteredModelUpdate" + properties: + name: + description: |- + The client provided name of the model. It must be unique among all the RegisteredModels of the same + type within a Model Registry instance and cannot be changed once set. + type: string RegisteredModelUpdate: description: A registered model in model registry. A registered model has ModelVersion children. allOf: @@ -1045,6 +1053,7 @@ components: ModelVersionCreate: description: Represents a ModelVersion belonging to a RegisteredModel. required: + - name - registeredModelId allOf: - $ref: "#/components/schemas/BaseResourceCreate" @@ -1054,6 +1063,11 @@ components: registeredModelId: description: ID of the `RegisteredModel` to which this version belongs. type: string + name: + description: |- + The client provided name of the model's version. It must be unique among all the ModelVersions of the same + type within a Model Registry instance and cannot be changed once set. + type: string ModelVersionUpdate: description: Represents a ModelVersion belonging to a RegisteredModel. allOf: diff --git a/clients/python/poetry.lock b/clients/python/poetry.lock index 7c5eda73..2b5087af 100644 --- a/clients/python/poetry.lock +++ b/clients/python/poetry.lock @@ -13,87 +13,87 @@ files = [ [[package]] name = "aiohttp" -version = "3.10.1" +version = "3.10.4" description = "Async http client/server framework (asyncio)" optional = false python-versions = ">=3.8" files = [ - {file = "aiohttp-3.10.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:47b4c2412960e64d97258f40616efddaebcb34ff664c8a972119ed38fac2a62c"}, - {file = "aiohttp-3.10.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e7dbf637f87dd315fa1f36aaed8afa929ee2c607454fb7791e74c88a0d94da59"}, - {file = "aiohttp-3.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c8fb76214b5b739ce59e2236a6489d9dc3483649cfd6f563dbf5d8e40dbdd57d"}, - {file = "aiohttp-3.10.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c577cdcf8f92862363b3d598d971c6a84ed8f0bf824d4cc1ce70c2fb02acb4a"}, - {file = "aiohttp-3.10.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:777e23609899cb230ad2642b4bdf1008890f84968be78de29099a8a86f10b261"}, - {file = "aiohttp-3.10.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b07286a1090483799599a2f72f76ac396993da31f6e08efedb59f40876c144fa"}, - {file = "aiohttp-3.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b9db600a86414a9a653e3c1c7f6a2f6a1894ab8f83d11505247bd1b90ad57157"}, - {file = "aiohttp-3.10.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01c3f1eb280008e51965a8d160a108c333136f4a39d46f516c64d2aa2e6a53f2"}, - {file = "aiohttp-3.10.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f5dd109a925fee4c9ac3f6a094900461a2712df41745f5d04782ebcbe6479ccb"}, - {file = "aiohttp-3.10.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:8c81ff4afffef9b1186639506d70ea90888218f5ddfff03870e74ec80bb59970"}, - {file = "aiohttp-3.10.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:2a384dfbe8bfebd203b778a30a712886d147c61943675f4719b56725a8bbe803"}, - {file = "aiohttp-3.10.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:b9fb6508893dc31cfcbb8191ef35abd79751db1d6871b3e2caee83959b4d91eb"}, - {file = "aiohttp-3.10.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:88596384c3bec644a96ae46287bb646d6a23fa6014afe3799156aef42669c6bd"}, - {file = "aiohttp-3.10.1-cp310-cp310-win32.whl", hash = "sha256:68164d43c580c2e8bf8e0eb4960142919d304052ccab92be10250a3a33b53268"}, - {file = "aiohttp-3.10.1-cp310-cp310-win_amd64.whl", hash = "sha256:d6bbe2c90c10382ca96df33b56e2060404a4f0f88673e1e84b44c8952517e5f3"}, - {file = "aiohttp-3.10.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f6979b4f20d3e557a867da9d9227de4c156fcdcb348a5848e3e6190fd7feb972"}, - {file = "aiohttp-3.10.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:03c0c380c83f8a8d4416224aafb88d378376d6f4cadebb56b060688251055cd4"}, - {file = "aiohttp-3.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1c2b104e81b3c3deba7e6f5bc1a9a0e9161c380530479970766a6655b8b77c7c"}, - {file = "aiohttp-3.10.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b023b68c61ab0cd48bd38416b421464a62c381e32b9dc7b4bdfa2905807452a4"}, - {file = "aiohttp-3.10.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1a07c76a82390506ca0eabf57c0540cf5a60c993c442928fe4928472c4c6e5e6"}, - {file = "aiohttp-3.10.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:41d8dab8c64ded1edf117d2a64f353efa096c52b853ef461aebd49abae979f16"}, - {file = "aiohttp-3.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:615348fab1a9ef7d0960a905e83ad39051ae9cb0d2837da739b5d3a7671e497a"}, - {file = "aiohttp-3.10.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:256ee6044214ee9d66d531bb374f065ee94e60667d6bbeaa25ca111fc3997158"}, - {file = "aiohttp-3.10.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b7d5bb926805022508b7ddeaad957f1fce7a8d77532068d7bdb431056dc630cd"}, - {file = "aiohttp-3.10.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:028faf71b338f069077af6315ad54281612705d68889f5d914318cbc2aab0d50"}, - {file = "aiohttp-3.10.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:5c12310d153b27aa630750be44e79313acc4e864c421eb7d2bc6fa3429c41bf8"}, - {file = "aiohttp-3.10.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:de1a91d5faded9054957ed0a9e01b9d632109341942fc123947ced358c5d9009"}, - {file = "aiohttp-3.10.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9c186b270979fb1dee3ababe2d12fb243ed7da08b30abc83ebac3a928a4ddb15"}, - {file = "aiohttp-3.10.1-cp311-cp311-win32.whl", hash = "sha256:4a9ce70f5e00380377aac0e568abd075266ff992be2e271765f7b35d228a990c"}, - {file = "aiohttp-3.10.1-cp311-cp311-win_amd64.whl", hash = "sha256:a77c79bac8d908d839d32c212aef2354d2246eb9deb3e2cb01ffa83fb7a6ea5d"}, - {file = "aiohttp-3.10.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:2212296cdb63b092e295c3e4b4b442e7b7eb41e8a30d0f53c16d5962efed395d"}, - {file = "aiohttp-3.10.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:4dcb127ca3eb0a61205818a606393cbb60d93b7afb9accd2fd1e9081cc533144"}, - {file = "aiohttp-3.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cb8b79a65332e1a426ccb6290ce0409e1dc16b4daac1cc5761e059127fa3d134"}, - {file = "aiohttp-3.10.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68cc24f707ed9cb961f6ee04020ca01de2c89b2811f3cf3361dc7c96a14bfbcc"}, - {file = "aiohttp-3.10.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9cb54f5725b4b37af12edf6c9e834df59258c82c15a244daa521a065fbb11717"}, - {file = "aiohttp-3.10.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:51d03e948e53b3639ce4d438f3d1d8202898ec6655cadcc09ec99229d4adc2a9"}, - {file = "aiohttp-3.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:786299d719eb5d868f161aeec56d589396b053925b7e0ce36e983d30d0a3e55c"}, - {file = "aiohttp-3.10.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abda4009a30d51d3f06f36bc7411a62b3e647fa6cc935ef667e3e3d3a7dd09b1"}, - {file = "aiohttp-3.10.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:67f7639424c313125213954e93a6229d3a1d386855d70c292a12628f600c7150"}, - {file = "aiohttp-3.10.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:8e5a26d7aac4c0d8414a347da162696eea0629fdce939ada6aedf951abb1d745"}, - {file = "aiohttp-3.10.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:120548d89f14b76a041088b582454d89389370632ee12bf39d919cc5c561d1ca"}, - {file = "aiohttp-3.10.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:f5293726943bdcea24715b121d8c4ae12581441d22623b0e6ab12d07ce85f9c4"}, - {file = "aiohttp-3.10.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1f8605e573ed6c44ec689d94544b2c4bb1390aaa723a8b5a2cc0a5a485987a68"}, - {file = "aiohttp-3.10.1-cp312-cp312-win32.whl", hash = "sha256:e7168782621be4448d90169a60c8b37e9b0926b3b79b6097bc180c0a8a119e73"}, - {file = "aiohttp-3.10.1-cp312-cp312-win_amd64.whl", hash = "sha256:8fbf8c0ded367c5c8eaf585f85ca8dd85ff4d5b73fb8fe1e6ac9e1b5e62e11f7"}, - {file = "aiohttp-3.10.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:54b7f4a20d7cc6bfa4438abbde069d417bb7a119f870975f78a2b99890226d55"}, - {file = "aiohttp-3.10.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2fa643ca990323db68911b92f3f7a0ca9ae300ae340d0235de87c523601e58d9"}, - {file = "aiohttp-3.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:d8311d0d690487359fe2247ec5d2cac9946e70d50dced8c01ce9e72341c21151"}, - {file = "aiohttp-3.10.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:222821c60b8f6a64c5908cb43d69c0ee978a1188f6a8433d4757d39231b42cdb"}, - {file = "aiohttp-3.10.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e7b55d9ede66af7feb6de87ff277e0ccf6d51c7db74cc39337fe3a0e31b5872d"}, - {file = "aiohttp-3.10.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5a95151a5567b3b00368e99e9c5334a919514f60888a6b6d2054fea5e66e527e"}, - {file = "aiohttp-3.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4e9e9171d2fe6bfd9d3838a6fe63b1e91b55e0bf726c16edf265536e4eafed19"}, - {file = "aiohttp-3.10.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a57e73f9523e980f6101dc9a83adcd7ac0006ea8bf7937ca3870391c7bb4f8ff"}, - {file = "aiohttp-3.10.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:0df51a3d70a2bfbb9c921619f68d6d02591f24f10e9c76de6f3388c89ed01de6"}, - {file = "aiohttp-3.10.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:b0de63ff0307eac3961b4af74382d30220d4813f36b7aaaf57f063a1243b4214"}, - {file = "aiohttp-3.10.1-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:8db9b749f589b5af8e4993623dbda6716b2b7a5fcb0fa2277bf3ce4b278c7059"}, - {file = "aiohttp-3.10.1-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:6b14c19172eb53b63931d3e62a9749d6519f7c121149493e6eefca055fcdb352"}, - {file = "aiohttp-3.10.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:5cd57ad998e3038aa87c38fe85c99ed728001bf5dde8eca121cadee06ee3f637"}, - {file = "aiohttp-3.10.1-cp38-cp38-win32.whl", hash = "sha256:df31641e3f02b77eb3c5fb63c0508bee0fc067cf153da0e002ebbb0db0b6d91a"}, - {file = "aiohttp-3.10.1-cp38-cp38-win_amd64.whl", hash = "sha256:93094eba50bc2ad4c40ff4997ead1fdcd41536116f2e7d6cfec9596a8ecb3615"}, - {file = "aiohttp-3.10.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:440954ddc6b77257e67170d57b1026aa9545275c33312357472504eef7b4cc0b"}, - {file = "aiohttp-3.10.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f9f8beed277488a52ee2b459b23c4135e54d6a819eaba2e120e57311015b58e9"}, - {file = "aiohttp-3.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d8a8221a63602008550022aa3a4152ca357e1dde7ab3dd1da7e1925050b56863"}, - {file = "aiohttp-3.10.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a702bd3663b5cbf3916e84bf332400d24cdb18399f0877ca6b313ce6c08bfb43"}, - {file = "aiohttp-3.10.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1988b370536eb14f0ce7f3a4a5b422ab64c4e255b3f5d7752c5f583dc8c967fc"}, - {file = "aiohttp-3.10.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7ccf1f0a304352c891d124ac1a9dea59b14b2abed1704aaa7689fc90ef9c5be1"}, - {file = "aiohttp-3.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc3ea6ef2a83edad84bbdb5d96e22f587b67c68922cd7b6f9d8f24865e655bcf"}, - {file = "aiohttp-3.10.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:89b47c125ab07f0831803b88aeb12b04c564d5f07a1c1a225d4eb4d2f26e8b5e"}, - {file = "aiohttp-3.10.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:21778552ef3d44aac3278cc6f6d13a6423504fa5f09f2df34bfe489ed9ded7f5"}, - {file = "aiohttp-3.10.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:bde0693073fd5e542e46ea100aa6c1a5d36282dbdbad85b1c3365d5421490a92"}, - {file = "aiohttp-3.10.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:bf66149bb348d8e713f3a8e0b4f5b952094c2948c408e1cfef03b49e86745d60"}, - {file = "aiohttp-3.10.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:587237571a85716d6f71f60d103416c9df7d5acb55d96d3d3ced65f39bff9c0c"}, - {file = "aiohttp-3.10.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:bfe33cba6e127d0b5b417623c9aa621f0a69f304742acdca929a9fdab4593693"}, - {file = "aiohttp-3.10.1-cp39-cp39-win32.whl", hash = "sha256:9fbff00646cf8211b330690eb2fd64b23e1ce5b63a342436c1d1d6951d53d8dd"}, - {file = "aiohttp-3.10.1-cp39-cp39-win_amd64.whl", hash = "sha256:5951c328f9ac42d7bce7a6ded535879bc9ae13032818d036749631fa27777905"}, - {file = "aiohttp-3.10.1.tar.gz", hash = "sha256:8b0d058e4e425d3b45e8ec70d49b402f4d6b21041e674798b1f91ba027c73f28"}, + {file = "aiohttp-3.10.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:81037ddda8cc0a95c6d8c1b9029d0b19a62db8770c0e239e3bea0109d294ab66"}, + {file = "aiohttp-3.10.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:71944d4f4090afc07ce96b7029d5a574240e2f39570450df4af0d5b93a5ee64a"}, + {file = "aiohttp-3.10.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c774f08afecc0a617966f45a9c378456e713a999ee60654d9727617def3e4ee4"}, + {file = "aiohttp-3.10.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc990e73613c78ab2930b60266135066f37fdfce6b32dd604f42c5c377ee880a"}, + {file = "aiohttp-3.10.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f6acd1a908740f708358d240f9a3243cec31a456e3ded65c2cb46f6043bc6735"}, + {file = "aiohttp-3.10.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6075e27e7e54fbcd1c129c5699b2d251c885c9892e26d59a0fb7705141c2d14b"}, + {file = "aiohttp-3.10.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc98d93d11d860ac823beb6131f292d82efb76f226b5e28a3eab1ec578dfd041"}, + {file = "aiohttp-3.10.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:201ddf1471567568be381b6d4701e266a768f7eaa2f99ef753f2c9c5e1e3fb5c"}, + {file = "aiohttp-3.10.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:7d202ec55e61f06b1a1eaf317fba7546855cbf803c13ce7625d462fb8c88e238"}, + {file = "aiohttp-3.10.4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:96b2e7c110a941c8c1a692703b8ac1013e47f17ee03356c71d55c0a54de2ce38"}, + {file = "aiohttp-3.10.4-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:8ba0fbc56c44883bd757ece433f9caadbca67f565934afe9bc53ba3bd99cc368"}, + {file = "aiohttp-3.10.4-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:46cc9069da466652bb7b8b3fac1f8ce2e12a9dc0fb11551faa420c4cdbc60abf"}, + {file = "aiohttp-3.10.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:93a19cd1e9dc703257fda78b8e889c3a08eabaa09f6ff0d867850b03964f80d1"}, + {file = "aiohttp-3.10.4-cp310-cp310-win32.whl", hash = "sha256:8593040bcc8075fc0e817a602bc5d3d74c7bd717619ffc175a8ba0188edebadf"}, + {file = "aiohttp-3.10.4-cp310-cp310-win_amd64.whl", hash = "sha256:326fb5228aadfc395981d9b336d56a698da335897c4143105c73b583d7500839"}, + {file = "aiohttp-3.10.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:dfe48f477e02ef5ab247c6ac431a6109c69b5c24cb3ccbcd3e27c4fb39691fe4"}, + {file = "aiohttp-3.10.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f6fe78b51852e25d4e20be51ef88c2a0bf31432b9f2223bdbd61c01a0f9253a7"}, + {file = "aiohttp-3.10.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5cc75ff5efbd92301e63a157fddb18a6964a3f40e31c77d57e97dbb9bb3373b4"}, + {file = "aiohttp-3.10.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dca39391f45fbb28daa6412f98c625265bf6b512cc41382df61672d1b242f8f4"}, + {file = "aiohttp-3.10.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8616dd5ed8b3b4029021b560305041c62e080bb28f238c27c2e150abe3539587"}, + {file = "aiohttp-3.10.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9d7958ba22854b3f00a7bbb66cde1dc759760ce8a3e6dfe9ea53f06bccaa9aa2"}, + {file = "aiohttp-3.10.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a24ac7164a824ef2e8e4e9a9f6debb1f43c44ad7ad04efc6018a6610555666d"}, + {file = "aiohttp-3.10.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:660ad010b8fd0b26e8edb8ae5c036db5b16baac4278198ad238b11956d920b3d"}, + {file = "aiohttp-3.10.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:93ee83008d3e505db9846a5a1f48a002676d8dcc90ee431a9462541c9b81393c"}, + {file = "aiohttp-3.10.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:77071795efd6ba87f409001141fb05c94ee962b9fca6c8fa1f735c2718512de4"}, + {file = "aiohttp-3.10.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:ff371ae72a1816c3eeba5c9cff42cb739aaa293fec7d78f180d1c7ee342285b6"}, + {file = "aiohttp-3.10.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:c253e81f12da97f85d45441e8c6da0d9c12e07db4a7136b0a955df6fc5e4bf51"}, + {file = "aiohttp-3.10.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:2ce101c447cf7ba4b6e5ab07bfa2c0da21cbab66922f78a601f0b84fd7710d72"}, + {file = "aiohttp-3.10.4-cp311-cp311-win32.whl", hash = "sha256:705c311ecf2d30fbcf3570d1a037c657be99095694223488140c47dee4ef2460"}, + {file = "aiohttp-3.10.4-cp311-cp311-win_amd64.whl", hash = "sha256:ebddbfea8a8d6b97f717658fa85a96681a28990072710d3de3a4eba5d6804a37"}, + {file = "aiohttp-3.10.4-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:fe4d63f42d9c604521b208b754abfafe01218af4a8f6332b43196ee8fe88bbd5"}, + {file = "aiohttp-3.10.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fef7b7bd3a6911b4d148332136d34d3c2aee3d54d354373b1da6d96bc08089a5"}, + {file = "aiohttp-3.10.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fff8606149098935188fe1e135f7e7991e6a36d6fe394fd15939fc57d0aff889"}, + {file = "aiohttp-3.10.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9eb3df1aa83602be9a5e572c834d74c3c8e382208b59a873aabfe4c493c45ed0"}, + {file = "aiohttp-3.10.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5c4a71d4a5e0cbfd4bfadd13cb84fe2bc76c64d550dc4f22c22008c9354cffb3"}, + {file = "aiohttp-3.10.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bf61884a604c399458c4a42c8caea000fbcc44255ed89577ff50cb688a0fe8e2"}, + {file = "aiohttp-3.10.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2015e4b40bd5dedc8155c2b2d24a2b07963ae02b5772373d0b599a68e38a316b"}, + {file = "aiohttp-3.10.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b06e1a66bf0a1a2d0f12aef25843dfd2093df080d6c1acbc43914bb9c8f36ed3"}, + {file = "aiohttp-3.10.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:eb898c9ad5a1228a669ebe2e2ba3d76aebe1f7c10b78f09a36000254f049fc2b"}, + {file = "aiohttp-3.10.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:2d64a5a7539320c3cecb4bca093ea825fcc906f8461cf8b42a7bf3c706ce1932"}, + {file = "aiohttp-3.10.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:438c6e1492d060b21285f4b6675b941cf96dd9ef3dfdd59940561029b82e3e1f"}, + {file = "aiohttp-3.10.4-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:e99bf118afb2584848dba169a685fe092b338a4fe52ae08c7243d7bc4cc204fe"}, + {file = "aiohttp-3.10.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9dc26781fb95225c6170619dece8b5c6ca7cfb1b0be97b7ee719915773d0c2a9"}, + {file = "aiohttp-3.10.4-cp312-cp312-win32.whl", hash = "sha256:45bb655cb8b3a61e19977183a4e0962051ae90f6d46588ed4addb8232128141c"}, + {file = "aiohttp-3.10.4-cp312-cp312-win_amd64.whl", hash = "sha256:347bbdc48411badc24fe3a13565820bc742db3aa2f9127cd5f48c256caf87e29"}, + {file = "aiohttp-3.10.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:4ad284cee0fdcdc0216346b849fd53d201b510aff3c48aa3622daec9ada4bf80"}, + {file = "aiohttp-3.10.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:58df59234be7d7e80548b9482ebfeafdda21948c25cb2873c7f23870c8053dfe"}, + {file = "aiohttp-3.10.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5f52225af7f91f27b633f73473e9ef0aa8e2112d57b69eaf3aa4479e3ea3bc0e"}, + {file = "aiohttp-3.10.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:93f1a0e12c321d923c024b56d7dcd8012e60bf30a4b3fb69a88be15dcb9ab80b"}, + {file = "aiohttp-3.10.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c9e9e9a51dd12f2f71fdbd7f7230dcb75ed8f77d8ac8e07c73b599b6d7027e5c"}, + {file = "aiohttp-3.10.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:38bb515f1affc36d3d97b02bf82099925a5785c4a96066ff4400a83ad09d3d5d"}, + {file = "aiohttp-3.10.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2e685afb0e3b7b861d89cb3690d89eeda221b43095352efddaaa735c6baf87f3"}, + {file = "aiohttp-3.10.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abd5673e3391564871ba6753cf674dcf2051ef19dc508998fe0758a6c7b429a0"}, + {file = "aiohttp-3.10.4-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:4b34e5086e1ead3baa740e32adf35cc5e42338e44c4b07f7b62b41ca6d6a5bfd"}, + {file = "aiohttp-3.10.4-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:c3fd3b8f0164fb2866400cd6eb9e884ab0dc95f882cf8b25e560ace7350c552d"}, + {file = "aiohttp-3.10.4-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:b95e1694d234f27b4bbf5bdef56bb751974ac5dbe045b1e462bde1fe39421cbe"}, + {file = "aiohttp-3.10.4-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:c031de4dfabe7bb6565743745ab43d20588944ddfc7233360169cab4008eee2f"}, + {file = "aiohttp-3.10.4-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:03c5a3143d4a82c43a3d82ac77d9cdef527a72f1c04dcca7b14770879f33d196"}, + {file = "aiohttp-3.10.4-cp38-cp38-win32.whl", hash = "sha256:b71722b527445e02168e2d1cf435772731874671a647fa159ad000feea7933b6"}, + {file = "aiohttp-3.10.4-cp38-cp38-win_amd64.whl", hash = "sha256:0fd1f57aac7d01c9c768675d531976d20d5b79d9da67fac87e55d41b4ade05f9"}, + {file = "aiohttp-3.10.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:15b36a644d1f44ea3d94a0bbb71e75d5f394a3135dc388a209466e22b711ce64"}, + {file = "aiohttp-3.10.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:394ddf9d216cf0bd429b223239a0ab628f01a7a1799c93ce4685eedcdd51b9bc"}, + {file = "aiohttp-3.10.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:dd33f4d571b4143fc9318c3d9256423579c7d183635acc458a6db81919ae5204"}, + {file = "aiohttp-3.10.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5991b80886655e6c785aadf3114d4f86e6bec2da436e2bb62892b9f048450a4"}, + {file = "aiohttp-3.10.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:92021bf0a4b9ad16851a6c1ca3c86e5b09aecca4f7a2576430c6bbf3114922b1"}, + {file = "aiohttp-3.10.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:938e37fd337343c67471098736deb33066d72cec7d8927b9c1b6b4ea807ade9e"}, + {file = "aiohttp-3.10.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1d697023b16c62f9aeb3ffdfb8ec4ac3afd477388993b9164b47dadbd60e7062"}, + {file = "aiohttp-3.10.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c2f9f07fe6d0d51bd2a788cbb339f1570fd691449c53b5dec83ff838f117703e"}, + {file = "aiohttp-3.10.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:50ac670f3fc13ce95e4d6d5a299db9288cc84c663aa630142444ef504756fcf7"}, + {file = "aiohttp-3.10.4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:9bcdd19398212785a9cb82a63a4b75a299998343f3f5732dfd37c1a4275463f9"}, + {file = "aiohttp-3.10.4-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:122c26f0976225aba46f381e3cabb5ef89a08af6503fc30493fb732e578cfa55"}, + {file = "aiohttp-3.10.4-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:d0665e2a346b6b66959f831ffffd8aa71dd07dd2300017d478f5b47573e66cfe"}, + {file = "aiohttp-3.10.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:625a4a9d4b9f80e7bbaaf2ace06341cf701b2fee54232843addf0bb7304597fb"}, + {file = "aiohttp-3.10.4-cp39-cp39-win32.whl", hash = "sha256:5115490112f39f16ae87c1b34dff3e2c95306cf456b1d2af5974c4ac7d2d1ec7"}, + {file = "aiohttp-3.10.4-cp39-cp39-win_amd64.whl", hash = "sha256:9b58b2ef7f28a2462ba86acbf3b20371bd80a1faa1cfd82f31968af4ac81ef25"}, + {file = "aiohttp-3.10.4.tar.gz", hash = "sha256:23a5f97e7dd22e181967fb6cb6c3b11653b0fdbbc4bb7739d9b6052890ccab96"}, ] [package.dependencies] @@ -689,19 +689,19 @@ tqdm = ["tqdm"] [[package]] name = "furo" -version = "2024.7.18" +version = "2024.8.6" description = "A clean customisable Sphinx documentation theme." optional = false python-versions = ">=3.8" files = [ - {file = "furo-2024.7.18-py3-none-any.whl", hash = "sha256:b192c7c1f59805494c8ed606d9375fdac6e6ba8178e747e72bc116745fb7e13f"}, - {file = "furo-2024.7.18.tar.gz", hash = "sha256:37b08c5fccc95d46d8712c8be97acd46043963895edde05b0f4f135d58325c83"}, + {file = "furo-2024.8.6-py3-none-any.whl", hash = "sha256:6cd97c58b47813d3619e63e9081169880fbe331f0ca883c871ff1f3f11814f5c"}, + {file = "furo-2024.8.6.tar.gz", hash = "sha256:b63e4cee8abfc3136d3bc03a3d45a76a850bada4d6374d24c1716b0e01394a01"}, ] [package.dependencies] beautifulsoup4 = "*" pygments = ">=2.7" -sphinx = ">=6.0,<8.0" +sphinx = ">=6.0,<9.0" sphinx-basic-ng = ">=1.0.0.beta2" [[package]] @@ -1062,38 +1062,38 @@ files = [ [[package]] name = "mypy" -version = "1.11.0" +version = "1.11.1" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" files = [ - {file = "mypy-1.11.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a3824187c99b893f90c845bab405a585d1ced4ff55421fdf5c84cb7710995229"}, - {file = "mypy-1.11.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:96f8dbc2c85046c81bcddc246232d500ad729cb720da4e20fce3b542cab91287"}, - {file = "mypy-1.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1a5d8d8dd8613a3e2be3eae829ee891b6b2de6302f24766ff06cb2875f5be9c6"}, - {file = "mypy-1.11.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:72596a79bbfb195fd41405cffa18210af3811beb91ff946dbcb7368240eed6be"}, - {file = "mypy-1.11.0-cp310-cp310-win_amd64.whl", hash = "sha256:35ce88b8ed3a759634cb4eb646d002c4cef0a38f20565ee82b5023558eb90c00"}, - {file = "mypy-1.11.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:98790025861cb2c3db8c2f5ad10fc8c336ed2a55f4daf1b8b3f877826b6ff2eb"}, - {file = "mypy-1.11.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:25bcfa75b9b5a5f8d67147a54ea97ed63a653995a82798221cca2a315c0238c1"}, - {file = "mypy-1.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0bea2a0e71c2a375c9fa0ede3d98324214d67b3cbbfcbd55ac8f750f85a414e3"}, - {file = "mypy-1.11.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d2b3d36baac48e40e3064d2901f2fbd2a2d6880ec6ce6358825c85031d7c0d4d"}, - {file = "mypy-1.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:d8e2e43977f0e09f149ea69fd0556623919f816764e26d74da0c8a7b48f3e18a"}, - {file = "mypy-1.11.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:1d44c1e44a8be986b54b09f15f2c1a66368eb43861b4e82573026e04c48a9e20"}, - {file = "mypy-1.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cea3d0fb69637944dd321f41bc896e11d0fb0b0aa531d887a6da70f6e7473aba"}, - {file = "mypy-1.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a83ec98ae12d51c252be61521aa5731f5512231d0b738b4cb2498344f0b840cd"}, - {file = "mypy-1.11.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:c7b73a856522417beb78e0fb6d33ef89474e7a622db2653bc1285af36e2e3e3d"}, - {file = "mypy-1.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:f2268d9fcd9686b61ab64f077be7ffbc6fbcdfb4103e5dd0cc5eaab53a8886c2"}, - {file = "mypy-1.11.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:940bfff7283c267ae6522ef926a7887305945f716a7704d3344d6d07f02df850"}, - {file = "mypy-1.11.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:14f9294528b5f5cf96c721f231c9f5b2733164e02c1c018ed1a0eff8a18005ac"}, - {file = "mypy-1.11.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d7b54c27783991399046837df5c7c9d325d921394757d09dbcbf96aee4649fe9"}, - {file = "mypy-1.11.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:65f190a6349dec29c8d1a1cd4aa71284177aee5949e0502e6379b42873eddbe7"}, - {file = "mypy-1.11.0-cp38-cp38-win_amd64.whl", hash = "sha256:dbe286303241fea8c2ea5466f6e0e6a046a135a7e7609167b07fd4e7baf151bf"}, - {file = "mypy-1.11.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:104e9c1620c2675420abd1f6c44bab7dd33cc85aea751c985006e83dcd001095"}, - {file = "mypy-1.11.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f006e955718ecd8d159cee9932b64fba8f86ee6f7728ca3ac66c3a54b0062abe"}, - {file = "mypy-1.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:becc9111ca572b04e7e77131bc708480cc88a911adf3d0239f974c034b78085c"}, - {file = "mypy-1.11.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6801319fe76c3f3a3833f2b5af7bd2c17bb93c00026a2a1b924e6762f5b19e13"}, - {file = "mypy-1.11.0-cp39-cp39-win_amd64.whl", hash = "sha256:c1a184c64521dc549324ec6ef7cbaa6b351912be9cb5edb803c2808a0d7e85ac"}, - {file = "mypy-1.11.0-py3-none-any.whl", hash = "sha256:56913ec8c7638b0091ef4da6fcc9136896914a9d60d54670a75880c3e5b99ace"}, - {file = "mypy-1.11.0.tar.gz", hash = "sha256:93743608c7348772fdc717af4aeee1997293a1ad04bc0ea6efa15bf65385c538"}, + {file = "mypy-1.11.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a32fc80b63de4b5b3e65f4be82b4cfa362a46702672aa6a0f443b4689af7008c"}, + {file = "mypy-1.11.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c1952f5ea8a5a959b05ed5f16452fddadbaae48b5d39235ab4c3fc444d5fd411"}, + {file = "mypy-1.11.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e1e30dc3bfa4e157e53c1d17a0dad20f89dc433393e7702b813c10e200843b03"}, + {file = "mypy-1.11.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2c63350af88f43a66d3dfeeeb8d77af34a4f07d760b9eb3a8697f0386c7590b4"}, + {file = "mypy-1.11.1-cp310-cp310-win_amd64.whl", hash = "sha256:a831671bad47186603872a3abc19634f3011d7f83b083762c942442d51c58d58"}, + {file = "mypy-1.11.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7b6343d338390bb946d449677726edf60102a1c96079b4f002dedff375953fc5"}, + {file = "mypy-1.11.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e4fe9f4e5e521b458d8feb52547f4bade7ef8c93238dfb5bbc790d9ff2d770ca"}, + {file = "mypy-1.11.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:886c9dbecc87b9516eff294541bf7f3655722bf22bb898ee06985cd7269898de"}, + {file = "mypy-1.11.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:fca4a60e1dd9fd0193ae0067eaeeb962f2d79e0d9f0f66223a0682f26ffcc809"}, + {file = "mypy-1.11.1-cp311-cp311-win_amd64.whl", hash = "sha256:0bd53faf56de9643336aeea1c925012837432b5faf1701ccca7fde70166ccf72"}, + {file = "mypy-1.11.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f39918a50f74dc5969807dcfaecafa804fa7f90c9d60506835036cc1bc891dc8"}, + {file = "mypy-1.11.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0bc71d1fb27a428139dd78621953effe0d208aed9857cb08d002280b0422003a"}, + {file = "mypy-1.11.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b868d3bcff720dd7217c383474008ddabaf048fad8d78ed948bb4b624870a417"}, + {file = "mypy-1.11.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a707ec1527ffcdd1c784d0924bf5cb15cd7f22683b919668a04d2b9c34549d2e"}, + {file = "mypy-1.11.1-cp312-cp312-win_amd64.whl", hash = "sha256:64f4a90e3ea07f590c5bcf9029035cf0efeae5ba8be511a8caada1a4893f5525"}, + {file = "mypy-1.11.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:749fd3213916f1751fff995fccf20c6195cae941dc968f3aaadf9bb4e430e5a2"}, + {file = "mypy-1.11.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b639dce63a0b19085213ec5fdd8cffd1d81988f47a2dec7100e93564f3e8fb3b"}, + {file = "mypy-1.11.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4c956b49c5d865394d62941b109728c5c596a415e9c5b2be663dd26a1ff07bc0"}, + {file = "mypy-1.11.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:45df906e8b6804ef4b666af29a87ad9f5921aad091c79cc38e12198e220beabd"}, + {file = "mypy-1.11.1-cp38-cp38-win_amd64.whl", hash = "sha256:d44be7551689d9d47b7abc27c71257adfdb53f03880841a5db15ddb22dc63edb"}, + {file = "mypy-1.11.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2684d3f693073ab89d76da8e3921883019ea8a3ec20fa5d8ecca6a2db4c54bbe"}, + {file = "mypy-1.11.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:79c07eb282cb457473add5052b63925e5cc97dfab9812ee65a7c7ab5e3cb551c"}, + {file = "mypy-1.11.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:11965c2f571ded6239977b14deebd3f4c3abd9a92398712d6da3a772974fad69"}, + {file = "mypy-1.11.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a2b43895a0f8154df6519706d9bca8280cda52d3d9d1514b2d9c3e26792a0b74"}, + {file = "mypy-1.11.1-cp39-cp39-win_amd64.whl", hash = "sha256:1a81cf05975fd61aec5ae16501a091cfb9f605dc3e3c878c0da32f250b74760b"}, + {file = "mypy-1.11.1-py3-none-any.whl", hash = "sha256:0624bdb940255d2dd24e829d99a13cfeb72e4e9031f9492148f410ed30bcab54"}, + {file = "mypy-1.11.1.tar.gz", hash = "sha256:f404a0b069709f18bbdb702eb3dcfe51910602995de00bd39cea3050b5772d08"}, ] [package.dependencies] @@ -1502,29 +1502,29 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "ruff" -version = "0.5.6" +version = "0.6.1" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.5.6-py3-none-linux_armv6l.whl", hash = "sha256:a0ef5930799a05522985b9cec8290b185952f3fcd86c1772c3bdbd732667fdcd"}, - {file = "ruff-0.5.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b652dc14f6ef5d1552821e006f747802cc32d98d5509349e168f6bf0ee9f8f42"}, - {file = "ruff-0.5.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:80521b88d26a45e871f31e4b88938fd87db7011bb961d8afd2664982dfc3641a"}, - {file = "ruff-0.5.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d9bc8f328a9f1309ae80e4d392836e7dbc77303b38ed4a7112699e63d3b066ab"}, - {file = "ruff-0.5.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4d394940f61f7720ad371ddedf14722ee1d6250fd8d020f5ea5a86e7be217daf"}, - {file = "ruff-0.5.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:111a99cdb02f69ddb2571e2756e017a1496c2c3a2aeefe7b988ddab38b416d36"}, - {file = "ruff-0.5.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:e395daba77a79f6dc0d07311f94cc0560375ca20c06f354c7c99af3bf4560c5d"}, - {file = "ruff-0.5.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c476acb43c3c51e3c614a2e878ee1589655fa02dab19fe2db0423a06d6a5b1b6"}, - {file = "ruff-0.5.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e2ff8003f5252fd68425fd53d27c1f08b201d7ed714bb31a55c9ac1d4c13e2eb"}, - {file = "ruff-0.5.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c94e084ba3eaa80c2172918c2ca2eb2230c3f15925f4ed8b6297260c6ef179ad"}, - {file = "ruff-0.5.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:1f77c1c3aa0669fb230b06fb24ffa3e879391a3ba3f15e3d633a752da5a3e670"}, - {file = "ruff-0.5.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f908148c93c02873210a52cad75a6eda856b2cbb72250370ce3afef6fb99b1ed"}, - {file = "ruff-0.5.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:563a7ae61ad284187d3071d9041c08019975693ff655438d8d4be26e492760bd"}, - {file = "ruff-0.5.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:94fe60869bfbf0521e04fd62b74cbca21cbc5beb67cbb75ab33fe8c174f54414"}, - {file = "ruff-0.5.6-py3-none-win32.whl", hash = "sha256:e6a584c1de6f8591c2570e171cc7ce482bb983d49c70ddf014393cd39e9dfaed"}, - {file = "ruff-0.5.6-py3-none-win_amd64.whl", hash = "sha256:d7fe7dccb1a89dc66785d7aa0ac283b2269712d8ed19c63af908fdccca5ccc1a"}, - {file = "ruff-0.5.6-py3-none-win_arm64.whl", hash = "sha256:57c6c0dd997b31b536bff49b9eee5ed3194d60605a4427f735eeb1f9c1b8d264"}, - {file = "ruff-0.5.6.tar.gz", hash = "sha256:07c9e3c2a8e1fe377dd460371c3462671a728c981c3205a5217291422209f642"}, + {file = "ruff-0.6.1-py3-none-linux_armv6l.whl", hash = "sha256:b4bb7de6a24169dc023f992718a9417380301b0c2da0fe85919f47264fb8add9"}, + {file = "ruff-0.6.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:45efaae53b360c81043e311cdec8a7696420b3d3e8935202c2846e7a97d4edae"}, + {file = "ruff-0.6.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:bc60c7d71b732c8fa73cf995efc0c836a2fd8b9810e115be8babb24ae87e0850"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2c7477c3b9da822e2db0b4e0b59e61b8a23e87886e727b327e7dcaf06213c5cf"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3a0af7ab3f86e3dc9f157a928e08e26c4b40707d0612b01cd577cc84b8905cc9"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:392688dbb50fecf1bf7126731c90c11a9df1c3a4cdc3f481b53e851da5634fa5"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:5278d3e095ccc8c30430bcc9bc550f778790acc211865520f3041910a28d0024"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fe6d5f65d6f276ee7a0fc50a0cecaccb362d30ef98a110f99cac1c7872df2f18"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2e0dd11e2ae553ee5c92a81731d88a9883af8db7408db47fc81887c1f8b672e"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d812615525a34ecfc07fd93f906ef5b93656be01dfae9a819e31caa6cfe758a1"}, + {file = "ruff-0.6.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:faaa4060f4064c3b7aaaa27328080c932fa142786f8142aff095b42b6a2eb631"}, + {file = "ruff-0.6.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:99d7ae0df47c62729d58765c593ea54c2546d5de213f2af2a19442d50a10cec9"}, + {file = "ruff-0.6.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9eb18dfd7b613eec000e3738b3f0e4398bf0153cb80bfa3e351b3c1c2f6d7b15"}, + {file = "ruff-0.6.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:c62bc04c6723a81e25e71715aa59489f15034d69bf641df88cb38bdc32fd1dbb"}, + {file = "ruff-0.6.1-py3-none-win32.whl", hash = "sha256:9fb4c4e8b83f19c9477a8745e56d2eeef07a7ff50b68a6998f7d9e2e3887bdc4"}, + {file = "ruff-0.6.1-py3-none-win_amd64.whl", hash = "sha256:c2ebfc8f51ef4aca05dad4552bbcf6fe8d1f75b2f6af546cc47cc1c1ca916b5b"}, + {file = "ruff-0.6.1-py3-none-win_arm64.whl", hash = "sha256:3bc81074971b0ffad1bd0c52284b22411f02a11a012082a76ac6da153536e014"}, + {file = "ruff-0.6.1.tar.gz", hash = "sha256:af3ffd8c6563acb8848d33cd19a69b9bfe943667f0419ca083f8ebe4224a3436"}, ] [[package]] @@ -2167,4 +2167,4 @@ hf = ["huggingface-hub"] [metadata] lock-version = "2.0" python-versions = ">= 3.9, < 4.0" -content-hash = "566213ea14004fd0c4a9af91b6304a68574a81fe582cd1b2847b41b720b78b7b" +content-hash = "09e750ae7033c706f00aa064dcf7c949e4bb235eaa95a666f2d5ca6e9da7bb6b" diff --git a/clients/python/pyproject.toml b/clients/python/pyproject.toml index c0d67f81..f1383029 100644 --- a/clients/python/pyproject.toml +++ b/clients/python/pyproject.toml @@ -45,7 +45,7 @@ sphinx-autobuild = ">=2021.3.14,<2025.0.0" pytest = ">=7.4.2,<9.0.0" coverage = { extras = ["toml"], version = "^7.3.2" } pytest-cov = ">=4.1,<6.0" -ruff = "^0.5.2" +ruff = ">=0.5.2,<0.7.0" mypy = "^1.7.0" pytest-asyncio = "^0.23.7" requests = "^2.32.2" diff --git a/clients/python/src/model_registry/core.py b/clients/python/src/model_registry/core.py index 4586668f..750dc43c 100644 --- a/clients/python/src/model_registry/core.py +++ b/clients/python/src/model_registry/core.py @@ -7,6 +7,8 @@ from dataclasses import dataclass from typing import TypeVar, cast +from typing_extensions import overload + from mr_openapi import ( ApiClient, Configuration, @@ -15,7 +17,6 @@ from mr_openapi import ( exceptions as mr_exceptions, ) -from typing_extensions import overload from ._utils import required_args from .types import ( diff --git a/clients/python/src/model_registry/types/artifacts.py b/clients/python/src/model_registry/types/artifacts.py index 4bb4af4e..64f5a974 100644 --- a/clients/python/src/model_registry/types/artifacts.py +++ b/clients/python/src/model_registry/types/artifacts.py @@ -15,6 +15,8 @@ from abc import ABC, abstractmethod from typing import Any, TypeVar +from typing_extensions import override + from mr_openapi import ( Artifact as ArtifactBaseModel, ) @@ -29,7 +31,6 @@ from mr_openapi import ( ModelArtifact as ModelArtifactBaseModel, ) -from typing_extensions import override from .base import BaseResourceModel diff --git a/clients/python/src/model_registry/types/base.py b/clients/python/src/model_registry/types/base.py index 5a69e18c..bf1b8dd9 100644 --- a/clients/python/src/model_registry/types/base.py +++ b/clients/python/src/model_registry/types/base.py @@ -6,9 +6,10 @@ from collections.abc import Sequence from typing import Any, Union, get_args -from mr_openapi.models.metadata_value import MetadataValue from pydantic import BaseModel, ConfigDict +from mr_openapi.models.metadata_value import MetadataValue + SupportedTypes = Union[bool, int, float, str] diff --git a/clients/python/src/model_registry/types/contexts.py b/clients/python/src/model_registry/types/contexts.py index 0d55114f..2d50c423 100644 --- a/clients/python/src/model_registry/types/contexts.py +++ b/clients/python/src/model_registry/types/contexts.py @@ -11,6 +11,8 @@ from __future__ import annotations +from typing_extensions import override + from mr_openapi import ( ModelVersion as ModelVersionBaseModel, ) @@ -25,7 +27,6 @@ from mr_openapi import ( RegisteredModel as RegisteredModelBaseModel, ) -from typing_extensions import override from .base import BaseResourceModel diff --git a/clients/python/src/mr_openapi/api_client.py b/clients/python/src/mr_openapi/api_client.py index 9ab240bb..b10fb38e 100644 --- a/clients/python/src/mr_openapi/api_client.py +++ b/clients/python/src/mr_openapi/api_client.py @@ -309,20 +309,20 @@ def sanitize_for_serialization(self, obj): """ if obj is None: return None - elif isinstance(obj, Enum): + if isinstance(obj, Enum): return obj.value - elif isinstance(obj, SecretStr): + if isinstance(obj, SecretStr): return obj.get_secret_value() - elif isinstance(obj, self.PRIMITIVE_TYPES): + if isinstance(obj, self.PRIMITIVE_TYPES): return obj - elif isinstance(obj, list): + if isinstance(obj, list): return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] - elif isinstance(obj, tuple): + if isinstance(obj, tuple): return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): + if isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - elif isinstance(obj, dict): + if isinstance(obj, dict): obj_dict = obj else: # Convert model obj to dict except @@ -386,16 +386,15 @@ def __deserialize(self, data, klass): if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) - elif klass == object: + if klass == object: return self.__deserialize_object(data) - elif klass == datetime.date: + if klass == datetime.date: return self.__deserialize_date(data) - elif klass == datetime.datetime: + if klass == datetime.datetime: return self.__deserialize_datetime(data) - elif issubclass(klass, Enum): + if issubclass(klass, Enum): return self.__deserialize_enum(data, klass) - else: - return self.__deserialize_model(data, klass) + return self.__deserialize_model(data, klass) def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. diff --git a/clients/python/src/mr_openapi/configuration.py b/clients/python/src/mr_openapi/configuration.py index f31a0730..6b6a378a 100644 --- a/clients/python/src/mr_openapi/configuration.py +++ b/clients/python/src/mr_openapi/configuration.py @@ -338,8 +338,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): prefix = self.api_key_prefix.get(identifier) if prefix: return f"{prefix} {key}" - else: - return key + return key return None def auth_settings(self): diff --git a/clients/python/src/mr_openapi/models/artifact.py b/clients/python/src/mr_openapi/models/artifact.py index 6e2e7948..52feaf37 100644 --- a/clients/python/src/mr_openapi/models/artifact.py +++ b/clients/python/src/mr_openapi/models/artifact.py @@ -78,14 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): "Multiple matches found when setting `actual_instance` in Artifact with oneOf schemas: DocArtifact, ModelArtifact. Details: " + ", ".join(error_messages) ) - elif match == 0: + if match == 0: # no match raise ValueError( "No match found when setting `actual_instance` in Artifact with oneOf schemas: DocArtifact, ModelArtifact. Details: " + ", ".join(error_messages) ) - else: - return v + return v @classmethod def from_dict(cls, obj: str | dict[str, Any]) -> Self: @@ -143,14 +142,13 @@ def from_json(cls, json_str: str) -> Self: "Multiple matches found when deserializing the JSON string into Artifact with oneOf schemas: DocArtifact, ModelArtifact. Details: " + ", ".join(error_messages) ) - elif match == 0: + if match == 0: # no match raise ValueError( "No match found when deserializing the JSON string into Artifact with oneOf schemas: DocArtifact, ModelArtifact. Details: " + ", ".join(error_messages) ) - else: - return instance + return instance def to_json(self) -> str: """Returns the JSON representation of the actual instance.""" @@ -159,8 +157,7 @@ def to_json(self) -> str: if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) + return json.dumps(self.actual_instance) def to_dict(self) -> dict[str, Any] | DocArtifact | ModelArtifact | None: """Returns the dict representation of the actual instance.""" @@ -169,9 +166,8 @@ def to_dict(self) -> dict[str, Any] | DocArtifact | ModelArtifact | None: if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance.""" diff --git a/clients/python/src/mr_openapi/models/metadata_value.py b/clients/python/src/mr_openapi/models/metadata_value.py index b5d13e20..a5f12684 100644 --- a/clients/python/src/mr_openapi/models/metadata_value.py +++ b/clients/python/src/mr_openapi/models/metadata_value.py @@ -132,14 +132,13 @@ def actual_instance_must_validate_oneof(cls, v): "Multiple matches found when setting `actual_instance` in MetadataValue with oneOf schemas: MetadataBoolValue, MetadataDoubleValue, MetadataIntValue, MetadataProtoValue, MetadataStringValue, MetadataStructValue. Details: " + ", ".join(error_messages) ) - elif match == 0: + if match == 0: # no match raise ValueError( "No match found when setting `actual_instance` in MetadataValue with oneOf schemas: MetadataBoolValue, MetadataDoubleValue, MetadataIntValue, MetadataProtoValue, MetadataStringValue, MetadataStructValue. Details: " + ", ".join(error_messages) ) - else: - return v + return v @classmethod def from_dict(cls, obj: str | dict[str, Any]) -> Self: @@ -231,14 +230,13 @@ def from_json(cls, json_str: str) -> Self: "Multiple matches found when deserializing the JSON string into MetadataValue with oneOf schemas: MetadataBoolValue, MetadataDoubleValue, MetadataIntValue, MetadataProtoValue, MetadataStringValue, MetadataStructValue. Details: " + ", ".join(error_messages) ) - elif match == 0: + if match == 0: # no match raise ValueError( "No match found when deserializing the JSON string into MetadataValue with oneOf schemas: MetadataBoolValue, MetadataDoubleValue, MetadataIntValue, MetadataProtoValue, MetadataStringValue, MetadataStructValue. Details: " + ", ".join(error_messages) ) - else: - return instance + return instance def to_json(self) -> str: """Returns the JSON representation of the actual instance.""" @@ -247,8 +245,7 @@ def to_json(self) -> str: if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) + return json.dumps(self.actual_instance) def to_dict( self, @@ -268,9 +265,8 @@ def to_dict( if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance + # primitive type + return self.actual_instance def to_str(self) -> str: """Returns the string representation of the actual instance.""" diff --git a/clients/python/src/mr_openapi/models/model_version.py b/clients/python/src/mr_openapi/models/model_version.py index 7dc71d0b..36de708d 100644 --- a/clients/python/src/mr_openapi/models/model_version.py +++ b/clients/python/src/mr_openapi/models/model_version.py @@ -36,9 +36,8 @@ class ModelVersion(BaseModel): description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", alias="externalId", ) - name: StrictStr | None = Field( - default=None, - description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + name: StrictStr = Field( + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set." ) state: ModelVersionState | None = None author: StrictStr | None = Field(default=None, description="Name of the author.") diff --git a/clients/python/src/mr_openapi/models/model_version_create.py b/clients/python/src/mr_openapi/models/model_version_create.py index 4688aa66..ec0cbf2d 100644 --- a/clients/python/src/mr_openapi/models/model_version_create.py +++ b/clients/python/src/mr_openapi/models/model_version_create.py @@ -36,9 +36,8 @@ class ModelVersionCreate(BaseModel): description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", alias="externalId", ) - name: StrictStr | None = Field( - default=None, - description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + name: StrictStr = Field( + description="The client provided name of the model's version. It must be unique among all the ModelVersions of the same type within a Model Registry instance and cannot be changed once set." ) state: ModelVersionState | None = None author: StrictStr | None = Field(default=None, description="Name of the author.") diff --git a/clients/python/src/mr_openapi/models/registered_model.py b/clients/python/src/mr_openapi/models/registered_model.py index e8fa9705..60401602 100644 --- a/clients/python/src/mr_openapi/models/registered_model.py +++ b/clients/python/src/mr_openapi/models/registered_model.py @@ -36,9 +36,8 @@ class RegisteredModel(BaseModel): description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", alias="externalId", ) - name: StrictStr | None = Field( - default=None, - description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + name: StrictStr = Field( + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set." ) id: StrictStr | None = Field( default=None, description="Output only. The unique server generated id of the resource." diff --git a/clients/python/src/mr_openapi/models/registered_model_create.py b/clients/python/src/mr_openapi/models/registered_model_create.py index dcec5693..29515e51 100644 --- a/clients/python/src/mr_openapi/models/registered_model_create.py +++ b/clients/python/src/mr_openapi/models/registered_model_create.py @@ -36,9 +36,8 @@ class RegisteredModelCreate(BaseModel): description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", alias="externalId", ) - name: StrictStr | None = Field( - default=None, - description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + name: StrictStr = Field( + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set." ) owner: StrictStr | None = None state: RegisteredModelState | None = None diff --git a/clients/python/tests/basic_test.py b/clients/python/tests/basic_test.py index 8c0a87ec..96f6639d 100644 --- a/clients/python/tests/basic_test.py +++ b/clients/python/tests/basic_test.py @@ -1,7 +1,8 @@ """Tests creation and retrieval of base models.""" -import mr_openapi import pytest + +import mr_openapi from mr_openapi import ( Artifact, DocArtifact, @@ -14,7 +15,7 @@ from .conftest import REGISTRY_URL, cleanup -@pytest.fixture() +@pytest.fixture @cleanup async def client(): config = mr_openapi.Configuration(REGISTRY_URL) @@ -24,12 +25,12 @@ async def client(): await api_client.close() -@pytest.fixture() +@pytest.fixture def rm_create() -> RegisteredModelCreate: return RegisteredModelCreate(name="registered", description="a registered model") -@pytest.fixture() +@pytest.fixture async def mv_create(client, rm_create) -> ModelVersionCreate: # HACK: create an RM first because we need an ID for the instance rm = await client.create_registered_model(rm_create) diff --git a/clients/python/tests/test_client.py b/clients/python/tests/test_client.py index aa8ab39f..8b459c09 100644 --- a/clients/python/tests/test_client.py +++ b/clients/python/tests/test_client.py @@ -2,13 +2,14 @@ from itertools import islice import pytest + from model_registry import ModelRegistry, utils from model_registry.exceptions import StoreError from .conftest import REGISTRY_HOST, REGISTRY_PORT, cleanup -@pytest.fixture() +@pytest.fixture @cleanup def client() -> ModelRegistry: return ModelRegistry(REGISTRY_HOST, REGISTRY_PORT, author="author", is_secure=False) diff --git a/clients/python/tests/test_core.py b/clients/python/tests/test_core.py index 27463838..784e94ec 100644 --- a/clients/python/tests/test_core.py +++ b/clients/python/tests/test_core.py @@ -1,6 +1,7 @@ """Tests for user facing model registry APIs.""" import pytest + from model_registry.core import ModelRegistryAPIClient from model_registry.types import ( DocArtifact, @@ -13,7 +14,7 @@ from .conftest import REGISTRY_HOST, REGISTRY_PORT, cleanup -@pytest.fixture() +@pytest.fixture @cleanup def client(): return ModelRegistryAPIClient.insecure_connection(REGISTRY_HOST, REGISTRY_PORT) @@ -41,7 +42,7 @@ async def test_update_registered_model(client: ModelRegistryAPIClient): assert rm.last_update_time_since_epoch != last_update -@pytest.fixture() +@pytest.fixture async def registered_model(client: ModelRegistryAPIClient) -> RegisteredModel: return await client.upsert_registered_model( RegisteredModel(name="registered", external_id="mr id") @@ -126,7 +127,7 @@ async def test_update_model_version( assert mv.last_update_time_since_epoch != last_update -@pytest.fixture() +@pytest.fixture async def model_version( client: ModelRegistryAPIClient, registered_model: RegisteredModel ) -> ModelVersion: @@ -240,7 +241,7 @@ async def test_update_model_artifact( assert ma.last_update_time_since_epoch != last_update -@pytest.fixture() +@pytest.fixture async def model( client: ModelRegistryAPIClient, model_version: ModelVersion, diff --git a/clients/python/tests/test_utils.py b/clients/python/tests/test_utils.py index a29f04f3..84ecefec 100644 --- a/clients/python/tests/test_utils.py +++ b/clients/python/tests/test_utils.py @@ -1,6 +1,7 @@ import os import pytest + from model_registry.exceptions import MissingMetadata from model_registry.utils import s3_uri_from diff --git a/clients/ui/bff/api/model_registry_handler.go b/clients/ui/bff/api/model_registry_handler.go index eb1396ba..5a99b84f 100644 --- a/clients/ui/bff/api/model_registry_handler.go +++ b/clients/ui/bff/api/model_registry_handler.go @@ -7,7 +7,7 @@ import ( func (app *App) ModelRegistryHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - registries, err := app.models.ModelRegistry.FetchAllModelRegistry(app.kubernetesClient) + registries, err := app.models.ModelRegistry.FetchAllModelRegistries(app.kubernetesClient) if err != nil { app.serverErrorResponse(w, r, err) return diff --git a/clients/ui/bff/api/model_registry_handler_test.go b/clients/ui/bff/api/model_registry_handler_test.go index 47a91b6c..8f05372e 100644 --- a/clients/ui/bff/api/model_registry_handler_test.go +++ b/clients/ui/bff/api/model_registry_handler_test.go @@ -39,15 +39,15 @@ func TestModelRegistryHandler(t *testing.T) { actualModelRegistry := make([]data.ModelRegistryModel, 0) for _, v := range modelRegistryRes["model_registry"].([]interface{}) { model := v.(map[string]interface{}) - actualModelRegistry = append(actualModelRegistry, data.ModelRegistryModel{Name: model["name"].(string)}) + actualModelRegistry = append(actualModelRegistry, data.ModelRegistryModel{Name: model["name"].(string), Description: model["description"].(string), DisplayName: model["displayName"].(string)}) } modelRegistryRes["model_registry"] = actualModelRegistry var expected = Envelope{ "model_registry": []data.ModelRegistryModel{ - {Name: "model-registry"}, - {Name: "model-registry-dora"}, - {Name: "model-registry-bella"}, + {Name: "model-registry", Description: "Model registry description", DisplayName: "Model Registry"}, + {Name: "model-registry-dora", Description: "Model registry dora description", DisplayName: "Model Registry Dora"}, + {Name: "model-registry-bella", Description: "Model registry bella description", DisplayName: "Model Registry Bella"}, }, } diff --git a/clients/ui/bff/data/model_registry.go b/clients/ui/bff/data/model_registry.go index b15014a4..15f4516b 100644 --- a/clients/ui/bff/data/model_registry.go +++ b/clients/ui/bff/data/model_registry.go @@ -7,20 +7,24 @@ import ( ) type ModelRegistryModel struct { - Name string `json:"name"` + Name string `json:"name"` + DisplayName string `json:"displayName"` + Description string `json:"description"` } -func (m ModelRegistryModel) FetchAllModelRegistry(client k8s.KubernetesClientInterface) ([]ModelRegistryModel, error) { +func (m ModelRegistryModel) FetchAllModelRegistries(client k8s.KubernetesClientInterface) ([]ModelRegistryModel, error) { - resources, err := client.GetServiceNames() + resources, err := client.GetServiceDetails() if err != nil { return nil, fmt.Errorf("error fetching model registries: %w", err) } - var registries []ModelRegistryModel = []ModelRegistryModel{} + var registries []ModelRegistryModel for _, item := range resources { registry := ModelRegistryModel{ - Name: item, + Name: item.Name, + Description: item.Description, + DisplayName: item.DisplayName, } registries = append(registries, registry) } diff --git a/clients/ui/bff/data/model_registry_test.go b/clients/ui/bff/data/model_registry_test.go index 0a8bb543..4f137edd 100644 --- a/clients/ui/bff/data/model_registry_test.go +++ b/clients/ui/bff/data/model_registry_test.go @@ -11,14 +11,14 @@ func TestFetchAllModelRegistry(t *testing.T) { model := ModelRegistryModel{} - registries, err := model.FetchAllModelRegistry(mockK8sClient) + registries, err := model.FetchAllModelRegistries(mockK8sClient) assert.NoError(t, err) expectedRegistries := []ModelRegistryModel{ - {Name: "model-registry"}, - {Name: "model-registry-dora"}, - {Name: "model-registry-bella"}, + {Name: "model-registry", Description: "Model registry description", DisplayName: "Model Registry"}, + {Name: "model-registry-dora", Description: "Model registry dora description", DisplayName: "Model Registry Dora"}, + {Name: "model-registry-bella", Description: "Model registry bella description", DisplayName: "Model Registry Bella"}, } assert.Equal(t, expectedRegistries, registries) diff --git a/clients/ui/bff/docs/dev-guide.md b/clients/ui/bff/docs/dev-guide.md new file mode 100644 index 00000000..01e5fab9 --- /dev/null +++ b/clients/ui/bff/docs/dev-guide.md @@ -0,0 +1,85 @@ +# Development Guide + +## Local kubernetes deployment of Model Registry +To test the BFF locally without mocking the k8s calls the Model Registry backend can be deployed locally using kind. + +### Prerequisites +The following tools need to be installed in your local environment: +* Podman (Docker should also work) - [Podman Desktop Instructions](https://podman-desktop.io) +* kubectl - [Instructions](https://kubernetes.io/docs/tasks/tools/#kubectl) +* kind - [Instructions](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) + +Note: all of the above tools can be installed using your OS package manager, this is the preferred method. + +### Setup +#### 1. Create a kind cluster +Create a local cluster for running the MR backend using the following command: +```shell +kind create cluster +``` + +Kind will start creating a new local cluster for you to deploy, once it has completed verify you can access the cluster +using kubectl by running: +```shell +kubectl cluster-info +``` + +If everything is working correctly you should see output similar to: +``` +Kubernetes control plane is running at https://127.0.0.1:58635 +CoreDNS is running at https://127.0.0.1:58635/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy +``` + +#### 2. Create kubeflow namespace +Create a namespace for model registry to run in, by default this is kubeflow, run: +```shell +kubectl create namespace kubeflow +``` + +#### 3. Deploy Model Registry to cluster +You can now deploy the MR backend to your newly created cluster using the kustomize configs in the MR repository by +running: +```shell +kubectl apply -k "https://github.com/kubeflow/model-registry/manifests/kustomize/overlays/db" +``` + +Wait for the model registry deployment to spin up, alternatively run: +```shell +kubectl wait --for=condition=available -n kubeflow deployment/model-registry-deployment --timeout=1m +``` +This command will return when the cluster is ready. To verify this now run: +```shell +kubectl get pods -n kubeflow +``` +Two pods should be listed, `model-registry-db-xxx` and `model-registry-deployment-yyy` both should have a status of `Running`. + +##### NOTE: Issues running on arm64 architecture +There is currently an issue deploying to an arm64 device such as a Mac with an M-series chip. This is because the MySql +image tag deployed by the manifests does not have an arm64 compatible image. To work around this you can use a modified +manifest deployed in a fork of the repo - you can use this by running the below command instead of the first command in +section 3 of this guide. +```shell +kubectl apply -k "https://github.com/alexcreasy/model-registry/manifests/kustomize/overlays/db?ref=kind" +``` +Note: an issue has been filed regarding this ticket here: +* [#266 Cannot deploy to k8s on AArch64 nodes using manifests in repo](https://github.com/kubeflow/model-registry/issues/266) + +#### 4. Setup a port forward to the service +In order to access the MR REST API locally you need to forward a local port to 8080 on the MR service. Run the following +command: +```shell +kubectl port-forward svc/model-registry-service -n kubeflow 8080:8080 +``` + +Note: you can change the local forwarded port by changing the first port value, e.g. `4000:8080` will forward port 4000 +to the MR service. + +#### 5. Test the service +In a separate terminal window to the previous step, test the service by querying one of the rest endpoints, for example: +```shell +curl http://localhost:8080/api/model_registry/v1alpha3/registered_models +``` +You should receive a 200 response if everything is working correctly, the body should look like: +```json +{"items":[],"nextPageToken":"","pageSize":0,"size":0} +``` \ No newline at end of file diff --git a/clients/ui/bff/integrations/k8s.go b/clients/ui/bff/integrations/k8s.go index 15d83ecb..126f962f 100644 --- a/clients/ui/bff/integrations/k8s.go +++ b/clients/ui/bff/integrations/k8s.go @@ -13,13 +13,16 @@ import ( type KubernetesClientInterface interface { GetServiceNames() ([]string, error) GetServiceDetailsByName(serviceName string) (ServiceDetails, error) + GetServiceDetails() ([]ServiceDetails, error) BearerToken() (string, error) } type ServiceDetails struct { - Name string - ClusterIP string - HTTPPort int32 + Name string + DisplayName string + Description string + ClusterIP string + HTTPPort int32 } type KubernetesClient struct { @@ -79,7 +82,6 @@ func buildModelRegistryServiceCache(logger *slog.Logger, services v1.ServiceList serviceCache := make(map[string]ServiceDetails) for _, service := range services.Items { if svcComponent, exists := service.Spec.Selector["component"]; exists && svcComponent == "model-registry-server" { - var httpPort int32 hasHTTPPort := false for _, port := range service.Spec.Ports { @@ -98,6 +100,8 @@ func buildModelRegistryServiceCache(logger *slog.Logger, services v1.ServiceList continue } + //TODO (acreasy) DisplayName and Description need to be included and not given a zero value once we + // know how this will be implemented. serviceCache[service.Name] = ServiceDetails{ Name: service.Name, ClusterIP: service.Spec.ClusterIP, @@ -123,6 +127,21 @@ func (kc *KubernetesClient) GetServiceNames() ([]string, error) { return serviceNames, nil } +func (kc *KubernetesClient) GetServiceDetails() ([]ServiceDetails, error) { + var services []ServiceDetails + + for _, service := range kc.ServiceCache { + if service.Name != "" { + services = append(services, ServiceDetails{ + Name: service.Name, + DisplayName: service.DisplayName, + Description: service.Description, + }) + } + } + return services, nil +} + func (kc *KubernetesClient) GetServiceDetailsByName(serviceName string) (ServiceDetails, error) { service, exists := kc.ServiceCache[serviceName] diff --git a/clients/ui/bff/internals/mocks/k8s_mock.go b/clients/ui/bff/internals/mocks/k8s_mock.go index 5652ed54..abbe4610 100644 --- a/clients/ui/bff/internals/mocks/k8s_mock.go +++ b/clients/ui/bff/internals/mocks/k8s_mock.go @@ -18,6 +18,14 @@ func (m *KubernetesClientMock) GetServiceNames() ([]string, error) { return []string{"model-registry", "model-registry-dora", "model-registry-bella"}, nil } +func (m *KubernetesClientMock) GetServiceDetails() ([]k8s.ServiceDetails, error) { + return []k8s.ServiceDetails{ + {Name: "model-registry", Description: "Model registry description", DisplayName: "Model Registry"}, + {Name: "model-registry-dora", Description: "Model registry dora description", DisplayName: "Model Registry Dora"}, + {Name: "model-registry-bella", Description: "Model registry bella description", DisplayName: "Model Registry Bella"}, + }, nil +} + func (m *KubernetesClientMock) BearerToken() (string, error) { return "FAKE BEARER TOKEN", nil } diff --git a/clients/ui/frontend/package-lock.json b/clients/ui/frontend/package-lock.json index 16ab1210..4da51909 100644 --- a/clients/ui/frontend/package-lock.json +++ b/clients/ui/frontend/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@patternfly/react-core": "6.0.0-alpha.68", "@patternfly/react-icons": "6.0.0-alpha.34", - "@patternfly/react-styles": "6.0.0-alpha.24", + "@patternfly/react-styles": "6.0.0-alpha.34", "npm-run-all": "^4.1.5", "react": "^18", "react-dom": "^18" @@ -53,9 +53,9 @@ "raw-loader": "^4.0.2", "react-router-dom": "^6.4.1", "regenerator-runtime": "^0.14.1", - "rimraf": "^5.0.7", + "rimraf": "^6.0.1", "serve": "^14.2.1", - "style-loader": "^3.3.4", + "style-loader": "^4.0.0", "svg-url-loader": "^8.0.0", "terser-webpack-plugin": "^5.3.10", "ts-jest": "^29.2.4", @@ -3316,9 +3316,9 @@ } }, "node_modules/@patternfly/react-styles": { - "version": "6.0.0-alpha.24", - "resolved": "https://registry.npmjs.org/@patternfly/react-styles/-/react-styles-6.0.0-alpha.24.tgz", - "integrity": "sha512-9Gh0CbeShaNOJSRy/Y7dEx+Nc9rlDrgjSF9rMtjlFTLfU7HvVavrfuBTGV5NpFJlVBtudJAsDaNRTlC22kKokg==" + "version": "6.0.0-alpha.34", + "resolved": "https://registry.npmjs.org/@patternfly/react-styles/-/react-styles-6.0.0-alpha.34.tgz", + "integrity": "sha512-mJSpYrgI/Sgu+gwSv5h8ZP+prvzNUbfEkWP+LV6hZuw70N0UnarJacTsMD0zouCWUwIVt1NOJfawLOVmzAsxbA==" }, "node_modules/@patternfly/react-tokens": { "version": "6.0.0-alpha.24", @@ -9820,9 +9820,9 @@ } }, "node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", "dev": true, "dependencies": { "cross-spawn": "^7.0.0", @@ -9836,9 +9836,9 @@ } }, "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", - "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, "engines": { "node": ">=14" @@ -11637,15 +11637,15 @@ } }, "node_modules/jackspeak": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.2.3.tgz", - "integrity": "sha512-htOzIMPbpLid/Gq9/zaz9SfExABxqRe1sSCdxntlO/aMD6u0issZQiY25n2GKQUtJ02j7z5sfptlAOMpWWOmvw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", + "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, "engines": { - "node": ">=14" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -15787,6 +15787,12 @@ "node": ">=8" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true + }, "node_modules/param-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", @@ -15885,28 +15891,28 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", "dev": true, "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", - "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz", + "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==", "dev": true, "engines": { - "node": "14 || >=16.14" + "node": "20 || >=22" } }, "node_modules/path-to-regexp": { @@ -16890,9 +16896,9 @@ } }, "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "dependencies": { "loose-envify": "^1.1.0" }, @@ -16901,15 +16907,15 @@ } }, "node_modules/react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "dependencies": { "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" + "scheduler": "^0.23.2" }, "peerDependencies": { - "react": "^18.2.0" + "react": "^18.3.1" } }, "node_modules/react-dropzone": { @@ -17374,18 +17380,19 @@ "dev": true }, "node_modules/rimraf": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.7.tgz", - "integrity": "sha512-nV6YcJo5wbLW77m+8KjH8aB/7/rxQy9SZ0HY5shnwULfS+9nmTtVXAJET5NdZmCzA4fPI/Hm1wo/Po/4mopOdg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", + "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", "dev": true, "dependencies": { - "glob": "^10.3.7" + "glob": "^11.0.0", + "package-json-from-dist": "^1.0.0" }, "bin": { "rimraf": "dist/esm/bin.mjs" }, "engines": { - "node": ">=14.18" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -17401,37 +17408,38 @@ } }, "node_modules/rimraf/node_modules/glob": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", - "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", + "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", "minipass": "^7.1.2", - "path-scurry": "^1.11.1" + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" }, "bin": { "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/rimraf/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -17532,9 +17540,9 @@ } }, "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", "dependencies": { "loose-envify": "^1.1.0" } @@ -18526,19 +18534,19 @@ } }, "node_modules/style-loader": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.4.tgz", - "integrity": "sha512-0WqXzrsMTyb8yjZJHDqwmnwRJvhALK9LfRtRc6B4UTWe8AijYLZYZ9thuJTZc2VfQWINADW/j+LiJnfy2RoC1w==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-4.0.0.tgz", + "integrity": "sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==", "dev": true, "engines": { - "node": ">= 12.13.0" + "node": ">= 18.12.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" }, "peerDependencies": { - "webpack": "^5.0.0" + "webpack": "^5.27.0" } }, "node_modules/stylehacks": { diff --git a/clients/ui/frontend/package.json b/clients/ui/frontend/package.json index ee043a6e..c45fcbac 100644 --- a/clients/ui/frontend/package.json +++ b/clients/ui/frontend/package.json @@ -65,9 +65,9 @@ "raw-loader": "^4.0.2", "react-router-dom": "^6.4.1", "regenerator-runtime": "^0.14.1", - "rimraf": "^5.0.7", + "rimraf": "^6.0.1", "serve": "^14.2.1", - "style-loader": "^3.3.4", + "style-loader": "^4.0.0", "svg-url-loader": "^8.0.0", "terser-webpack-plugin": "^5.3.10", "ts-jest": "^29.2.4", @@ -85,7 +85,7 @@ "dependencies": { "@patternfly/react-core": "6.0.0-alpha.68", "@patternfly/react-icons": "6.0.0-alpha.34", - "@patternfly/react-styles": "6.0.0-alpha.24", + "@patternfly/react-styles": "6.0.0-alpha.34", "npm-run-all": "^4.1.5", "react": "^18", "react-dom": "^18" diff --git a/clients/ui/frontend/src/__tests__/cypress/cypress.config.ts b/clients/ui/frontend/src/__tests__/cypress/cypress.config.ts index e7c0fc6c..6c9ff5ce 100644 --- a/clients/ui/frontend/src/__tests__/cypress/cypress.config.ts +++ b/clients/ui/frontend/src/__tests__/cypress/cypress.config.ts @@ -9,7 +9,7 @@ import cypressHighResolution from 'cypress-high-resolution'; // @ts-ignore no types available import { beforeRunHook, afterRunHook } from 'cypress-mochawesome-reporter/lib'; import { mergeFiles } from 'junit-report-merger'; -import { env, BASE_URL } from '~/src/__tests__/cypress/cypress/utils/testConfig'; +import { env, BASE_URL } from '~/__tests__/cypress/cypress/utils/testConfig'; const resultsDir = `${env.CY_RESULTS_DIR || 'results'}/${env.CY_MOCK ? 'mocked' : 'e2e'}`; diff --git a/clients/ui/frontend/src/__tests__/cypress/cypress/tests/mocked/application.cy.ts b/clients/ui/frontend/src/__tests__/cypress/cypress/tests/mocked/application.cy.ts index 322e5c35..c6651694 100644 --- a/clients/ui/frontend/src/__tests__/cypress/cypress/tests/mocked/application.cy.ts +++ b/clients/ui/frontend/src/__tests__/cypress/cypress/tests/mocked/application.cy.ts @@ -1,5 +1,5 @@ -import { pageNotfound } from "~/src/__tests__/cypress/cypress/pages/pageNoteFound"; -import { home } from "~/src/__tests__/cypress/cypress/pages/home"; +import { pageNotfound } from "~/__tests__/cypress/cypress/pages/pageNoteFound"; +import { home } from "~/__tests__/cypress/cypress/pages/home"; describe('Application', () => { diff --git a/clients/ui/frontend/src/__tests__/cypress/tsconfig.json b/clients/ui/frontend/src/__tests__/cypress/tsconfig.json index ac8b479f..a6dac770 100644 --- a/clients/ui/frontend/src/__tests__/cypress/tsconfig.json +++ b/clients/ui/frontend/src/__tests__/cypress/tsconfig.json @@ -1,10 +1,8 @@ { "extends": "../../../tsconfig.json", "include": ["../../**/*.ts"], - "exclude": ["node_modules", "public"], + "exclude": ["node_modules", "dist"], "compilerOptions": { - // TODO https://github.com/cypress-io/cypress/issues/26203 - "sourceMap": false, "types": ["node", "cypress", "@testing-library/cypress", "cypress-axe"] } } diff --git a/clients/ui/frontend/src/app/App.tsx b/clients/ui/frontend/src/app/App.tsx index d9be35e5..2183e990 100644 --- a/clients/ui/frontend/src/app/App.tsx +++ b/clients/ui/frontend/src/app/App.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import '@patternfly/react-core/dist/styles/base.css'; -import AppRoutes from '@app/AppRoutes'; -import '@app/app.css'; +import AppRoutes from './AppRoutes'; +import './app.css'; import { Flex, Masthead, diff --git a/clients/ui/frontend/src/app/AppRoutes.tsx b/clients/ui/frontend/src/app/AppRoutes.tsx index da6fc5c2..fce6104f 100644 --- a/clients/ui/frontend/src/app/AppRoutes.tsx +++ b/clients/ui/frontend/src/app/AppRoutes.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; import { Route, Routes } from 'react-router-dom'; -import { Dashboard } from '@app/Dashboard/Dashboard'; -import { Support } from '@app/Support/Support'; -import { NotFound } from '@app/NotFound/NotFound'; -import { Admin } from '@app/Settings/Admin'; +import { Dashboard } from './Dashboard/Dashboard'; +import { Support } from './Support/Support'; +import { NotFound } from './NotFound/NotFound'; +import { Admin } from './Settings/Admin'; export const isNavDataGroup = (navItem: NavDataItem): navItem is NavDataGroup => 'children' in navItem; diff --git a/clients/ui/frontend/src/app/NavSidebar.tsx b/clients/ui/frontend/src/app/NavSidebar.tsx index 297be610..e0c24606 100644 --- a/clients/ui/frontend/src/app/NavSidebar.tsx +++ b/clients/ui/frontend/src/app/NavSidebar.tsx @@ -8,7 +8,7 @@ import { PageSidebar, PageSidebarBody, } from '@patternfly/react-core'; -import { useNavData, isNavDataGroup, NavDataHref, NavDataGroup } from '@app/AppRoutes'; +import { useNavData, isNavDataGroup, NavDataHref, NavDataGroup } from './AppRoutes'; const NavHref: React.FC<{ item: NavDataHref }> = ({ item }) => ( MLMD mapping, make use of generated Converters func (m *Mapper) MapFromRegisteredModel(registeredModel *openapi.RegisteredModel) (*proto.Context, error) { @@ -33,12 +38,12 @@ func (m *Mapper) MapFromRegisteredModel(registeredModel *openapi.RegisteredModel }) } -func (m *Mapper) MapFromModelVersion(modelVersion *openapi.ModelVersion, registeredModelId string, registeredModelName *string) (*proto.Context, error) { +func (m *Mapper) MapFromModelVersion(modelVersion *openapi.ModelVersion, registeredModelId string, registeredModelName string) (*proto.Context, error) { return m.OpenAPIConverter.ConvertModelVersion(&converter.OpenAPIModelWrapper[openapi.ModelVersion]{ TypeId: m.MLMDTypes[defaults.ModelVersionTypeName], Model: modelVersion, ParentResourceId: ®isteredModelId, - ModelName: registeredModelName, + ModelName: of(registeredModelName), }) } diff --git a/internal/mapper/mapper_test.go b/internal/mapper/mapper_test.go index 04d55bbc..5f1b99be 100644 --- a/internal/mapper/mapper_test.go +++ b/internal/mapper/mapper_test.go @@ -40,7 +40,7 @@ func setup(t *testing.T) (*assert.Assertions, *Mapper) { func TestMapFromRegisteredModel(t *testing.T) { assertion, m := setup(t) - ctx, err := m.MapFromRegisteredModel(&openapi.RegisteredModel{Name: of("ModelName")}) + ctx, err := m.MapFromRegisteredModel(&openapi.RegisteredModel{Name: "ModelName"}) assertion.Nil(err) assertion.Equal("ModelName", ctx.GetName()) assertion.Equal(registeredModelTypeId, ctx.GetTypeId()) @@ -49,7 +49,7 @@ func TestMapFromRegisteredModel(t *testing.T) { func TestMapFromModelVersion(t *testing.T) { assertion, m := setup(t) - ctx, err := m.MapFromModelVersion(&openapi.ModelVersion{Name: of("v1")}, "1", of("ModelName")) + ctx, err := m.MapFromModelVersion(&openapi.ModelVersion{Name: "v1"}, "1", "ModelName") assertion.Nil(err) assertion.Equal("1:v1", ctx.GetName()) assertion.Equal(modelVersionTypeId, ctx.GetTypeId()) @@ -277,12 +277,7 @@ func TestMapToServeModelInvalid(t *testing.T) { } func TestMapTo(t *testing.T) { - _, err := mapTo[*proto.Execution, any](&proto.Execution{TypeId: of(registeredModelTypeId)}, typesMap, "notExisitingTypeName", func(e *proto.Execution) (*any, error) { return nil, nil }) + _, err := mapTo(&proto.Execution{TypeId: of(registeredModelTypeId)}, typesMap, "notExisitingTypeName", func(e *proto.Execution) (*any, error) { return nil, nil }) assert.NotNil(t, err) assert.Equal(t, "unknown type name provided: notExisitingTypeName", err.Error()) } - -// of returns a pointer to the provided literal/const input -func of[E any](e E) *E { - return &e -} diff --git a/internal/server/openapi/impl.go b/internal/server/openapi/impl.go index 0901dc5e..6ca6f2e8 100644 --- a/internal/server/openapi/impl.go +++ b/internal/server/openapi/impl.go @@ -11,6 +11,6 @@ package openapi // ImplResponse defines an implementation response with error code and the associated body type ImplResponse struct { - Code int Body interface{} + Code int } diff --git a/internal/server/openapi/type_asserts.go b/internal/server/openapi/type_asserts.go index 10a2f2e4..8defb4fc 100644 --- a/internal/server/openapi/type_asserts.go +++ b/internal/server/openapi/type_asserts.go @@ -524,6 +524,7 @@ func AssertModelArtifactUpdateConstraints(obj model.ModelArtifactUpdate) error { // AssertModelVersionRequired checks if the required fields are not zero-ed func AssertModelVersionRequired(obj model.ModelVersion) error { elements := map[string]interface{}{ + "name": obj.Name, "registeredModelId": obj.RegisteredModelId, } for name, el := range elements { @@ -543,6 +544,7 @@ func AssertModelVersionConstraints(obj model.ModelVersion) error { // AssertModelVersionCreateRequired checks if the required fields are not zero-ed func AssertModelVersionCreateRequired(obj model.ModelVersionCreate) error { elements := map[string]interface{}{ + "name": obj.Name, "registeredModelId": obj.RegisteredModelId, } for name, el := range elements { @@ -617,6 +619,15 @@ func AssertOrderByFieldConstraints(obj model.OrderByField) error { // AssertRegisteredModelRequired checks if the required fields are not zero-ed func AssertRegisteredModelRequired(obj model.RegisteredModel) error { + elements := map[string]interface{}{ + "name": obj.Name, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + return nil } @@ -627,6 +638,15 @@ func AssertRegisteredModelConstraints(obj model.RegisteredModel) error { // AssertRegisteredModelCreateRequired checks if the required fields are not zero-ed func AssertRegisteredModelCreateRequired(obj model.RegisteredModelCreate) error { + elements := map[string]interface{}{ + "name": obj.Name, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + return nil } diff --git a/pkg/core/core_test.go b/pkg/core/core_test.go index 89567511..ec729514 100644 --- a/pkg/core/core_test.go +++ b/pkg/core/core_test.go @@ -147,7 +147,7 @@ func (suite *CoreTestSuite) setupModelRegistryService() *ModelRegistryService { // utility function that register a new simple model and return its ID func (suite *CoreTestSuite) registerModel(service api.ModelRegistryApi, overrideModelName *string, overrideExternalId *string) string { registeredModel := &openapi.RegisteredModel{ - Name: &modelName, + Name: modelName, ExternalId: &modelExternalId, Description: &modelDescription, CustomProperties: &map[string]openapi.MetadataValue{ @@ -158,7 +158,7 @@ func (suite *CoreTestSuite) registerModel(service api.ModelRegistryApi, override } if overrideModelName != nil { - registeredModel.Name = overrideModelName + registeredModel.Name = *overrideModelName } if overrideExternalId != nil { @@ -213,14 +213,14 @@ func (suite *CoreTestSuite) registerModelVersion( registeredModelId := suite.registerModel(service, overrideModelName, overrideExternalId) modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Description: &modelVersionDescription, Author: &author, } if overrideVersionName != nil { - modelVersion.Name = overrideVersionName + modelVersion.Name = *overrideVersionName } if overrideVersionExtId != nil { @@ -590,7 +590,7 @@ func (suite *CoreTestSuite) TestCreateRegisteredModel() { state := openapi.REGISTEREDMODELSTATE_ARCHIVED // register a new model registeredModel := &openapi.RegisteredModel{ - Name: &modelName, + Name: modelName, ExternalId: &modelExternalId, Description: &modelDescription, Owner: &modelOwner, @@ -636,7 +636,7 @@ func (suite *CoreTestSuite) TestUpdateRegisteredModel() { // register a new model registeredModel := &openapi.RegisteredModel{ - Name: &modelName, + Name: modelName, Owner: &modelOwner, ExternalId: &modelExternalId, CustomProperties: &map[string]openapi.MetadataValue{ @@ -655,7 +655,7 @@ func (suite *CoreTestSuite) TestUpdateRegisteredModel() { createdModelId, _ := converter.StringToInt64(createdModel.Id) // checks created model matches original one except for Id - suite.Equal(*registeredModel.Name, *createdModel.Name, "returned model name should match the original one") + suite.Equal(registeredModel.Name, createdModel.Name, "returned model name should match the original one") suite.Equal(*registeredModel.ExternalId, *createdModel.ExternalId, "returned model external id should match the original one") suite.Equal(*registeredModel.CustomProperties, *createdModel.CustomProperties, "returned model custom props should match the original one") @@ -700,7 +700,7 @@ func (suite *CoreTestSuite) TestUpdateRegisteredModel() { // update the model keeping nil name newModelExternalId = "newNewExternalId" createdModel.ExternalId = &newModelExternalId - createdModel.Name = nil + createdModel.Name = "" createdModel, err = service.UpsertRegisteredModel(createdModel) suite.Nilf(err, "error creating registered model: %v", err) @@ -731,7 +731,7 @@ func (suite *CoreTestSuite) TestGetRegisteredModelById() { state := openapi.REGISTEREDMODELSTATE_LIVE // register a new model registeredModel := &openapi.RegisteredModel{ - Name: &modelName, + Name: modelName, ExternalId: &modelExternalId, State: &state, CustomProperties: &map[string]openapi.MetadataValue{ @@ -751,7 +751,7 @@ func (suite *CoreTestSuite) TestGetRegisteredModelById() { suite.Nilf(err, "error getting registered model by id %s: %v", *createdModel.Id, err) // checks created model matches original one except for Id - suite.Equal(*registeredModel.Name, *getModelById.Name, "saved model name should match the original one") + suite.Equal(registeredModel.Name, getModelById.Name, "saved model name should match the original one") suite.Equal(*registeredModel.ExternalId, *getModelById.ExternalId, "saved model external id should match the original one") suite.Equal(*registeredModel.State, *getModelById.State, "saved model state should match the original one") suite.Equal(*registeredModel.CustomProperties, *getModelById.CustomProperties, "saved model custom props should match the original one") @@ -772,7 +772,7 @@ func (suite *CoreTestSuite) TestGetRegisteredModelByParamsName() { // register a new model registeredModel := &openapi.RegisteredModel{ - Name: &modelName, + Name: modelName, ExternalId: &modelExternalId, } @@ -791,7 +791,7 @@ func (suite *CoreTestSuite) TestGetRegisteredModelByParamsExternalId() { // register a new model registeredModel := &openapi.RegisteredModel{ - Name: &modelName, + Name: modelName, ExternalId: &modelExternalId, } @@ -810,7 +810,7 @@ func (suite *CoreTestSuite) TestGetRegisteredModelByEmptyParams() { // register a new model registeredModel := &openapi.RegisteredModel{ - Name: &modelName, + Name: modelName, ExternalId: &modelExternalId, } @@ -830,7 +830,7 @@ func (suite *CoreTestSuite) TestGetRegisteredModelsOrderedById() { // register a new model registeredModel := &openapi.RegisteredModel{ - Name: &modelName, + Name: modelName, ExternalId: &modelExternalId, } @@ -839,14 +839,14 @@ func (suite *CoreTestSuite) TestGetRegisteredModelsOrderedById() { newModelName := "PricingModel2" newModelExternalId := "myExternalId2" - registeredModel.Name = &newModelName + registeredModel.Name = newModelName registeredModel.ExternalId = &newModelExternalId _, err = service.UpsertRegisteredModel(registeredModel) suite.Nilf(err, "error creating registered model: %v", err) newModelName = "PricingModel3" newModelExternalId = "myExternalId3" - registeredModel.Name = &newModelName + registeredModel.Name = newModelName registeredModel.ExternalId = &newModelExternalId _, err = service.UpsertRegisteredModel(registeredModel) suite.Nilf(err, "error creating registered model: %v", err) @@ -882,7 +882,7 @@ func (suite *CoreTestSuite) TestGetRegisteredModelsOrderedByLastUpdate() { // register a new model registeredModel := &openapi.RegisteredModel{ - Name: &modelName, + Name: modelName, ExternalId: &modelExternalId, } @@ -891,14 +891,14 @@ func (suite *CoreTestSuite) TestGetRegisteredModelsOrderedByLastUpdate() { newModelName := "PricingModel2" newModelExternalId := "myExternalId2" - registeredModel.Name = &newModelName + registeredModel.Name = newModelName registeredModel.ExternalId = &newModelExternalId secondModel, err := service.UpsertRegisteredModel(registeredModel) suite.Nilf(err, "error creating registered model: %v", err) newModelName = "PricingModel3" newModelExternalId = "myExternalId3" - registeredModel.Name = &newModelName + registeredModel.Name = newModelName registeredModel.ExternalId = &newModelExternalId thirdModel, err := service.UpsertRegisteredModel(registeredModel) suite.Nilf(err, "error creating registered model: %v", err) @@ -942,7 +942,7 @@ func (suite *CoreTestSuite) TestGetRegisteredModelsWithPageSize() { // register a new model registeredModel := &openapi.RegisteredModel{ - Name: &modelName, + Name: modelName, ExternalId: &modelExternalId, } @@ -951,14 +951,14 @@ func (suite *CoreTestSuite) TestGetRegisteredModelsWithPageSize() { newModelName := "PricingModel2" newModelExternalId := "myExternalId2" - registeredModel.Name = &newModelName + registeredModel.Name = newModelName registeredModel.ExternalId = &newModelExternalId secondModel, err := service.UpsertRegisteredModel(registeredModel) suite.Nilf(err, "error creating registered model: %v", err) newModelName = "PricingModel3" newModelExternalId = "myExternalId3" - registeredModel.Name = &newModelName + registeredModel.Name = newModelName registeredModel.ExternalId = &newModelExternalId thirdModel, err := service.UpsertRegisteredModel(registeredModel) suite.Nilf(err, "error creating registered model: %v", err) @@ -994,7 +994,7 @@ func (suite *CoreTestSuite) TestCreateModelVersion() { state := openapi.MODELVERSIONSTATE_LIVE modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Description: &modelVersionDescription, State: &state, @@ -1037,7 +1037,7 @@ func (suite *CoreTestSuite) TestCreateModelVersionFailure() { registeredModelId := "9999" modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Author: &author, } @@ -1058,7 +1058,7 @@ func (suite *CoreTestSuite) TestUpdateModelVersion() { registeredModelId := suite.registerModel(service, nil, nil) modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Author: &author, } @@ -1106,7 +1106,7 @@ func (suite *CoreTestSuite) TestUpdateModelVersion() { // update with nil name newExternalId = "org.my_awesome_model_@v1" updatedVersion.ExternalId = &newExternalId - updatedVersion.Name = nil + updatedVersion.Name = "" updatedVersion, err = service.UpsertModelVersion(updatedVersion, ®isteredModelId) suite.Nilf(err, "error updating new model version for %s: %v", registeredModelId, err) @@ -1136,7 +1136,7 @@ func (suite *CoreTestSuite) TestUpdateModelVersionFailure() { registeredModelId := suite.registerModel(service, nil, nil) modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Author: &author, } @@ -1168,7 +1168,7 @@ func (suite *CoreTestSuite) TestGetModelVersionById() { state := openapi.MODELVERSIONSTATE_ARCHIVED modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, State: &state, Author: &author, @@ -1192,7 +1192,7 @@ func (suite *CoreTestSuite) TestGetModelVersionById() { ctx := ctxById.Contexts[0] suite.Equal(*converter.Int64ToString(ctx.Id), *getById.Id, "returned model version id should match the mlmd context one") - suite.Equal(*modelVersion.Name, *getById.Name, "saved model name should match the provided one") + suite.Equal(modelVersion.Name, getById.Name, "saved model name should match the provided one") suite.Equal(*modelVersion.ExternalId, *getById.ExternalId, "saved external id should match the provided one") suite.Equal(*modelVersion.State, *getById.State, "saved model state should match the original one") suite.Equal(*getById.Author, author, "saved author property should match the provided one") @@ -1216,7 +1216,7 @@ func (suite *CoreTestSuite) TestGetModelVersionByParamsName() { registeredModelId := suite.registerModel(service, nil, nil) modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Author: &author, } @@ -1239,7 +1239,7 @@ func (suite *CoreTestSuite) TestGetModelVersionByParamsName() { ctx := ctxById.Contexts[0] suite.Equal(*converter.Int64ToString(ctx.Id), *getByName.Id, "returned model version id should match the mlmd context one") - suite.Equal(fmt.Sprintf("%s:%s", registeredModelId, *getByName.Name), *ctx.Name, "saved model name should match the provided one") + suite.Equal(fmt.Sprintf("%s:%s", registeredModelId, getByName.Name), *ctx.Name, "saved model name should match the provided one") suite.Equal(*ctx.ExternalId, *getByName.ExternalId, "saved external id should match the provided one") suite.Equal(ctx.Properties["author"].GetStringValue(), *getByName.Author, "saved author property should match the provided one") } @@ -1251,7 +1251,7 @@ func (suite *CoreTestSuite) TestGetModelVersionByParamsExternalId() { registeredModelId := suite.registerModel(service, nil, nil) modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Author: &author, } @@ -1274,7 +1274,7 @@ func (suite *CoreTestSuite) TestGetModelVersionByParamsExternalId() { ctx := ctxById.Contexts[0] suite.Equal(*converter.Int64ToString(ctx.Id), *getByExternalId.Id, "returned model version id should match the mlmd context one") - suite.Equal(fmt.Sprintf("%s:%s", registeredModelId, *getByExternalId.Name), *ctx.Name, "saved model name should match the provided one") + suite.Equal(fmt.Sprintf("%s:%s", registeredModelId, getByExternalId.Name), *ctx.Name, "saved model name should match the provided one") suite.Equal(*ctx.ExternalId, *getByExternalId.ExternalId, "saved external id should match the provided one") suite.Equal(ctx.Properties["author"].GetStringValue(), *getByExternalId.Author, "saved author property should match the provided one") } @@ -1286,7 +1286,7 @@ func (suite *CoreTestSuite) TestGetModelVersionByEmptyParams() { registeredModelId := suite.registerModel(service, nil, nil) modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Author: &author, } @@ -1307,21 +1307,21 @@ func (suite *CoreTestSuite) TestGetModelVersions() { registeredModelId := suite.registerModel(service, nil, nil) modelVersion1 := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, } secondModelVersionName := "v2" secondModelVersionExtId := "org.myawesomemodel@v2" modelVersion2 := &openapi.ModelVersion{ - Name: &secondModelVersionName, + Name: secondModelVersionName, ExternalId: &secondModelVersionExtId, } thirdModelVersionName := "v3" thirdModelVersionExtId := "org.myawesomemodel@v3" modelVersion3 := &openapi.ModelVersion{ - Name: &thirdModelVersionName, + Name: thirdModelVersionName, ExternalId: &thirdModelVersionExtId, } @@ -1341,7 +1341,7 @@ func (suite *CoreTestSuite) TestGetModelVersions() { anotherModelVersionName := "v1.0" anotherModelVersionExtId := "org.another@v1.0" modelVersionAnother := &openapi.ModelVersion{ - Name: &anotherModelVersionName, + Name: anotherModelVersionName, ExternalId: &anotherModelVersionExtId, } @@ -2641,13 +2641,13 @@ func (suite *CoreTestSuite) TestGetModelVersionByInferenceServiceId() { registeredModelId := suite.registerModel(service, nil, nil) modelVersion1Name := "v1" - modelVersion1 := &openapi.ModelVersion{Name: &modelVersion1Name, Description: &modelVersionDescription} + modelVersion1 := &openapi.ModelVersion{Name: modelVersion1Name, Description: &modelVersionDescription} createdVersion1, err := service.UpsertModelVersion(modelVersion1, ®isteredModelId) suite.Nilf(err, "error creating new model version for %d", registeredModelId) createdVersion1Id := *createdVersion1.Id modelVersion2Name := "v2" - modelVersion2 := &openapi.ModelVersion{Name: &modelVersion2Name, Description: &modelVersionDescription} + modelVersion2 := &openapi.ModelVersion{Name: modelVersion2Name, Description: &modelVersionDescription} createdVersion2, err := service.UpsertModelVersion(modelVersion2, ®isteredModelId) suite.Nilf(err, "error creating new model version for %d", registeredModelId) createdVersion2Id := *createdVersion2.Id @@ -2691,7 +2691,7 @@ func (suite *CoreTestSuite) TestGetModelArtifactByInferenceServiceId() { registeredModelId := suite.registerModel(service, nil, nil) modelVersion1Name := "v1" - modelVersion1 := &openapi.ModelVersion{Name: &modelVersion1Name, Description: &modelVersionDescription} + modelVersion1 := &openapi.ModelVersion{Name: modelVersion1Name, Description: &modelVersionDescription} createdVersion1, err := service.UpsertModelVersion(modelVersion1, ®isteredModelId) suite.Nilf(err, "error creating new model version for %s", registeredModelId) modelArtifact1Name := "v1-artifact" @@ -2700,7 +2700,7 @@ func (suite *CoreTestSuite) TestGetModelArtifactByInferenceServiceId() { suite.Nilf(err, "error creating new model artifact for %s", *createdVersion1.Id) modelVersion2Name := "v2" - modelVersion2 := &openapi.ModelVersion{Name: &modelVersion2Name, Description: &modelVersionDescription} + modelVersion2 := &openapi.ModelVersion{Name: modelVersion2Name, Description: &modelVersionDescription} createdVersion2, err := service.UpsertModelVersion(modelVersion2, ®isteredModelId) suite.Nilf(err, "error creating new model version for %s", registeredModelId) modelArtifact2Name := "v2-artifact" @@ -2988,7 +2988,7 @@ func (suite *CoreTestSuite) TestCreateServeModel() { inferenceServiceId := suite.registerInferenceService(service, registeredModelId, nil, nil, nil, nil) modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Description: &modelVersionDescription, Author: &author, @@ -3082,7 +3082,7 @@ func (suite *CoreTestSuite) TestUpdateServeModel() { inferenceServiceId := suite.registerInferenceService(service, registeredModelId, nil, nil, nil, nil) modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Description: &modelVersionDescription, Author: &author, @@ -3144,7 +3144,7 @@ func (suite *CoreTestSuite) TestUpdateServeModelFailure() { inferenceServiceId := suite.registerInferenceService(service, registeredModelId, nil, nil, nil, nil) modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Description: &modelVersionDescription, Author: &author, @@ -3191,7 +3191,7 @@ func (suite *CoreTestSuite) TestGetServeModelById() { inferenceServiceId := suite.registerInferenceService(service, registeredModelId, nil, nil, nil, nil) modelVersion := &openapi.ModelVersion{ - Name: &modelVersionName, + Name: modelVersionName, ExternalId: &versionExternalId, Description: &modelVersionDescription, Author: &author, @@ -3238,19 +3238,19 @@ func (suite *CoreTestSuite) TestGetServeModels() { inferenceServiceId := suite.registerInferenceService(service, registeredModelId, nil, nil, nil, nil) modelVersion1Name := "v1" - modelVersion1 := &openapi.ModelVersion{Name: &modelVersion1Name, Description: &modelVersionDescription} + modelVersion1 := &openapi.ModelVersion{Name: modelVersion1Name, Description: &modelVersionDescription} createdVersion1, err := service.UpsertModelVersion(modelVersion1, ®isteredModelId) suite.Nilf(err, "error creating new model version for %d", registeredModelId) createdVersion1Id := *createdVersion1.Id modelVersion2Name := "v2" - modelVersion2 := &openapi.ModelVersion{Name: &modelVersion2Name, Description: &modelVersionDescription} + modelVersion2 := &openapi.ModelVersion{Name: modelVersion2Name, Description: &modelVersionDescription} createdVersion2, err := service.UpsertModelVersion(modelVersion2, ®isteredModelId) suite.Nilf(err, "error creating new model version for %d", registeredModelId) createdVersion2Id := *createdVersion2.Id modelVersion3Name := "v3" - modelVersion3 := &openapi.ModelVersion{Name: &modelVersion3Name, Description: &modelVersionDescription} + modelVersion3 := &openapi.ModelVersion{Name: modelVersion3Name, Description: &modelVersionDescription} createdVersion3, err := service.UpsertModelVersion(modelVersion3, ®isteredModelId) suite.Nilf(err, "error creating new model version for %d", registeredModelId) createdVersion3Id := *createdVersion3.Id diff --git a/pkg/openapi/model_model_version.go b/pkg/openapi/model_model_version.go index c0b89f8c..01f92277 100644 --- a/pkg/openapi/model_model_version.go +++ b/pkg/openapi/model_model_version.go @@ -26,7 +26,7 @@ type ModelVersion struct { // The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. ExternalId *string `json:"externalId,omitempty"` // The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. - Name *string `json:"name,omitempty"` + Name string `json:"name"` State *ModelVersionState `json:"state,omitempty"` // Name of the author. Author *string `json:"author,omitempty"` @@ -44,8 +44,9 @@ type ModelVersion struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewModelVersion(registeredModelId string) *ModelVersion { +func NewModelVersion(name string, registeredModelId string) *ModelVersion { this := ModelVersion{} + this.Name = name var state ModelVersionState = MODELVERSIONSTATE_LIVE this.State = &state this.RegisteredModelId = registeredModelId @@ -158,36 +159,28 @@ func (o *ModelVersion) SetExternalId(v string) { o.ExternalId = &v } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value func (o *ModelVersion) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil { var ret string return ret } - return *o.Name + + return o.Name } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *ModelVersion) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *ModelVersion) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + return &o.Name, true } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value func (o *ModelVersion) SetName(v string) { - o.Name = &v + o.Name = v } // GetState returns the State field value if set, zero value otherwise. @@ -393,9 +386,7 @@ func (o ModelVersion) ToMap() (map[string]interface{}, error) { if !IsNil(o.ExternalId) { toSerialize["externalId"] = o.ExternalId } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } + toSerialize["name"] = o.Name if !IsNil(o.State) { toSerialize["state"] = o.State } diff --git a/pkg/openapi/model_model_version_create.go b/pkg/openapi/model_model_version_create.go index e964055a..5a6c743a 100644 --- a/pkg/openapi/model_model_version_create.go +++ b/pkg/openapi/model_model_version_create.go @@ -25,8 +25,8 @@ type ModelVersionCreate struct { Description *string `json:"description,omitempty"` // The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. ExternalId *string `json:"externalId,omitempty"` - // The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. - Name *string `json:"name,omitempty"` + // The client provided name of the model's version. It must be unique among all the ModelVersions of the same type within a Model Registry instance and cannot be changed once set. + Name string `json:"name"` State *ModelVersionState `json:"state,omitempty"` // Name of the author. Author *string `json:"author,omitempty"` @@ -38,8 +38,9 @@ type ModelVersionCreate struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewModelVersionCreate(registeredModelId string) *ModelVersionCreate { +func NewModelVersionCreate(name string, registeredModelId string) *ModelVersionCreate { this := ModelVersionCreate{} + this.Name = name var state ModelVersionState = MODELVERSIONSTATE_LIVE this.State = &state this.RegisteredModelId = registeredModelId @@ -152,36 +153,28 @@ func (o *ModelVersionCreate) SetExternalId(v string) { o.ExternalId = &v } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value func (o *ModelVersionCreate) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil { var ret string return ret } - return *o.Name + + return o.Name } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *ModelVersionCreate) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *ModelVersionCreate) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + return &o.Name, true } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value func (o *ModelVersionCreate) SetName(v string) { - o.Name = &v + o.Name = v } // GetState returns the State field value if set, zero value otherwise. @@ -291,9 +284,7 @@ func (o ModelVersionCreate) ToMap() (map[string]interface{}, error) { if !IsNil(o.ExternalId) { toSerialize["externalId"] = o.ExternalId } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } + toSerialize["name"] = o.Name if !IsNil(o.State) { toSerialize["state"] = o.State } diff --git a/pkg/openapi/model_registered_model.go b/pkg/openapi/model_registered_model.go index 73ce09a6..a692a149 100644 --- a/pkg/openapi/model_registered_model.go +++ b/pkg/openapi/model_registered_model.go @@ -26,7 +26,7 @@ type RegisteredModel struct { // The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. ExternalId *string `json:"externalId,omitempty"` // The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. - Name *string `json:"name,omitempty"` + Name string `json:"name"` // Output only. The unique server generated id of the resource. Id *string `json:"id,omitempty"` // Output only. Create time of the resource in millisecond since epoch. @@ -41,8 +41,9 @@ type RegisteredModel struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRegisteredModel() *RegisteredModel { +func NewRegisteredModel(name string) *RegisteredModel { this := RegisteredModel{} + this.Name = name var state RegisteredModelState = REGISTEREDMODELSTATE_LIVE this.State = &state return &this @@ -154,36 +155,28 @@ func (o *RegisteredModel) SetExternalId(v string) { o.ExternalId = &v } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value func (o *RegisteredModel) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil { var ret string return ret } - return *o.Name + + return o.Name } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *RegisteredModel) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *RegisteredModel) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + return &o.Name, true } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value func (o *RegisteredModel) SetName(v string) { - o.Name = &v + o.Name = v } // GetId returns the Id field value if set, zero value otherwise. @@ -365,9 +358,7 @@ func (o RegisteredModel) ToMap() (map[string]interface{}, error) { if !IsNil(o.ExternalId) { toSerialize["externalId"] = o.ExternalId } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } + toSerialize["name"] = o.Name if !IsNil(o.Id) { toSerialize["id"] = o.Id } diff --git a/pkg/openapi/model_registered_model_create.go b/pkg/openapi/model_registered_model_create.go index cf6df186..49edf663 100644 --- a/pkg/openapi/model_registered_model_create.go +++ b/pkg/openapi/model_registered_model_create.go @@ -26,7 +26,7 @@ type RegisteredModelCreate struct { // The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. ExternalId *string `json:"externalId,omitempty"` // The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. - Name *string `json:"name,omitempty"` + Name string `json:"name"` Owner *string `json:"owner,omitempty"` State *RegisteredModelState `json:"state,omitempty"` } @@ -35,8 +35,9 @@ type RegisteredModelCreate struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRegisteredModelCreate() *RegisteredModelCreate { +func NewRegisteredModelCreate(name string) *RegisteredModelCreate { this := RegisteredModelCreate{} + this.Name = name var state RegisteredModelState = REGISTEREDMODELSTATE_LIVE this.State = &state return &this @@ -148,36 +149,28 @@ func (o *RegisteredModelCreate) SetExternalId(v string) { o.ExternalId = &v } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value func (o *RegisteredModelCreate) GetName() string { - if o == nil || IsNil(o.Name) { + if o == nil { var ret string return ret } - return *o.Name + + return o.Name } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *RegisteredModelCreate) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *RegisteredModelCreate) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + return &o.Name, true } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value func (o *RegisteredModelCreate) SetName(v string) { - o.Name = &v + o.Name = v } // GetOwner returns the Owner field value if set, zero value otherwise. @@ -263,9 +256,7 @@ func (o RegisteredModelCreate) ToMap() (map[string]interface{}, error) { if !IsNil(o.ExternalId) { toSerialize["externalId"] = o.ExternalId } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } + toSerialize["name"] = o.Name if !IsNil(o.Owner) { toSerialize["owner"] = o.Owner } diff --git a/scripts/install_protoc.sh b/scripts/install_protoc.sh index b7b165e5..3eec5d1c 100755 --- a/scripts/install_protoc.sh +++ b/scripts/install_protoc.sh @@ -1,7 +1,7 @@ #! /bin/bash set -euxo pipefail -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +SCRIPT_PARENT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd ) VERSION="24.3" OS="linux" @@ -14,9 +14,9 @@ if [[ "$(uname -m)" == "arm"* ]]; then ARCH="aarch_64" fi -mkdir -p ${SCRIPT_DIR}/../bin +mkdir -p ${SCRIPT_PARENT_DIR}/bin -wget -q https://github.com/protocolbuffers/protobuf/releases/download/v${VERSION}/protoc-${VERSION}-${OS}-${ARCH}.zip -O ${SCRIPT_DIR}/../protoc.zip && \ - unzip -qo ${SCRIPT_DIR}/../protoc.zip -d ${SCRIPT_DIR}/.. && \ +wget -q https://github.com/protocolbuffers/protobuf/releases/download/v${VERSION}/protoc-${VERSION}-${OS}-${ARCH}.zip -O ${SCRIPT_PARENT_DIR}/protoc.zip && \ + unzip -qo ${SCRIPT_PARENT_DIR}/protoc.zip -d ${SCRIPT_PARENT_DIR} && \ bin/protoc --version && \ - rm ${SCRIPT_DIR}/../protoc.zip + rm ${SCRIPT_PARENT_DIR}/protoc.zip diff --git a/test/robot/Regression.robot b/test/robot/Regression.robot index fed9d76b..0cbf899a 100644 --- a/test/robot/Regression.robot +++ b/test/robot/Regression.robot @@ -14,3 +14,10 @@ As a MLOps engineer if I try to store a malformed RegisteredModel I get a struct ${err} POST url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha3/registered_models json=&{rm} expected_status=400 ${rm_err} Create Dictionary code= message=json: unknown field "ext_id" And Should be equal ${rm_err} ${err.json()} + +As a MLOps engineer if I try to store a malformed ModelVersion I get a structured error message + ${rId} Given I create a RegisteredModel having name=${name} + ${mv} Create Dictionary registeredModelId=${rId} + ${err} POST url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha3/model_versions json=&{mv} expected_status=422 + ${mv_err} Create Dictionary code= message=required field 'name' is zero value. + And Should be equal ${mv_err} ${err.json()}