Project

General

Profile

InterServerSync » History » Version 26

Thomas McKay, 11/03/2015 07:50 AM

1 1 Chris Duryee
h1. InterServerSync
2
3 2 Chris Duryee
h3. What is ISS?
4
5
Inter-Server Sync is a feature designed to help users in two scenarios:
6
7
 * users who have a connected Foreman/Katello instance and disconnected Foreman/Katello, who want to propogate data from the connected side of their network to the disconnected side.
8
 * users who have a "main" Foreman/Katello and want to propogate some data (but not all data) to other instances. One example is for users who have "blessed" content views that are validated by the IT department, and want to propogate those down elsewhere.
9
10 5 Chris Duryee
More info is available at https://fedorahosted.org/spacewalk/wiki/InterSpacewalkServerSync.
11
12 1 Chris Duryee
h3. Goals
13
14 7 Chris Duryee
Roughly, phase 1 is the minimal "get it working" phase where we have a demoable end-to-end scenario that works via hammer. After that, we will collect feedback and move on to phase 2 which moves some of the grunt work done by hammer to the server, and adds web UI support. Phase 3 enhances the "connected" scenario, and Phase 4 will be for support of additional content types and new types of foreman/katello data.
15 1 Chris Duryee
16 22 Chris Duryee
All changes should be merged by the end of each phase in order to keep PR size down.
17 10 Chris Duryee
18 1 Chris Duryee
h4. Phase 1 "get it working" goals
19
20 15 Chris Duryee
 * allow exporting and importing of products (content will land in Library)
21
 * export/import can occur via hammer, but some filesystem-level access is needed for accessing yum repo exports (remote mount, scp, http, etc)
22 1 Chris Duryee
 * only yum is supported
23
 * incremental dumps are supported
24
25 14 Chris Duryee
Note: phase 1 replaces katello-disconnected script, and solves the same problem that Spacewalk solves with Inter-Spacewalk Sync in a minimal fashion (notably, without a web UI which comes in phase 2 or the disk space usage optimization which comes in phase 3).
26 1 Chris Duryee
27 3 Chris Duryee
h4. Phase 2 "web UI and optimization" goals
28 1 Chris Duryee
29 3 Chris Duryee
 * API clean up to allow for bulk export/import with only a few server calls - this is needed for web UI support since we can't rely on hammer
30 16 Chris Duryee
 * support for import/export of products and repos via web UI
31
 * entire export is written to disk (both CSVs and repo contents), allowing for a single tarball or iso to have all data.
32 1 Chris Duryee
33 16 Chris Duryee
h4. Phase 3 "do it online and with less disk space" goals
34 1 Chris Duryee
35 6 Chris Duryee
 * stream export/import data from one Foreman/katello to another without needing to write a full export to disk
36
 * streaming must be able to be initiated from either the source or destination foreman/katello
37 16 Chris Duryee
 * allow export and import without filesystem access to machine (hammer or web ui can provide download of export and upload of import)
38 6 Chris Duryee
39
h4. Phase 4+ "rinse and repeat" goals
40 1 Chris Duryee
41 23 Chris Duryee
 * allow exporting and importing of other data (environments, content views outside of the default CV for each repo in Library, etc)
42 1 Chris Duryee
 * support for ostree, docker, puppet content
43
44
h3. Phase 1 Design
45
46
There are two areas that need to be updated for phase 1. We need to allow for exporting and importing of yum repo data (including incremental updates), and we need to allow for exporting and importing of product and library CV data. The former is largely provided by Pulp, and the latter is provided by hammer-cli-csv.
47
48 12 Chris Duryee
We will need to add the Pulp export distributor on newly created yum repos. Additionally, existing repos will need to have the export distributor added in via migration (this work is currently in progress).
49 1 Chris Duryee
50 3 Chris Duryee
Phase 1 allows for hammer-cli-csv doing a lot of "grunt" work in loading the CSV data. This will need to be done server-side in later phases.
51
52 26 Thomas McKay
Development steps
53
# Export a specific repository from Library
54
# Export a specific product from Library
55
# Export from content view in a lifecycle other than Library
56
# Export format of iso, tgz, or dir
57
# Export both Red Hat and custom proucts
58
59
60 3 Chris Duryee
h4. Hammer design
61 1 Chris Duryee
62 19 Chris Duryee
Phase 1 uses hammer to do some of the heavy lifting. This gets addressed in phase 2.
63 1 Chris Duryee
64 15 Chris Duryee
<pre>
65
66
# export a repository to disk on the Katello server (need to do this for each repo)
67
hammer repository export --id <id>
68
69
# export products to CSV
70
hammer csv products --csv-export --csv-file products.csv 
71
72
# replace URL with on-disk location for place to sync from on destination katello
73
sed -i 's#https://repos.fedorapeople.org/#file:///mnt/imports/#g' /tmp/foo.csv
74
75
# import steps
76
77
# ensure export is available, then run
78
hammer csv products --csv-import --csv-file products.csv 
79 1 Chris Duryee
80 19 Chris Duryee
# kick off syncs for imported products
81
hammer repository synchronize --id <id>
82 15 Chris Duryee
</pre>
83
84 13 Chris Duryee
h4. API modifications
85 1 Chris Duryee
86 17 Chris Duryee
A new API call will be added to perform exports and imports, which will trigger Pulp calls to the export distributor. The export distributor will need to be added to new yum repos, and added via migration to existing repos. We may need to add additional APIs for allowing imports of incremental updates as well.
87 13 Chris Duryee
88
h4. User Stories
89
90 18 Chris Duryee
 * as a katello hammer user, I would like to be able to export yum repositories to disk with a hammer command. This includes both "full" and "incremental" export. The demoable output would be exporting and showing that there is content that can be synced by another Katello.. On-disk export location can be set in katello.yml
91 13 Chris Duryee
92 20 Chris Duryee
 * as a katello hammer user, I would like to be able to export and import product information to a CSV file via hammer, including repository information. The demoable output would be exporting products from Katello A, then importing the product to Katello B. Katellos A and B should have the same products and repos in Library.
93 15 Chris Duryee
94 18 Chris Duryee
 * as a katello hammer user, I would like to ensure that date-based incremental imports import successfully, using data generated from the product CSV.
95 11 Chris Duryee
96 25 Thomas McKay
* As a ISS user, I woule like to export from a capsule.
97
98
* As an ISS user, I would like to import to a capsule.
99
100
* As an ISS user, I would like docs to describe best way to share exported content with another katello.
101
102 11 Chris Duryee
h3. Phase 2 Design
103
104
The main user-facing output of Phase 2 is the ability to do import/export from the web UI. An additional important feature is that data processing does not occur on the hammer client anymore. This greatly improves resiliency of the import/export process.
105
106
107 1 Chris Duryee
h4. API modifications
108 11 Chris Duryee
109 21 Chris Duryee
API calls will need to be added to kick off the product/repo export task, with an optional "start at" date for incremental exports. A call will also need to be added to start the import task.
110 1 Chris Duryee
111
h4. Web UI design/mockup
112
113 11 Chris Duryee
(need to fill in)
114
115 15 Chris Duryee
h4. User Stories
116 11 Chris Duryee
117 15 Chris Duryee
 * as a hammer user, I would like product CSV creation and processing to occur server-side. Ideally, I will be able to make a call that kicks off a dynflow task to create or import the CSV. The CSV can be uploaded/downloaded, or written to disk in the export directory
118 21 Chris Duryee
 * as a hammer user, I would like to run a single command that performs a product CSV export and writes any needed repo data to disk
119
 * as a hammer user, I would like to run a single command that performs a product CSV import and reads any needed repo data from disk via repo sync. I will be able to override the sync URL (perhaps using something defined in katello.yml)  in the call so I don't have to modify the product CSV with a sed statement.
120 15 Chris Duryee
 * as a web UI user, I would like to be able to perform the same two import/export actions as above, but without hammer.
121 11 Chris Duryee
122
h3. Phase 3 Design
123
124
This phase is further optimization, focusing on the "connected" scenario where the two foreman/katello instances can talk to each other. Previous phases treated the connected scenario as being solved by the disconnected scenario, which meant that all data was written to disk and optionally transferred via scp or http.
125
126 24 Chris Duryee
NOTE: I added this area just to give an idea of roadmap, but it is complex enough to need its own design iteration.
127 11 Chris Duryee
128
h3. Phase 4 Design
129
130
Phase 4 adds additional content types and data to ISS. Detailed design will be added here after phase 2 or phase 3 is complete.