Project

Profile

Help

Task #5837

closed

Story #3821: As a user, I can migrate from Pulp 2 to Pulp 3

Specify pulp2_distributor_repository_ids instead of distributor_ids

Added by ipanova@redhat.com about 5 years ago. Updated over 4 years ago.

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

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
No
Tags:
Sprint:
Sprint 64
Quarter:

Description

Motivation

Distributor can't be identified by distributor_id, the uniqueness constraint for pulp2 distributor is `distributor_id` + `repo_id`.
pulp-admin creates a distributor with distributor_id=distributor_type_id, so we can't rely on distributor_id at all. It can be the same for many repositories.

Solution

Migration plan will accept pulp2_distributor_repository_ids( repo_id of the distributor associated to it). If repo has 2 distributors, we will migrate both of them.

Update Migration plan parsing: fetch distributors from the mentioned repos, filter only those distributors type that are specified in the Migrator, create a namedtuple that will contain pulp2repo _id( we want to migrate) and distributor Object ID( distributor we want to use to create Distribution)

Example of a plan


 {
    "plugins": [
       { 
         "type": "iso",  # it should be a pulp2 type
         "repositories" :  [
           {
             "name": "foo",
             "pulp2_importer_repository_id":  "my_repo_id to use to find an importer to migrate"
             "repository_versions": [
                 {
                   "pulp2_repository_id": "idA",
                   "distributor_ids":  ["pulp2_distributor_repository_id1", "pulp2_distributor_repository_id2"] 

                  },                
                  {
                    "pulp2_repository_id": "idB",
                    "distributor_ids":  ["pulp2_distributor_repository_id3"]
                  },
               ]
            }
        ]
     },
     {
       "type": "docker",
     }
  ]
}

Example of parsed plan


repodistribution = namedtuple('repodistribution', ['repo_id', 'dist_ids'])

 pulp3_repo_setup = {'foo': {'pulp2_importer_repository_id': 'my_repo_id', 'versions': [repodistribution('idA', [ObjectId("5de97a32c998ac5dffb0d6a4"), ObjectId("5de97a33c998ac5dffb0d6aa")]), repodistribution('idB', [ ObjectId("5de97a33c998ac5dffb0d6ad")])]}}
Actions #1

Updated by ipanova@redhat.com about 5 years ago

  • Description updated (diff)
Actions #2

Updated by ttereshc about 5 years ago

  • Tracker changed from Issue to Task
  • Subject changed from Specify pulp2_distributor_repository_id instead of distributor_id to Specify pulp2_distributor_repository_ids instead of distributor_ids
  • Description updated (diff)
  • % Done set to 0
Actions #3

Updated by ipanova@redhat.com about 5 years ago

  • Description updated (diff)
Actions #4

Updated by ipanova@redhat.com about 5 years ago

  • Sprint set to Sprint 63
Actions #5

Updated by ipanova@redhat.com about 5 years ago

  • Description updated (diff)
Actions #6

Updated by ipanova@redhat.com about 5 years ago

  • Description updated (diff)
Actions #7

Updated by ipanova@redhat.com about 5 years ago

  • Parent issue set to #3821
  • Tags Pulp 2 to 3 Migrate added
Actions #8

Updated by ipanova@redhat.com about 5 years ago

  • Groomed changed from No to Yes
Actions #9

Updated by dalley about 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley
Actions #10

Updated by dalley about 5 years ago

  • Status changed from ASSIGNED to POST
Actions #11

Updated by ttereshc almost 5 years ago

  • Project changed from Pulp to Migration Plugin
Actions #12

Updated by rchan almost 5 years ago

  • Sprint changed from Sprint 63 to Sprint 64

Added by dalley almost 5 years ago

Revision 9b06d565 | View on GitHub

Specify pulp2_distributor_repository_ids instead of distributor_ids

closes: #5837 https://pulp.plan.io/issues/5837

Added by dalley almost 5 years ago

Revision 9b06d565 | View on GitHub

Specify pulp2_distributor_repository_ids instead of distributor_ids

closes: #5837 https://pulp.plan.io/issues/5837

Added by dalley almost 5 years ago

Revision 9b06d565 | View on GitHub

Specify pulp2_distributor_repository_ids instead of distributor_ids

closes: #5837 https://pulp.plan.io/issues/5837

Actions #13

Updated by dalley almost 5 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #14

Updated by ttereshc over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
  • Sprint/Milestone set to 0.1.0
Actions #15

Updated by bmbouter over 4 years ago

  • Tags deleted (Pulp 2 to 3 Migrate)

We're removing the 'Pulp 2 to 3 Migrate' tag to allow membership of the Migration Plugin project in Redmine to be the controlling area https://pulp.plan.io/projects/migration

Also available in: Atom PDF