Project

Profile

Help

Story #1180

Story #1150: As a user, I can lazily fetch repositories

As a user, I can identify a lazy-loader using server.conf and Pulp will redirect for content it does not have

Added by bmbouter about 6 years ago. Updated over 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

100%

Estimated time:
(Total: 0:00 h)
Platform Release:
2.8.0
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

A new section should be added to server.conf called [lazy] which will have a single setting named "redirect_url". This setting will be blank by default. An appropriate doc block needs to be created similar to other server.conf sections and a default value of '' needs to be added to config.py.

A new redirect handler will need to be added at the platform level in urls.py. I'll suggest 'v2/content/redirect'. The WSGI handler is rooted at '/pulp/api' so the user-facing full path of this redirection handler will be '/pulp/api/v2/content/redirect'. If "redirect_url" setting defined above is set, the Django handler will use the value of "redirect_url" and append the original request path and return the result as a HTTP 302 redirect. This handler should not force a specific protocol handler to use (ie: http vs https), but should simply append the string values together. If "redirect_url" is not configured (the default) this URL handler should always return a 404. If the user requested the redirect URL directly then the expected WSGI environment variables containing the "original" request won't be set so the correct response would be a HTTP 400 (Bad Request).

BEWARE: the "redirect_url" should probably NOT contain a protocol handler when the user specifies this setting. The redirect response will also not respond with a protocol handler. Hopefully all clients will try the redirected URL with the "same" protocol as the original request. The client is expected to preserve the protocol type (http, https, etc) when it makes the next request. The docs in server.conf should also no advocate that a protocol handler will be used. A user could specify a protocol handler, but then all responses will be forced onto the new protocol type which will break things like content protection and/or clients that don't support the specified protocol handler.

Client traffic is expected to arrive at this URL by each plugin having its content-serving virtualhost configured with the ErrorDocument directive. Unfortunately this needs to be added to each content type file which configures how content is served. This story has many child tasks which introduce this change in each plugin type Pulp manages. The purpose and requirements of the ErrorDocument also need to be documented in the Pulp platform docs so third party plugins can know how to participate in the lazy feature. The ErrorDocument directive is available in Apache 2.2 and Apache 2.4.

ErrorDocument 404 /pulp/api/v2/content/redirect

The original request path will be known by request environment variables created by using ErrorDocument. The redirect handler will use the catalog data to lookup the actual unit that is being requested.

A release note needs to be made indicating the existence of the new setting in server.conf.


Checklist


Subtasks

RPM Support - Task #1182: Update the apache configuration to support Lazy.CLOSED - CURRENTRELEASEjcline@redhat.com

Actions

Related issues

Blocked by Pulp - Task #1181: Create a download_unit platform taskCLOSED - WONTFIX

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision adbd5fc0 View on GitHub
Added by jortel@redhat.com almost 6 years ago

ref #1180 - add redirect view and url signing.

Revision adbd5fc0 View on GitHub
Added by jortel@redhat.com almost 6 years ago

ref #1180 - add redirect view and url signing.

Revision cb6bdfba View on GitHub
Added by jortel@redhat.com almost 6 years ago

Merge pull request #2060 from jortel/issue-1180p

ref #1180 - add redirect view and url signing.

Revision cb6bdfba View on GitHub
Added by jortel@redhat.com almost 6 years ago

Merge pull request #2060 from jortel/issue-1180p

ref #1180 - add redirect view and url signing.

History

#1 Updated by bmbouter about 6 years ago

  • Parent task set to #1150

#2 Updated by bmbouter about 6 years ago

  • Blocked by Task #1181: Create a download_unit platform task added

#3 Updated by bmbouter about 6 years ago

  • Checklist item changed from to [ ] New section for [lazy] in server.conf, [ ] New redirect_url entry in the [lazy] section with a blank default, [ ] [lazy] section in server.conf has a docblock above it documenting the section and redirect_url, [ ] A default in config.py for the redirect_url setting, which defaults to empty string, [ ] A new Django url handler at v2/content/redirect which returns a HTTP 302 if redirect_url is set and the unit exists. 404 otherwise, [ ] When a 302 is returned a unit download task is dispatched so Pulp can also download the unit, [ ] A release not documenting the new redirect_url setting
  • Description updated (diff)

#4 Updated by bmbouter about 6 years ago

  • Description updated (diff)

#5 Updated by bmbouter about 6 years ago

  • Description updated (diff)

#6 Updated by bmbouter about 6 years ago

  • Description updated (diff)

#7 Updated by bmbouter about 6 years ago

  • Description updated (diff)

#8 Updated by bmbouter about 6 years ago

  • Description updated (diff)

#9 Updated by jcline@redhat.com about 6 years ago

  • Description updated (diff)

#10 Updated by jortel@redhat.com about 6 years ago

  • Checklist item changed from [ ] New section for [lazy] in server.conf to [x] New section for [lazy] in server.conf

#11 Updated by jortel@redhat.com about 6 years ago

  • Checklist item changed from [ ] New redirect_url entry in the [lazy] section with a blank default to [x] New redirect_url entry in the [lazy] section with a blank default

#12 Updated by jortel@redhat.com about 6 years ago

  • Checklist item changed from [ ] [lazy] section in server.conf has a docblock above it documenting the section and redirect_url to [x] [lazy] section in server.conf has a docblock above it documenting the section and redirect_url

#13 Updated by jortel@redhat.com about 6 years ago

  • Checklist item changed from [ ] A default in config.py for the redirect_url setting, which defaults to empty string to [x] A default in config.py for the redirect_url setting, which defaults to empty string

#14 Updated by jortel@redhat.com about 6 years ago

  • Checklist item changed from [ ] A new Django url handler at v2/content/redirect which returns a HTTP 302 if redirect_url is set and the unit exists. 404 otherwise to [x] A new Django url handler at v2/content/redirect which returns a HTTP 302 if redirect_url is set and the unit exists. 404 otherwise

#15 Updated by jortel@redhat.com about 6 years ago

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

#16 Updated by jortel@redhat.com almost 6 years ago

  • Checklist item changed from [ ] When a 302 is returned a unit download task is dispatched so Pulp can also download the unit to [x] When a 302 is returned a unit download task is dispatched so Pulp can also download the unit

#17 Updated by jortel@redhat.com almost 6 years ago

  • Checklist item changed from [ ] A release not documenting the new redirect_url setting to [x] A release not documenting the new redirect_url setting

#18 Updated by jortel@redhat.com almost 6 years ago

  • Checklist item changed from [x] When a 302 is returned a unit download task is dispatched so Pulp can also download the unit to [ ] When a 302 is returned a unit download task is dispatched so Pulp can also download the unit

#19 Updated by jortel@redhat.com almost 6 years ago

  • Status changed from ASSIGNED to POST

#20 Updated by ipanova@redhat.com almost 6 years ago

  • Status changed from POST to MODIFIED

#21 Updated by jortel@redhat.com almost 6 years ago

  • Status changed from MODIFIED to POST

Moving back to post because it's been merged to the lazy-content feature branch but not yet merged to a build branch.

#22 Updated by jcline@redhat.com over 5 years ago

  • Status changed from POST to MODIFIED

#23 Updated by rbarlow over 5 years ago

  • Status changed from MODIFIED to 5
  • Platform Release set to 2.8.0

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

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#25 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF