1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
%global _empty_manifest_terminate_build 0
Name: python-ocdeployer
Version: 5.7.11
Release: 1
Summary: A tool which wraps the OpenShift command line tools to enable repeatable automated deployment of OpenShift templates
License: MIT
URL: https://www.github.com/bsquizz/ocdeployer
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d3/53/c9aff3d676c55e07e3eb3145bace1480e6d53157ca56a0a59b6d4d57fa56/ocdeployer-5.7.11.tar.gz
BuildArch: noarch
Requires: python3-sh
Requires: python3-prompter
Requires: python3-pyyaml
Requires: python3-click
Requires: python3-appdirs
Requires: python3-wait-for
Requires: python3-jinja2
Requires: python3-cached-property
Requires: python3-pytz
Requires: python3-kubernetes
Requires: python3-anytree
Requires: python3-ocviapy
%description
## Template Configuration
The best way to explain how template configuration works is to describe the process for configuring a service set.
#### A guide to creating a service set
1. Create a new directory in the `templates` directory for your service set, e.g. "myservice"
2. Add your OpenShift YAML files for your services in this directory. The files should be OpenShift template files that contain all resources needed to get your service running (except for secrets, and image streams of external images, we'll talk about that shortly...). This would commonly be things like `buildConfig`, `deploymentConfig`, `service`, `route`, etc.
3. Create a '_cfg.yml' file in your directory. The contents of this config file are explained below:
```yaml
# (optional) requires
#
# Here you can list other service sets that need to be deployed before this one can.
# Deployment will fail when processing this file if we see the required service set has
# not yet been deployed in this run of ocdeployer.
requires:
- "myotherservice"
# (optional) secrets
#
# Lists which secrets apps in this service set rely on; they will be validated or imported at run time.
# A secret is only imported once per deploy run, so if other service sets rely on the same
# secret it won't be imported again.
secrets:
- "mysecret"
# You can also specify which service accounts a secret should be linked to
- name: "othersecret"
link: ["builder"]
# (optional) custom_deploy_logic
#
# Indicates that there is a pre_deploy/post_deploy/deploy method defined for this
# service set in the 'custom' folder that should be used
custom_deploy_logic: true
# (optional) post_deploy_timeout
#
# Indicates how long custom post_deploy logic should take before timeout (in seconds).
# A null value can be handled differently depending on the post deploy logic,
# but it is recommended that it means there is "no waiting" that will occur
post_deploy_timeout: 300
# (optional) images
# Lists the image streams these services require to be imported into the destination namespace.
#
# key = the name or name:tag for the image stream. If no tag is specified, 'latest' is used.
# value = the full image docker uri
#
# 'oc import-image <key> --from="<value>"' is run at deploy time.
#
# If it already exists, it will be re-imported (and therefore the image will be updated)
images:
- cp-kafka: "confluentinc/cp-kafka"
- cp-zookeeper: "confluentinc/cp-zookeeper"
- nginx-stable-openshift: "docker.io/mhuth/nginx-stable-openshift"
- python-36-centos7: "centos/python-36-centos7"
- postgresql-95-rhel7: "registry.access.redhat.com/rhscl/postgresql-95-rhel7"
# (required) deploy_order
#
# Lists the order in which components in this service set should be deployed.
deploy_order:
# A stage deploys a group of components in sequentially and then waits for them to reach 'active'
# in parallel. By default, at the end of each stage, we wait for:
# * DeploymentConfig's to be "active"
# * StatefulSet's to be "active"
# * BuildConfig's to succeed
#
# Setting 'wait' to false under the stage disables this behavior.
#
# Stages are processed after being sorted by name.
stage0:
wait: false
components:
- "zookeeper"
stage1:
# You can specify a wait timeout. By default, 300sec is used
timeout: 600
# 'components' lists the template files that should be deployed in this stage.
# Their config is applied in openshift in the same order they are listed.
components:
- "kafka"
- "inventory-db"
stage2:
components:
- "insights-inventory"
- "upload-service"
```
4. If you set `custom_deploy_logic` to True, read 'Custom Deploy Logic' below.
5. If you wish to define env vars for this service's templates, read 'Environment Files' below.
5. Add your service folder name to the base `_cfg.yml` in the `templates` directory. Remember that the `deploy_order` specifies the order in which each service set is deployed. So if your service set depends upon other services being deployed first, order it appropriately!
6. Run `ocdeployer list-sets` and you should see your new component listed as a deployable service set.
### Custom Deploy Logic
By default, no pre_deploy/post_deploy is run, and the deploy logic is taken care of by the `ocdeployer.deploy.deploy_components` method. So, unless you are doing something complicated and require additional "python scripting" to handle your (pre/post) deploy logic, you don't need to worry about custom logic (and it's quite rare that you'd want to re-write the main deploy logic itself)
But let's say you want to perform some tasks prior to deploying your components, or after deploying your components. Custom scripts can be useful for this.
You can set `custom_deploy_logic` in your service set's `_cfg.yml` to `true`. You then have two options for defining a custom deploy script:
* You can define a single `deploy.py` in the root `custom` directory of your project. This script will apply to all service sets as long as they have `custom_deploy_logic` set to `true`.
* You can create a script called `deploy.py` in the `custom` dir of your service set. This script will apply only to that service set.
%package -n python3-ocdeployer
Summary: A tool which wraps the OpenShift command line tools to enable repeatable automated deployment of OpenShift templates
Provides: python-ocdeployer
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-ocdeployer
## Template Configuration
The best way to explain how template configuration works is to describe the process for configuring a service set.
#### A guide to creating a service set
1. Create a new directory in the `templates` directory for your service set, e.g. "myservice"
2. Add your OpenShift YAML files for your services in this directory. The files should be OpenShift template files that contain all resources needed to get your service running (except for secrets, and image streams of external images, we'll talk about that shortly...). This would commonly be things like `buildConfig`, `deploymentConfig`, `service`, `route`, etc.
3. Create a '_cfg.yml' file in your directory. The contents of this config file are explained below:
```yaml
# (optional) requires
#
# Here you can list other service sets that need to be deployed before this one can.
# Deployment will fail when processing this file if we see the required service set has
# not yet been deployed in this run of ocdeployer.
requires:
- "myotherservice"
# (optional) secrets
#
# Lists which secrets apps in this service set rely on; they will be validated or imported at run time.
# A secret is only imported once per deploy run, so if other service sets rely on the same
# secret it won't be imported again.
secrets:
- "mysecret"
# You can also specify which service accounts a secret should be linked to
- name: "othersecret"
link: ["builder"]
# (optional) custom_deploy_logic
#
# Indicates that there is a pre_deploy/post_deploy/deploy method defined for this
# service set in the 'custom' folder that should be used
custom_deploy_logic: true
# (optional) post_deploy_timeout
#
# Indicates how long custom post_deploy logic should take before timeout (in seconds).
# A null value can be handled differently depending on the post deploy logic,
# but it is recommended that it means there is "no waiting" that will occur
post_deploy_timeout: 300
# (optional) images
# Lists the image streams these services require to be imported into the destination namespace.
#
# key = the name or name:tag for the image stream. If no tag is specified, 'latest' is used.
# value = the full image docker uri
#
# 'oc import-image <key> --from="<value>"' is run at deploy time.
#
# If it already exists, it will be re-imported (and therefore the image will be updated)
images:
- cp-kafka: "confluentinc/cp-kafka"
- cp-zookeeper: "confluentinc/cp-zookeeper"
- nginx-stable-openshift: "docker.io/mhuth/nginx-stable-openshift"
- python-36-centos7: "centos/python-36-centos7"
- postgresql-95-rhel7: "registry.access.redhat.com/rhscl/postgresql-95-rhel7"
# (required) deploy_order
#
# Lists the order in which components in this service set should be deployed.
deploy_order:
# A stage deploys a group of components in sequentially and then waits for them to reach 'active'
# in parallel. By default, at the end of each stage, we wait for:
# * DeploymentConfig's to be "active"
# * StatefulSet's to be "active"
# * BuildConfig's to succeed
#
# Setting 'wait' to false under the stage disables this behavior.
#
# Stages are processed after being sorted by name.
stage0:
wait: false
components:
- "zookeeper"
stage1:
# You can specify a wait timeout. By default, 300sec is used
timeout: 600
# 'components' lists the template files that should be deployed in this stage.
# Their config is applied in openshift in the same order they are listed.
components:
- "kafka"
- "inventory-db"
stage2:
components:
- "insights-inventory"
- "upload-service"
```
4. If you set `custom_deploy_logic` to True, read 'Custom Deploy Logic' below.
5. If you wish to define env vars for this service's templates, read 'Environment Files' below.
5. Add your service folder name to the base `_cfg.yml` in the `templates` directory. Remember that the `deploy_order` specifies the order in which each service set is deployed. So if your service set depends upon other services being deployed first, order it appropriately!
6. Run `ocdeployer list-sets` and you should see your new component listed as a deployable service set.
### Custom Deploy Logic
By default, no pre_deploy/post_deploy is run, and the deploy logic is taken care of by the `ocdeployer.deploy.deploy_components` method. So, unless you are doing something complicated and require additional "python scripting" to handle your (pre/post) deploy logic, you don't need to worry about custom logic (and it's quite rare that you'd want to re-write the main deploy logic itself)
But let's say you want to perform some tasks prior to deploying your components, or after deploying your components. Custom scripts can be useful for this.
You can set `custom_deploy_logic` in your service set's `_cfg.yml` to `true`. You then have two options for defining a custom deploy script:
* You can define a single `deploy.py` in the root `custom` directory of your project. This script will apply to all service sets as long as they have `custom_deploy_logic` set to `true`.
* You can create a script called `deploy.py` in the `custom` dir of your service set. This script will apply only to that service set.
%package help
Summary: Development documents and examples for ocdeployer
Provides: python3-ocdeployer-doc
%description help
## Template Configuration
The best way to explain how template configuration works is to describe the process for configuring a service set.
#### A guide to creating a service set
1. Create a new directory in the `templates` directory for your service set, e.g. "myservice"
2. Add your OpenShift YAML files for your services in this directory. The files should be OpenShift template files that contain all resources needed to get your service running (except for secrets, and image streams of external images, we'll talk about that shortly...). This would commonly be things like `buildConfig`, `deploymentConfig`, `service`, `route`, etc.
3. Create a '_cfg.yml' file in your directory. The contents of this config file are explained below:
```yaml
# (optional) requires
#
# Here you can list other service sets that need to be deployed before this one can.
# Deployment will fail when processing this file if we see the required service set has
# not yet been deployed in this run of ocdeployer.
requires:
- "myotherservice"
# (optional) secrets
#
# Lists which secrets apps in this service set rely on; they will be validated or imported at run time.
# A secret is only imported once per deploy run, so if other service sets rely on the same
# secret it won't be imported again.
secrets:
- "mysecret"
# You can also specify which service accounts a secret should be linked to
- name: "othersecret"
link: ["builder"]
# (optional) custom_deploy_logic
#
# Indicates that there is a pre_deploy/post_deploy/deploy method defined for this
# service set in the 'custom' folder that should be used
custom_deploy_logic: true
# (optional) post_deploy_timeout
#
# Indicates how long custom post_deploy logic should take before timeout (in seconds).
# A null value can be handled differently depending on the post deploy logic,
# but it is recommended that it means there is "no waiting" that will occur
post_deploy_timeout: 300
# (optional) images
# Lists the image streams these services require to be imported into the destination namespace.
#
# key = the name or name:tag for the image stream. If no tag is specified, 'latest' is used.
# value = the full image docker uri
#
# 'oc import-image <key> --from="<value>"' is run at deploy time.
#
# If it already exists, it will be re-imported (and therefore the image will be updated)
images:
- cp-kafka: "confluentinc/cp-kafka"
- cp-zookeeper: "confluentinc/cp-zookeeper"
- nginx-stable-openshift: "docker.io/mhuth/nginx-stable-openshift"
- python-36-centos7: "centos/python-36-centos7"
- postgresql-95-rhel7: "registry.access.redhat.com/rhscl/postgresql-95-rhel7"
# (required) deploy_order
#
# Lists the order in which components in this service set should be deployed.
deploy_order:
# A stage deploys a group of components in sequentially and then waits for them to reach 'active'
# in parallel. By default, at the end of each stage, we wait for:
# * DeploymentConfig's to be "active"
# * StatefulSet's to be "active"
# * BuildConfig's to succeed
#
# Setting 'wait' to false under the stage disables this behavior.
#
# Stages are processed after being sorted by name.
stage0:
wait: false
components:
- "zookeeper"
stage1:
# You can specify a wait timeout. By default, 300sec is used
timeout: 600
# 'components' lists the template files that should be deployed in this stage.
# Their config is applied in openshift in the same order they are listed.
components:
- "kafka"
- "inventory-db"
stage2:
components:
- "insights-inventory"
- "upload-service"
```
4. If you set `custom_deploy_logic` to True, read 'Custom Deploy Logic' below.
5. If you wish to define env vars for this service's templates, read 'Environment Files' below.
5. Add your service folder name to the base `_cfg.yml` in the `templates` directory. Remember that the `deploy_order` specifies the order in which each service set is deployed. So if your service set depends upon other services being deployed first, order it appropriately!
6. Run `ocdeployer list-sets` and you should see your new component listed as a deployable service set.
### Custom Deploy Logic
By default, no pre_deploy/post_deploy is run, and the deploy logic is taken care of by the `ocdeployer.deploy.deploy_components` method. So, unless you are doing something complicated and require additional "python scripting" to handle your (pre/post) deploy logic, you don't need to worry about custom logic (and it's quite rare that you'd want to re-write the main deploy logic itself)
But let's say you want to perform some tasks prior to deploying your components, or after deploying your components. Custom scripts can be useful for this.
You can set `custom_deploy_logic` in your service set's `_cfg.yml` to `true`. You then have two options for defining a custom deploy script:
* You can define a single `deploy.py` in the root `custom` directory of your project. This script will apply to all service sets as long as they have `custom_deploy_logic` set to `true`.
* You can create a script called `deploy.py` in the `custom` dir of your service set. This script will apply only to that service set.
%prep
%autosetup -n ocdeployer-5.7.11
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-ocdeployer -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 5.7.11-1
- Package Spec generated
|