Project

Profile

Help

Story #3399

closed

As a user I can sync from a docker registry

Added by ipanova@redhat.com almost 5 years ago. Updated almost 3 years ago.

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

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 45
Quarter:

Description

As a user i can sync v2 complaint specs docker content from a docker registry which is:
- complaint v2 api specs
- supports basic auth and token auth

This story is complete when:

*I can initiate a sync from Docker Registry by providing feed and upstream name
*The sync completes without error
*I can see that the expected content was added to the repo ( + pagination support)

  1. Add upstream_name to the DockerImporter
  2. Add upstream_name to DockerImporterSerializer (including user-facing help_text):
  3. Create a sync task that accepts (importer_pk, repository_pk)
  4. Dispatch the sync task in the DockerImporterViewSet.sync detail route
  5. custom Declarative Version stage to de-duplicate tag names.

Related issues

Related to Pulp - Test #4259: As a user I can sync from a docker registryCLOSED - COMPLETErochacbrunoActions
Actions #1

Updated by amacdona@redhat.com almost 5 years ago

  • Description updated (diff)
Actions #2

Updated by amacdona@redhat.com almost 5 years ago

Should this story be for "mirror" and "additive" sync modes?

Actions #3

Updated by ipanova@redhat.com almost 5 years ago

  • Description updated (diff)
Actions #4

Updated by tomckay@redhat.com almost 5 years ago

Mirror-on-sync would be a very welcome addition to the base user story.

https://pulp.plan.io/issues/2602

Actions #5

Updated by ipanova@redhat.com over 4 years ago

  • Description updated (diff)
Actions #6

Updated by amacdona@redhat.com about 4 years ago

  • Sprint Candidate changed from Yes to No
Actions #7

Updated by rchan about 4 years ago

  • Sprint set to Sprint 43
Actions #8

Updated by amacdona@redhat.com about 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to amacdona@redhat.com
Actions #9

Updated by dkliban@redhat.com about 4 years ago

In order to implement the auth mechanism required for docker, the following objects and methods need to be added.

DockerDownloader needs to inherit from HttpDownloader[0]. The downloader's init needs to accept a keyword argument called 'auth' which is a dictionary. The downloader needs to store the auth dict as a property of the downloader - to be used by run().

The run method of the DockerDownloader needs to add the information from the auth property to the session. Then it needs to perform the download like here[1]

The DockerRemote needs to override download_factory[2] method. The DownloadFactory needs to be instantiated with downloader_overrides that contain a dict with {'https': DockerDownloader}.

The get_downloader() method of DockerRemote needs to check if auth has already been performed against the remote source. If not, perform auth. Then pass the 'auth' dict to the build() method of the factory[3].

[0] https://docs.pulpproject.org/en/3.0/nightly/plugins/plugin-api/download.html#httpdownloader
[1] https://github.com/pulp/pulp/blob/master/plugin/pulpcore/plugin/download/http.py#L169
[2] https://docs.pulpproject.org/en/3.0/nightly/plugins/plugin-api/models.html#pulpcore.plugin.models.Remote.download_factory
[3] https://github.com/pulp/pulp/blob/master/plugin/pulpcore/plugin/models/remote.py#L61

Actions #10

Updated by amacdona@redhat.com about 4 years ago

Since token auth sometimes requires frequently updating the Authorization header, it would be much simpler if it was possible to update that header for the entire session. I've opened an upstream issue https://github.com/aio-libs/aiohttp/issues/3299

Actions #11

Updated by amacdona@redhat.com about 4 years ago

  • Sprint changed from Sprint 43 to Sprint 44
Actions #12

Updated by rchan about 4 years ago

  • Sprint changed from Sprint 44 to Sprint 45

Added by amacdona@redhat.com about 4 years ago

Revision f5cb3cc7

fix functional tests

Actions #13

Updated by amacdona@redhat.com about 4 years ago

  • Status changed from ASSIGNED to MODIFIED
Actions #14

Updated by bherring almost 4 years ago

  • Related to Test #4259: As a user I can sync from a docker registry added
Actions #15

Updated by bmbouter over 3 years ago

  • Tags deleted (Pulp 3)
Actions #16

Updated by ipanova@redhat.com about 3 years ago

  • Project changed from Docker Support to Container Support
Actions #17

Updated by ipanova@redhat.com almost 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #18

Updated by ipanova@redhat.com almost 3 years ago

  • Sprint/Milestone set to 1.0.0

Also available in: Atom PDF