Project

Profile

Help

Story #81

As a user, I can see a list of repositories that crane is serving

Added by mhrivnak almost 6 years ago. Updated 4 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Target Release - Crane:
1.1.0
Groomed:
Sprint Candidate:
Tags:
Pulp 2
Sprint:
January 2015
Quarter:

Description

Currently, there is no way to query crane and see a list of all the docker repositories it is serving. Deployers want to see such a list.

Deliverables

  • some way for a user to see a list of all repos served by crane, and at least a little information about the images and tags within that repo
  • list should probably be delivered via a json view, and perhaps an html view
  • pagination is a nice-to-have
  • Document how to protect these view using Apache (Crane itself doesn't need to protect the views, it can assume that Apache is doing that for it.)

History

#1 Updated by mhrivnak almost 6 years ago

  • Priority changed from Normal to High

#2 Updated by rbarlow almost 6 years ago

  • Description updated (diff)

#4 Updated by cduryee almost 6 years ago

  • Sprint/Milestone set to 9

#5 Updated by skarmark@redhat.com almost 6 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to skarmark@redhat.com

#6 Updated by mhrivnak almost 6 years ago

Before implementing this ourselves, it's worth looking to see if there's anything here we can use: https://github.com/vpavlin/registry-face

#7 Updated by skarmark@redhat.com over 5 years ago

  • % Done changed from 0 to 30

#8 Updated by skarmark@redhat.com over 5 years ago

I thought about a couple of viewing options for the repositories served by crane and here are the 2 options that seem feasible given the requirement and the given timeframe.

1. json view - This will be a similar json view like what we have for images and tags.
Serving URI will http://host:port/v1/repositories and the format of the json will be -

{'repo_registry_id1': {'images': [image_id1, image_id2, ...], 'tags': [tag1, tag2, ...], 'protected': false},
 'repo_registry_id2': {'images': [image_id1, image_id2, ...], 'tags': [tag1, tag2, ...], 'protected': false}, 
 ...
}

2. HTML view - Instead of json, we can use Flask's 'render_template' to render it in HTML instead, although I am not really sure whether we have a strong usecase for HTML view instead of json.
In any case, it is achievable and I tried it with a couple of small examples. Information in the result will be pretty much the same as above, just in the html format.

Perhaps we want to support both?

Thoughts?

#9 Updated by bmbouter over 5 years ago

The json representation looks fine. I do think both a json representation and an HTML representation be supported.

I propose that the web handler that serves this page inspect the "Accept" HTTP header. This will allow the client to be in control and adhere to the HTTP standards about how to specify that. If "Accept" is set to "application/json" then the json should be returned, otherwise it should return an HTML view. All other values of "Accept", or if "Accept" is missing should return the HTML view. This way machines can specify "Accept" and get what they want, but the default view is human readable.

I propose that the CSS library PatternFly be used to provide some formatting assistance for the HTML. A simple, single page layout is probably the way to go. It will improve readability, be visually consistent with a lot of other Red Hat stuff, and it should abstract cross-browser compatability problems easily enough.

Normally I would say that we should do a mockup before implementing a visual design, but in this case I think trying to render the json data using PatternFly in a reasonable way without a mockup is good enough. I can help answer questions in working with PatternFly or blocker issues that come up. I haven't worked with it specifically but it is built on top of bootstrap which I've done a lot of work with.

Also when forming HTML always make sure to validate it using the W3C HTML validator.

To represent the json data with PatternFly you'll need to write a template that loops over the json data and builds the right tags that PatternFly will know how to present visually. This is all about having the right HTML entity contain the right class label. We can talk through this some if its not straightforward from the PatternFly docs. Figuring out how to get Flask to render that simpler once you know the HTML it needs to produce.

#10 Updated by dkliban@redhat.com over 5 years ago

  • Status changed from ASSIGNED to MODIFIED
  • Assignee changed from skarmark@redhat.com to dkliban@redhat.com
  • % Done changed from 30 to 100

#11 Updated by bmbouter over 5 years ago

  • Target Release - Crane set to master

#12 Updated by mhrivnak over 5 years ago

  • Target Release - Crane changed from master to 1.1.0

#13 Updated by dkliban@redhat.com over 5 years ago

  • Status changed from MODIFIED to 5

#14 Updated by dkliban@redhat.com about 5 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#15 Updated by bmbouter over 2 years ago

  • Sprint set to January 2015

#16 Updated by bmbouter over 2 years ago

  • Sprint/Milestone deleted (9)

#17 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF