Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fetch repository tags from registry #6

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

jvallesm
Copy link
Collaborator

@jvallesm jvallesm commented Mar 26, 2024

Because

  • We want to list the versions of a model.
  • Registry has a tags endpoint but it doesn't expose any timestamp.

CleanShot 2024-03-19 at 20 24 14

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 🔨

$ 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.

The service setup and the injections into the domain layer are
simplified until the previous complexity is needed.
@jvallesm jvallesm self-assigned this Mar 26, 2024
Copy link

linear bot commented Mar 26, 2024

Copy link

codecov bot commented Mar 26, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 93.61%. Comparing base (dc6ea9c) to head (98087fe).

Files Patch % Lines
pkg/service/service.go 93.33% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           main       #6       +/-   ##
=========================================
+ Coverage      0   93.61%   +93.61%     
=========================================
  Files         0        1        +1     
  Lines         0       47       +47     
=========================================
+ Hits          0       44       +44     
- Misses        0        2        +2     
- Partials      0        1        +1     
Flag Coverage Δ
unittests 93.61% <93.33%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jvallesm jvallesm marked this pull request as ready for review March 26, 2024 13:48
@jvallesm jvallesm merged commit 3568735 into main Mar 26, 2024
16 checks passed
@jvallesm jvallesm deleted the jvalles/ins-3958-implement-registry-tag-list branch March 26, 2024 13:56
jvallesm pushed a commit that referenced this pull request Apr 3, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.2.0-alpha](v0.1.0-alpha...v0.2.0-alpha)
(2024-04-02)


### Features

* add CreateRepositoryTag endpoint
([#8](#8))
([61bc325](61bc325))
* aggregate tag list with database info
([#7](#7))
([6cc2d8d](6cc2d8d))
* create artifact database if it does not exist
([#4](#4))
([787a4ad](787a4ad))
* fetch repository tags from registry
([#6](#6))
([3568735](3568735))


### Bug Fixes

* expose private API on private port
([#9](#9))
([9ef4b03](9ef4b03))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
2 participants