summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhipengl <zhipengs.liu@intel.com>2018-10-22 18:16:28 +0000
committerzhipeng liu <zhipengs.liu@intel.com>2018-10-31 02:13:02 +0000
commit5676cbd92be1a9e6b75c0bfa3f155ae158a8771a (patch)
treecf9652f90ed7c071080d05258884503355760d99
parent756973392675b45bd8d501163ce13b92badaf4bd (diff)
Adding spec: refactor init/config related non-openstack patches.
For RPM patches related to adding or changing StarlingX specific systemd service files, configuration files or other types, 1)if they are not overwritting files already delivered by the upstream RPM, refactor and have an specific config rpm that delivers the new file instead of original patch. 2)if they need to change files delivered by the upstream RPM, use puppet to change it instead of original patch. Story: 2003768 Change-Id: I3112ecebaec2e8e1531922e87036209f6acc61dd Signed-off-by: zhipengl <zhipengs.liu@intel.com>
Notes
Notes (review): Code-Review+2: Saul Wold <sgw@linux.intel.com> Code-Review+1: Don Penney <don.penney@windriver.com> Code-Review+2: Ian Jolliffe <ian.jolliffe@windriver.com> Code-Review+2: Brent Rowsell <brent.rowsell@windriver.com> Workflow+1: Ian Jolliffe <ian.jolliffe@windriver.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 05 Nov 2018 14:44:02 +0000 Reviewed-on: https://review.openstack.org/612292 Project: openstack/stx-specs Branch: refs/heads/master
-rw-r--r--specs/2019.03/approved/multi-os-2003768-refactor-init-config-patches.rst262
1 files changed, 262 insertions, 0 deletions
diff --git a/specs/2019.03/approved/multi-os-2003768-refactor-init-config-patches.rst b/specs/2019.03/approved/multi-os-2003768-refactor-init-config-patches.rst
new file mode 100644
index 0000000..3f61a1c
--- /dev/null
+++ b/specs/2019.03/approved/multi-os-2003768-refactor-init-config-patches.rst
@@ -0,0 +1,262 @@
1..
2 This work is licensed under a Creative Commons Attribution 3.0 Unported
3 License. http://creativecommons.org/licenses/by/3.0/legalcode
4 http://creativecommons.org/licenses/by/3.0/legalcode
5
6============================
7Refactor init/config patches
8============================
9
10Storyboard: https://storyboard.openstack.org/#!/story/2003768
11
12For package patches related to adding or changing StarlingX specific systemd
13service files, configuration files or other types,
14if they are not overwritting files already delivered by the upstream RPM,
15refactor and have an specific config rpm that delivers the new file instead of
16original patch.
17if they need to change files delivered by the upstream RPM, use puppet to
18change it instead of original patch.
19
20Problem description
21===================
22
23There are many patches related to adding or changing init script, config file,
24systemd service adding and changing. We'd better to do some refactor on these
25patches and remove them, so that we can decrease total patch number and use
26binary packages instead of source packages.
27
28Use Cases
29=========
30
31There are totally 8 cases for all init/config patches.
321)Add configuration files to system folder.
332)Add scripts to system folder.
343)Add service files to /etc/systemd/system/.
354)Change configuration files with noreplace attribute in system folder
365)Change files including configuration file, script and service without
37noreplace attribute in system folder.
386)Change service files in usr/lib/systemd/system/ that will be started by SM
39after power on.
407)Change service files in usr/lib/systemd/system/ that will be started by
41systemd after power on.
428)Already uses puppet instead of earlier patch, or paired patches exist that we
43can rework and decrease unnecessary meta patch.
44
45Proposed change
46===============
47
48Proposed solutions for all these cases except for case 5/6
491)Use configuration package
50
51 - Add a configuration package folder under the folder where the
52 original package sit. Name package like nfs-utils-config.
53
54 - Use this configuration package to package configuration files to
55 system folder.
56
57 - Add "requires: original package" in spec file like
58 “Requires: nfs-utils” to make sure original package is installed
59 before configuration package.
60
61 - If we need to add files, we can package customized files to system
62 folder.
63
64 - If we need to change files with noreplace, we can copy customized
65 files to "/usr/share/starlingx/stx.xxx.conf" first. Then in post
66 section of the spec, copy it to destination folder as xxx.conf
67 during initiation installation.
68
69 - For case 7, services are enabled by systemctl command in spec file.
70 We can package customized service file to /etc/systemd/system/,
71 like we did for memcached.
72
73 please refer to https://review.openstack.org/#/c/600868/
74 https://review.openstack.org/#/c/610459/
75
762)Use Puppet
77
78 This is the preferred method for updating configuration in existing
79 files.
80
81 - We can do some modifications on existed pp files in
82 stx/stx-config/puppet-manifests/src/modules/platform/manifests.
83
84 - For some basic configuration file change with “noreplace” attribute,
85 we can also add a pp file in above folder.
86
87 To use puppet, there are two things need to be care:
88
89 - Puppet will execute in each boot up, so the configuration file will
90 be overwritten. We need make sure the file will not be changed in
91 runtime. If the file will be changed in runtime, then we cannot use
92 puppet for it.
93
94 - Puppet will be executed based on node type. Also RPM will be
95 installed based on node type. Need to make sure both method align to
96 be executed in the same node type.
97
983)Rework current patches
99
100 Some META patches includes not only configuration related patch, but
101 also src patch or spec change like build flag.
102 After removing configuration change part out, we need rework Meta
103 patch.
104 Propose to use "spec-include-TiS-changes.patch" to include all spec
105 change or src related patch adding if there is no corresponding META
106 patch.
107
108Proposed solutions for case 5 and 6
109
1101) Change files including configuration file, script and service without
111 "noreplace" attribution in spec file.
112 Such as systemd, we need to change rule file, tmp.conf, tmp.mount and
113 so on.
114 If we change this kind of file to customized one without patch, after
115 in-service patching on this package, the file will be overwritten to
116 original one. How to handle this patching scenario? Any proposal?
117 From my point, we can utilize existed in-service patching-script
118 mechanism to call in-service script to copy customized file to
119 destination folder after patching. Any comment?
120
1212) Change service files in usr/lib/systemd/system/ that will be started by
122 SM after power on.
123 Such as net-snmp, we have 3 meta patches related to snmpd.service
124 change.
125 We can disable service in post section of spec file if the service is
126 not disabled by default. Then it will be started by SM later.
127
128Please refer to below google sheet of analysis on non-openstack init-config
129patches
130https://docs.google.com/spreadsheets/d/1ttEFreSHLoWrHVAvrFV9xMGghAVQmSfctkcD4n7
131tT9w/edit#gid=0
132
133Alternatives
134============
135
136NA
137
138Data model impact
139=================
140
141NA
142
143REST API impact
144===============
145
146NA
147
148Security impact
149===============
150
151Current solution is just used for refactoring patches and use config package or
152puppet to package or change init/config files instead of existed patches.
153No obvious security impact.
154
155Other end user impact
156=====================
157
158NA
159
160Performance Impact
161==================
162
163NA
164
165Other deployer impact
166=====================
167
168NA
169
170Developer impact
171=================
172
173The target of this feature is separating configuration part apart from source
174patch and try the best to decrease the number of patch. We will also get
175benefit when we consider multi-OS support on StarlingX.
176For new joining developers, when we do some changes that refer to configuration
177file, please keep this idea in your mind.
178
179Upgrade impact
180===============
181
182NA
183
184Implementation
185==============
186
187We have splitted the work to some tasks by SRPM package and planned to get it
188done package by package.
189General steps is below.
1901) Rework existed meta patch and remove the part for configuration that we have
191analyzed.
192
1932) Remove the patch that will not be used anymore.
194
1953) Add configuration RPM package for corresponding package that we are working
196 on, or add puppet file or modify existed puppet file to implement the logic
197 that we did with patches before.
198
1994) Rebuild and do deployment and related test to see if the change can work and
200 meet our expectation.
201
2025) Submit patch and get it reviewed before code merge.
203
204Assignee(s)
205===========
206
207Zhipeng Liu will leading the writing of the code.
208Shuicheng lin will join the task as well.
209Welcome other contributors join.
210
211Primary assignee:
212zhipengs
213
214Other contributors:
215Shuicheng
216
217Repos Impacted
218==============
219
220openstack/stx-integ
221
222Work Items
223===========
224
225There are more than 20 tasks created under story 2003768.
226
227Dependencies
228============
229
230NA
231
232Testing
233=======
234
235Basically, we will do deployment test and related configuration file check on
236different node after power on and first reboot to see that if the configuration
237file is expected in specific folders.
238For configuration file change scenario, we need to do additional patching test
239to see that if the configuration file is expected after patching.
240For service file, we need to check service status after power on, reboot
241or patching.
242
243Documentation Impact
244====================
245
246NA
247
248References
249==========
250
251NA
252
253History
254=======
255
256.. list-table:: Revisions
257 :header-rows: 1
258
259 * - Release Name
260 - Description
261 * - 2019.03
262 - Introduced