HostUnification » History » Version 10
Justin Sherrill, 05/04/2015 03:03 PM
1 | 1 | Justin Sherrill | h1. Host Unification |
---|---|---|---|
2 | 2 | Justin Sherrill | |
3 | 2 | Justin Sherrill | |
4 | 6 | Justin Sherrill | h2. Goals |
5 | 1 | Justin Sherrill | |
6 | 6 | Justin Sherrill | h3. Main Goal |
7 | 6 | Justin Sherrill | |
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 | 6 | 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 is optional. |
14 | 6 | Justin Sherrill | |
15 | 6 | Justin Sherrill | h4. Goals not attempted |
16 | 6 | Justin Sherrill | |
17 | 6 | Justin Sherrill | * Unified host UI |
18 | 2 | Justin Sherrill | |
19 | 3 | Justin Sherrill | h2. Design |
20 | 2 | Justin Sherrill | |
21 | 2 | Justin Sherrill | h4. Ideal Design |
22 | 2 | Justin Sherrill | We have presented two designs, one design based somewhat on this discussion: |
23 | 2 | Justin Sherrill | |
24 | 2 | Justin Sherrill | https://groups.google.com/forum/#!searchin/foreman-dev/shim/foreman-dev/9ByQmAtKokQ/W2V924xqtYUJ |
25 | 2 | Justin Sherrill | |
26 | 4 | Justin Sherrill | !http://projects.theforeman.org/attachments/download/1239/aspect.png! |
27 | 2 | Justin Sherrill | |
28 | 2 | Justin Sherrill | 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. |
29 | 2 | Justin Sherrill | |
30 | 2 | Justin Sherrill | h4. Fallback design: |
31 | 2 | Justin Sherrill | |
32 | 2 | Justin Sherrill | If this does not go favourably, we present this alternative design which is very similar but simpler in nature: |
33 | 2 | Justin Sherrill | |
34 | 1 | Justin Sherrill | !http://projects.theforeman.org/attachments/download/1229/simple.png! |
35 | 3 | Justin Sherrill | |
36 | 9 | Justin Sherrill | Host Group attributes today (Content view, Lifecycle Environment) would remain on the Host Group Object |
37 | 9 | Justin Sherrill | |
38 | 3 | Justin Sherrill | |
39 | 3 | Justin Sherrill | h2. Api/Cli changes |
40 | 3 | Justin Sherrill | |
41 | 3 | Justin Sherrill | 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 |
42 | 3 | Justin Sherrill | |
43 | 5 | Justin Sherrill | There are currently two designs: |
44 | 5 | Justin Sherrill | |
45 | 7 | Justin Sherrill | h3. Unified Api Design |
46 | 1 | Justin Sherrill | |
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 | 7 | Justin Sherrill | GET /api/v2/hosts?search="content_attr=foo"&include[]=content |
51 | 7 | Justin Sherrill | GET /api/v2/hosts/:id?include[]=content |
52 | 7 | Justin Sherrill | GET /api/v2/hosts/:id?include[]=subscriptions |
53 | 7 | Justin Sherrill | PUT /api/v2/hosts/:id/packages/install |
54 | 7 | Justin Sherrill | </pre> |
55 | 1 | Justin Sherrill | |
56 | 7 | Justin Sherrill | <pre> |
57 | 7 | Justin Sherrill | PUT /api/v2/hosts/3/ {'content_view_id': 5} |
58 | 7 | Justin Sherrill | </pre> |
59 | 7 | Justin Sherrill | |
60 | 7 | Justin Sherrill | Hammer commands: |
61 | 7 | Justin Sherrill | |
62 | 7 | Justin Sherrill | <pre> |
63 | 7 | Justin Sherrill | hammer host details --id=3 |
64 | 7 | Justin Sherrill | hammer host update --content-view=myView |
65 | 7 | Justin Sherrill | hammer host errata apply --host-id=3 --errata-ids=RHSA-2014:3 |
66 | 7 | Justin Sherrill | </pre> |
67 | 7 | Justin Sherrill | |
68 | 7 | Justin Sherrill | |
69 | 5 | Justin Sherrill | h3. Split Api |
70 | 5 | Justin Sherrill | |
71 | 3 | Justin Sherrill | The apis for interacting with the different aspects: |
72 | 3 | Justin Sherrill | |
73 | 3 | Justin Sherrill | <pre> |
74 | 3 | Justin Sherrill | GET /api/v2/hosts?search="content_attr=foo" |
75 | 3 | Justin Sherrill | GET /api/v2/hosts/:id/content/ |
76 | 1 | Justin Sherrill | GET /api/v2/hosts/:id/subscription/ |
77 | 7 | Justin Sherrill | PUT /api/v2/hosts/:id/content/packages/install |
78 | 3 | Justin Sherrill | </pre> |
79 | 3 | Justin Sherrill | |
80 | 3 | Justin Sherrill | to update a host's content: |
81 | 3 | Justin Sherrill | |
82 | 3 | Justin Sherrill | <pre> |
83 | 3 | Justin Sherrill | PUT /api/v2/hosts/3/ {'content_view_id': 5} |
84 | 3 | Justin Sherrill | OR |
85 | 3 | Justin Sherrill | PUT /api/v2/hosts/3/content {'content_view_id': 5} |
86 | 3 | Justin Sherrill | </pre> |
87 | 3 | Justin Sherrill | |
88 | 3 | Justin Sherrill | Sample hammer commands |
89 | 3 | Justin Sherrill | |
90 | 3 | Justin Sherrill | <pre> |
91 | 3 | Justin Sherrill | hammer host content details --id=3 |
92 | 3 | Justin Sherrill | hammer host content update --content-view=myView |
93 | 3 | Justin Sherrill | hammer host content errata apply --host-id=3 --errata-ids=RHSA-2014:3 |
94 | 3 | Justin Sherrill | </pre> |
95 | 3 | Justin Sherrill | |
96 | 3 | Justin Sherrill | |
97 | 3 | Justin Sherrill | h2. User Stories (P1): |
98 | 3 | Justin Sherrill | |
99 | 1 | Justin Sherrill | (1 man sprint = 20 points) |
100 | 1 | Justin Sherrill | |
101 | 5 | Justin Sherrill | * As a user, I should be able to create a host without a puppet environment (2) |
102 | 5 | Justin Sherrill | * As a developer, I want to split out all puppet concerns to their own 'aspect' (10) |
103 | 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) |
104 | 3 | Justin Sherrill | * As a developer, i want to migrate the existing content host model to the new unified models for content and subscriptions (10) |
105 | 3 | Justin Sherrill | * As a developer, I want to migrate all the existing content host dynflow actions to use the new unified model (4) |
106 | 3 | Justin Sherrill | * As a user, i want an upgrade provided to move existing content-hosts to the new unified models (4) |
107 | 3 | Justin Sherrill | * As a developer, I want to pull system packages into the database (3) |
108 | 3 | Justin Sherrill | * As a user, I should be able to search hosts by content attributes (2) |
109 | 3 | Justin Sherrill | * As a user, I should be able to search hosts by subscription attributes (2) |
110 | 3 | Justin Sherrill | * As a user, I expect subscription facts to live alongside puppet facts. (4) |
111 | 10 | Justin Sherrill | * As a user, I should be able to add & remove hosts to host collections instead of content-hosts (5) |
112 | 10 | Justin Sherrill | * As a user, bulk actions should be based off hosts instead of content hosts (4) |
113 | 10 | Justin Sherrill | * 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) |
114 | 10 | Justin Sherrill | * 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) |
115 | 10 | Justin Sherrill | * 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) |
116 | 10 | Justin Sherrill | * 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) |
117 | 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) |
118 | 5 | Justin Sherrill | * As a user, i expect package profile uploading to continue to work under the unified model (2) |
119 | 3 | Justin Sherrill | * As a user, i expect client actions (errata install, package install, etc..) to continue to work under the unified model (3) |
120 | 3 | Justin Sherrill | * As a user, i expect the subscription and content aspects of hosts to be identified by their host id, not a uuid (3) |
121 | 3 | Justin Sherrill | * As a user, i expect to be able to find the uuid of a host with subscriptions within the UI/hammer (1) |
122 | 3 | Justin Sherrill | * As a user, i expect to be able to search hosts by applicable errata (.5) |
123 | 3 | Justin Sherrill | * As a user, i expect to be able to search hosts by installed package (.5) |
124 | 1 | Justin Sherrill | * As a user, i expect to be able to search hosts by subscription facts (.5) |
125 | 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) |
126 | 3 | Justin Sherrill | |
127 | 3 | Justin Sherrill | H2. User Stories (P2) |
128 | 3 | Justin Sherrill | |
129 | 3 | Justin Sherrill | * As a user, i expect an api for interacting with content and subscription aspects of hosts (6) |
130 | 5 | Justin Sherrill | * 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) |
131 | 8 | Justin Sherrill | * As a developer, I want to be able to inject attributes to display on an info command (4) |
132 | 8 | Justin Sherrill | * As a developer, I want to be able to inject parameters into the GET request of a particular info command (8) |
133 | 8 | Justin Sherrill | * As a user, I want to see content and subscription related items when running 'hammer host info' (1) |
134 | 1 | Justin Sherrill | * As a user, i expect the following hammer commands to be migrated: |
135 | 10 | Justin Sherrill | * hammer content-host errata apply (.5) |
136 | 10 | Justin Sherrill | * hammer content-host errata info (.5) |
137 | 10 | Justin Sherrill | * hammer content-host errata list (.5) |
138 | 10 | Justin Sherrill | * hammer content-host package install (.5) |
139 | 10 | Justin Sherrill | * hammer content-host package remove (.5) |
140 | 10 | Justin Sherrill | * hammer content-host package upgrade e (.5) |
141 | 10 | Justin Sherrill | * hammer content-host package upgrade-all (.5) |
142 | 10 | Justin Sherrill | * hammer content-host package-group install (.5) |
143 | 10 | Justin Sherrill | * hammer content-host package-group remove (.5) |
144 | 10 | Justin Sherrill | * hammer content-host update (for updating content view, lifecycle environment) (.5) |
145 | 10 | Justin Sherrill | * hammer content-host update (for updating service-level, release-version) (.5) |
146 | 10 | Justin Sherrill | * hammer host puppet-classes (.5) |
147 | 10 | Justin Sherrill | * hammer host puppetrun (.5) |
148 | 5 | Justin Sherrill | |
149 | 5 | Justin Sherrill | |
150 | 5 | Justin Sherrill | H2 User Stories (P3) |
151 | 1 | Justin Sherrill | * As a developer, I want to pull in subscriptions and related hosts into the database (7) |
152 | 1 | Justin Sherrill | * As a user, I expect to search for hosts by their subscriptions (.5) |