Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fetch repository tags from registry (#6)
Because - We want to list the versions of a model. - Registry has a [tags](https://distribution.github.io/distribution/#listing-image-tags) endpoint but it doesn't expose any timestamp. ![CleanShot 2024-03-19 at 20 24 14](https://github.com/instill-ai/protobufs/assets/3977183/38f408d1-0096-4f39-b3fe-92991104fa66) This commit - Serves the `ListRepositoryTags` endpoint in the Artifact Private API. - Fetches the tag list from the `registry` service. - Simplifies part of the code. Part of the complexity was copied as boilerplate from other services, but it's actually not necessary yet. # QA 🔨 ```sh $ docker pull hello-world $ # add some tags $ docker tag hello-world localhost:5001/admin/hello-world:0.1.4 $ docker push hello-world localhost:5001/admin/hello-world:0.1.4 $ # ... repeat for different tags $ grpcurl -plaintext \ -proto ./artifact/artifact/v1alpha/artifact_private_service.proto \ -import-path ~/Code/go/src/github.com/instill-ai/pipeline-backend/integration-test/proto/vdp/pipeline/v1beta/ \ -import-path . \ -d '{"parent": "repositories/admin/hello-world", "page_size":2,"page": 1}' \ localhost:8085 artifact.artifact.v1alpha.ArtifactPrivateService/ListRepositoryTags | jq { "tags": [ { "name": "repositories/admin/hello-world/tags/0.1.3", "id": "0.1.3" }, { "name": "repositories/admin/hello-world/tags/0.1.1", "id": "0.1.1" } ] } $ grpcurl -plaintext \ -proto ./artifact/artifact/v1alpha/artifact_private_service.proto \ -import-path ~/Code/go/src/github.com/instill-ai/pipeline-backend/integration-test/proto/vdp/pipeline/v1beta/ \ -import-path . \ -d '{"parent": "repositories/admin/hello-world"}' \ localhost:8085 artifact.artifact.v1alpha.ArtifactPrivateService/ListRepositoryTags | jq { "tags": [ { "name": "repositories/admin/hello-world/tags/0.1.1-beta", "id": "0.1.1-beta" }, { "name": "repositories/admin/hello-world/tags/0.1.0", "id": "0.1.0" }, { "name": "repositories/admin/hello-world/tags/0.1.3", "id": "0.1.3" }, { "name": "repositories/admin/hello-world/tags/0.1.1", "id": "0.1.1" }, { "name": "repositories/admin/hello-world/tags/0.1.4", "id": "0.1.4" } ] } ``` # ⏭️ Next steps - I tried to set up integration tests throuth `k6s`, replicating the previous section, but it's the first time setting the tests up and I was losing quite some time with the network setup and with broken import paths. As other devs are relying on this feature for testing the model deployment on d0, I created a ticket to add the e2e tests later. - Another ticket was created to include `artifact-backend` in the core and cloud ecosystems. - The next feature will consist of opening the `CreateRepositoryTag` endpoint, which will store some extra information in the database, and to aggregate the information from both sources in the List endpoint.
- Loading branch information