Project

General

Profile

InterServerSync » History » Version 29

Chris Duryee, 11/12/2015 11:56 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 28 Chris Duryee
 * target is Katello 2.5
21
 * allow exporting and importing of products and repos in CVs
22
 * support for import/export of products and repos via web UI
23 15 Chris Duryee
 * export/import can occur via hammer, but some filesystem-level access is needed for accessing yum repo exports (remote mount, scp, http, etc)
24 1 Chris Duryee
 * only yum is supported
25
 * incremental dumps are supported
26
27 28 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). Phase 1 will also support creating a "blessed" content view that can have its repos exported from one Foreman/Katello to other instances.
28 3 Chris Duryee
29 1 Chris Duryee
h4. Phase 2 "web UI and optimization" goals
30
31 28 Chris Duryee
 * target is post-2.5
32 16 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
33
 * entire export is written to disk (both CSVs and repo contents), allowing for a single tarball or iso to have all data.
34 1 Chris Duryee
35
h4. Phase 3 "do it online and with less disk space" goals
36 16 Chris Duryee
37 28 Chris Duryee
 * target is post-2.5
38 6 Chris Duryee
 * stream export/import data from one Foreman/katello to another without needing to write a full export to disk
39
 * streaming must be able to be initiated from either the source or destination foreman/katello
40 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)
41 6 Chris Duryee
42
h4. Phase 4+ "rinse and repeat" goals
43 1 Chris Duryee
44
 * allow exporting and importing of other data (environments, content views outside of the default CV for each repo in Library, etc)
45
 * support for ostree, docker, puppet content
46
47 3 Chris Duryee
h3. Phase 1 Design
48
49 26 Thomas McKay
Development steps
50 27 Thomas McKay
# Step 1 - export
51
> # As a user, I would like an API to export specific repositories.
52 28 Chris Duryee
> > * "Feature #12446":http://projects.theforeman.org/issues/12446 : Add ability to export yum repositories (both custom and RH) to disk
53 27 Thomas McKay
> > * Specify lifecycle environment and content view.
54
> # As a user, I would like an API to export specific products.
55
> # As an admin, I would like a role to limit which users may export.
56
> > * Based on product read, repository read, export true?
57 28 Chris Duryee
> # "Feature #12446" As an admin, I would like a setting to specify where exported files are stored on the server.
58 27 Thomas McKay
> > * How are the files organized (per org, per user, per cv, per env)?
59
> # As a user, I want to choose export format of iso, tgz, or dir
60
# Step 2 - import
61 29 Chris Duryee
> # "Feature #12459": http://projects.theforeman.org/issues/12459 : As a user, I want to temporarily set where to sync a repository from.
62 27 Thomas McKay
> # As a user, I want to permanently set where to sync a repository from.
63
> # As a user, I want to temporarily/permanently set sync location for a product.
64
> # As a katello, I want to prevent import of Red Hat products into custom products.
65
> > * If the Red Hat product already exists, it may sync from the location. A custom product may not sync Red Hat content.
66
# Step 3 - repository enable
67 1 Chris Duryee
> # As a user, I want to change the CDN to point to an export location.
68 27 Thomas McKay
> # As a katello, I want the repository choices shown on the Red Hat Repositories page to be limited to what is in the export.
69
> > * Only the Red Hat repos that were exported should be displayed as available for enable.
70
> > * If a product was enabled previously, it should be shown as already enabled.
71 26 Thomas McKay
72
73 3 Chris Duryee
h4. Hammer design
74 1 Chris Duryee
75 19 Chris Duryee
Phase 1 uses hammer to do some of the heavy lifting. This gets addressed in phase 2.
76 1 Chris Duryee
77 15 Chris Duryee
<pre>
78
79 28 Chris Duryee
# export a repository to disk on the Katello server (need to do this for each repo but can be a repo in a CV)
80 15 Chris Duryee
hammer repository export --id <id>
81
82
# export products to CSV
83
hammer csv products --csv-export --csv-file products.csv 
84
85
# replace URL with on-disk location for place to sync from on destination katello
86
sed -i 's#https://repos.fedorapeople.org/#file:///mnt/imports/#g' /tmp/foo.csv
87 20 Chris Duryee
88 15 Chris Duryee
# import steps
89 18 Chris Duryee
90 11 Chris Duryee
# ensure export is available, then run
91 25 Thomas McKay
hammer csv products --csv-import --csv-file products.csv 
92
93
# kick off syncs for imported products
94
hammer repository synchronize --id <id>
95
</pre>
96
97 11 Chris Duryee
h3. Phase 2 Design
98
99
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.
100
101
102 1 Chris Duryee
h4. API modifications
103 11 Chris Duryee
104 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.
105 1 Chris Duryee
106
h4. Web UI design/mockup
107
108 11 Chris Duryee
(need to fill in)
109
110 15 Chris Duryee
h4. User Stories
111 11 Chris Duryee
112 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
113 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
114
 * 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.
115 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.
116 11 Chris Duryee
117
h3. Phase 3 Design
118
119
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.
120
121 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.
122 11 Chris Duryee
123
h3. Phase 4 Design
124
125
Phase 4 adds additional content types and data to ISS. Detailed design will be added here after phase 2 or phase 3 is complete.