HostUnification » History » Version 24
Justin Sherrill, 05/12/2015 09:53 AM
1 | 1 | Justin Sherrill | h1. Host Unification |
---|---|---|---|
2 | 2 | Justin Sherrill | |
3 | |||
4 | 6 | Justin Sherrill | h2. Goals |
5 | 1 | Justin Sherrill | |
6 | 6 | Justin Sherrill | h3. Main Goal |
7 | |||
8 | 1 | Justin Sherrill | * Unify "Content Hosts" and Hosts so that they are one object based on a 'Host'. The content and subscription portions simply become attributes/concerns/aspects of a Host object. |
9 | 2 | Justin Sherrill | |
10 | 6 | Justin Sherrill | h3. Secondary Goals |
11 | 1 | Justin Sherrill | |
12 | 6 | Justin Sherrill | * Create a supported API for katello content and subscription aspects of a host |
13 | 14 | Justin Sherrill | * Plan and implement a generic way for Host objects to be split up and be plugable. The host would have different aspects such as Puppet, Provisioning, & Content, any of which are optional. |
14 | 13 | Justin Sherrill | * Migrate Content Hosts to scoped search |
15 | * Split apart content and subscription information & logic |
||
16 | 1 | Justin Sherrill | |
17 | 13 | Justin Sherrill | h4. Non-Goals |
18 | 6 | Justin Sherrill | |
19 | * Unified host UI |
||
20 | 2 | Justin Sherrill | |
21 | 3 | Justin Sherrill | h2. Design |
22 | 2 | Justin Sherrill | |
23 | h4. Ideal Design |
||
24 | We have presented two designs, one design based somewhat on this discussion: |
||
25 | |||
26 | https://groups.google.com/forum/#!searchin/foreman-dev/shim/foreman-dev/9ByQmAtKokQ/W2V924xqtYUJ |
||
27 | |||
28 | 21 | Justin Sherrill | Initial implementation here: https://github.com/ShimShtein/foreman/tree/host-concerns (PR Pending very soon) |
29 | |||
30 | 23 | Justin Sherrill | !http://projects.theforeman.org/attachments/download/1254/aspect.png! |
31 | 2 | Justin Sherrill | |
32 | The goal is to open a pull request with this design implemented for the Puppet related portion and if feedback is positive to proceed with the Content and Subscription portions. |
||
33 | |||
34 | h4. Fallback design: |
||
35 | |||
36 | If this does not go favourably, we present this alternative design which is very similar but simpler in nature: |
||
37 | |||
38 | 1 | Justin Sherrill | !http://projects.theforeman.org/attachments/download/1229/simple.png! |
39 | 3 | Justin Sherrill | |
40 | 9 | Justin Sherrill | Host Group attributes today (Content view, Lifecycle Environment) would remain on the Host Group Object |
41 | |||
42 | 3 | Justin Sherrill | |
43 | h2. Api/Cli changes |
||
44 | |||
45 | At a minimum, no api/cli changes would be needed and all functionality could remain with the proposed designs using existing controllers and cli commands. However given that the current katello systems controller is 'deprecated', we greatly need to plan for a supported api. Based on the discussions here: https://groups.google.com/forum/#!topic/foreman-dev/4Y4qxyknMwI |
||
46 | |||
47 | 7 | Justin Sherrill | From a user perspective all aspects would appear as a single resource and would all be contained within that resource. include[] could be passed on index and show to include the various aspects: |
48 | 1 | Justin Sherrill | |
49 | 7 | Justin Sherrill | <pre> |
50 | GET /api/v2/hosts?search="content_attr=foo"&include[]=content |
||
51 | GET /api/v2/hosts/:id?include[]=content |
||
52 | GET /api/v2/hosts/:id?include[]=subscriptions |
||
53 | PUT /api/v2/hosts/:id/packages/install |
||
54 | </pre> |
||
55 | 1 | Justin Sherrill | |
56 | 7 | Justin Sherrill | <pre> |
57 | PUT /api/v2/hosts/3/ {'content_view_id': 5} |
||
58 | </pre> |
||
59 | |||
60 | Hammer commands: |
||
61 | |||
62 | <pre> |
||
63 | hammer host details --id=3 |
||
64 | hammer host update --content-view=myView |
||
65 | hammer host errata apply --host-id=3 --errata-ids=RHSA-2014:3 |
||
66 | </pre> |
||
67 | |||
68 | |||
69 | 3 | Justin Sherrill | h2. User Stories (P1): |
70 | |||
71 | 1 | Justin Sherrill | (1 man sprint = 20 points) |
72 | |||
73 | 5 | Justin Sherrill | * As a user, I should be able to create a host without a puppet environment (2) |
74 | 11 | Justin Sherrill | OR |
75 | 5 | Justin Sherrill | * As a developer, I want to split out all puppet concerns to their own 'aspect' (10) |
76 | 11 | Justin Sherrill | |
77 | 3 | Justin Sherrill | * As a user, i expect host create/update/delete to be dynflowed (wrapping the AR action), via foreman_tasks or in core to allow plugins to hook into CUD to interact with backend services (4) |
78 | * As a developer, i want to migrate the existing content host model to the new unified models for content and subscriptions (10) |
||
79 | * As a developer, I want to migrate all the existing content host dynflow actions to use the new unified model (4) |
||
80 | * As a user, i want an upgrade provided to move existing content-hosts to the new unified models (4) |
||
81 | * As a developer, I want to pull system packages into the database (3) |
||
82 | * As a user, I should be able to search hosts by content attributes (2) |
||
83 | * As a user, I should be able to search hosts by subscription attributes (2) |
||
84 | * As a user, I expect subscription facts to live alongside puppet facts. (4) |
||
85 | 10 | Justin Sherrill | * As a user, I should be able to add & remove hosts to host collections instead of content-hosts (5) |
86 | * As a user, bulk actions should be based off hosts instead of content hosts (4) |
||
87 | * As a user, I should be able to register a host with subscription-manager via username and password with the new data model, and a Host should be created (4) |
||
88 | * As a user, I should be able to register a host with subscription-manager via activation key with the new data model, and a Host should be created (4) |
||
89 | * As a user, I should be able to register with subscription-manager to an existing host that has never registered with sub-man before (3) |
||
90 | * As a user, I should be able to register with subscription-manager to an existing host that has previously registered with subscription-manager, and have the old registration be removed, generating a new UUID (3) |
||
91 | 3 | Justin Sherrill | * As a user, virt-who should continue to work with the new unified model, including hypervisor registration. An hypervisor registered through virt-who would have content capabilities. (5) |
92 | 5 | Justin Sherrill | * As a user, i expect package profile uploading to continue to work under the unified model (2) |
93 | 3 | Justin Sherrill | * As a user, i expect client actions (errata install, package install, etc..) to continue to work under the unified model (3) |
94 | * As a user, i expect the subscription and content aspects of hosts to be identified by their host id, not a uuid (3) |
||
95 | * As a user, i expect to be able to find the uuid of a host with subscriptions within the UI/hammer (1) |
||
96 | * As a user, i expect to be able to search hosts by applicable errata (.5) |
||
97 | * As a user, i expect to be able to search hosts by installed package (.5) |
||
98 | 1 | Justin Sherrill | * As a user, i expect to be able to search hosts by subscription facts (.5) |
99 | 3 | Justin Sherrill | * As a user, i expect existing apis (and thus hammer commands and the UI) to continue to work under the new model, if new apis are not added (8) |
100 | 20 | Justin Sherrill | * As a user, I expect to see an error when attempting to migrate hosts to another environment if they are registered with subscription-manager (2) |
101 | * As a user, I expect the ability to unsubscribe a host registered with subscription-manager, yet leave the host record intact (2) |
||
102 | * As a user, I expect any subscription action performed on a host that is not registered to candlepin to throw a warning suggesting that it be registered (2) |
||
103 | * As a user, I expect any content action performed on a host that is not registered in pulp to throw a warning suggesting how it be registered (2) |
||
104 | 24 | Justin Sherrill | * As a user, I expect content actions to be hidden and not function for a host without any content aspect (3) |
105 | 1 | Justin Sherrill | |
106 | 3 | Justin Sherrill | h2. User Stories (P2) |
107 | 17 | Justin Sherrill | |
108 | 3 | Justin Sherrill | * As a developer, I want an api to inject new apipie params into the params of host & hostgroup Create/Update (5) |
109 | 22 | Justin Sherrill | * As a developer, I want an api to define different rabl 'views' of a host/hostgroup for index and show. This may also need to include an 'includes' section for improving performance. (5) |
110 | 12 | Justin Sherrill | * As a user, I want to be able to specify what views to render for my host (3) |
111 | 1 | Justin Sherrill | * As a user, i expect an api for interacting with content and subscription aspects of hosts (6) |
112 | * As a developer, the content hosts UI needs to utilize new v2 apis for interacting with the subscription and content aspects of a host (8) |
||
113 | 20 | Justin Sherrill | * As a user, I want the ability to force unsubscribe hosts registered with subscription manager when attempting to migrate them across organizations (3) |
114 | |||
115 | 16 | Justin Sherrill | |
116 | 12 | Justin Sherrill | * As a hammer developer, I want to be able to inject attributes to display on an info command (4) |
117 | * As a hammer developer, I want to be able to inject parameters into the GET request of a particular info command (8) |
||
118 | 1 | Justin Sherrill | * As a user, I want to see content and subscription related items when running 'hammer host info' (1) |
119 | 10 | Justin Sherrill | * As a user, i expect the following hammer commands to be migrated: |
120 | 15 | Justin Sherrill | ** hammer content-host errata apply (.5) |
121 | ** hammer content-host errata info (.5) |
||
122 | ** hammer content-host errata list (.5) |
||
123 | ** hammer content-host package install (.5) |
||
124 | ** hammer content-host package remove (.5) |
||
125 | ** hammer content-host package upgrade e (.5) |
||
126 | ** hammer content-host package upgrade-all (.5) |
||
127 | ** hammer content-host package-group install (.5) |
||
128 | ** hammer content-host package-group remove (.5) |
||
129 | ** hammer content-host update (for updating content view, lifecycle environment) (.5) |
||
130 | ** hammer content-host update (for updating service-level, release-version) (.5) |
||
131 | ** hammer host puppet-classes (.5) |
||
132 | ** hammer host puppetrun (.5) |
||
133 | 5 | Justin Sherrill | |
134 | 1 | Justin Sherrill | |
135 | 18 | Justin Sherrill | h2 User Stories (P3) |
136 | 1 | Justin Sherrill | * As a developer, I want to pull in subscriptions and related hosts into the database (7) |
137 | * As a user, I expect to search for hosts by their subscriptions (.5) |