bisos.capSpecs 0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,381 @@
1
+ Metadata-Version: 2.2
2
+ Name: bisos.capSpecs
3
+ Version: 0.1
4
+ Summary: bisos.facter: Adoption and adaptation of facter to Python and as Command-Services
5
+ Author: Mohsen Banan
6
+ Author-email: libre@mohsen.1.banan.byname.net
7
+ Maintainer: Mohsen Banan
8
+ Maintainer-email: libre@mohsen.1.banan.byname.net
9
+ License: AGPL
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
13
+ Classifier: Operating System :: POSIX
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Topic :: Software Development :: Libraries
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Dist: bisos
18
+ Requires-Dist: bisos.b
19
+ Requires-Dist: bisos.banna
20
+ Requires-Dist: bisos.binsprep
21
+ Requires-Dist: bisos.capability
22
+ Requires-Dist: bisos.common
23
+ Requires-Dist: bisos.csPlayer
24
+ Dynamic: author
25
+ Dynamic: author-email
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: license
29
+ Dynamic: maintainer
30
+ Dynamic: maintainer-email
31
+ Dynamic: requires-dist
32
+ Dynamic: summary
33
+
34
+ =================================================================================
35
+ bisos.facter: Adoption and adaptation of facter to Python and as Command-Services
36
+ =================================================================================
37
+
38
+ .. contents::
39
+ :depth: 3
40
+ ..
41
+
42
+ Overview
43
+ ========
44
+
45
+ *bisos.facter* provides access to facter information through python.
46
+
47
+ bisos.facter is a python package that uses the
48
+ `PyCS-Framework <https://github.com/bisos-pip/pycs>`__ for adoption and
49
+ adaptation of **facter** to python and PyCS-Framework. It is a
50
+ BISOS-Capability and a Standalone-BISOS-Package.
51
+
52
+ *bisos.facter* is based on the
53
+ `PyCS-Foundation <https://github.com/bisos-pip/b>`__ and can be used
54
+ both as a Command and as a Service (invoke/perform model of remote
55
+ operations using `RPyC <https://github.com/tomerfiliba-org/rpyc>`__).
56
+ Use of bisos.facter as a service, can facilitate central management of
57
+ multiple systems.
58
+
59
+ Package Documentation At Github
60
+ ===============================
61
+
62
+ The information below is a subset of the full of documentation for this
63
+ bisos-pip package. More complete documentation is available at:
64
+ https://github.com/bisos-pip/capability-cs
65
+
66
+ .. _table-of-contents:
67
+
68
+ Table of Contents TOC
69
+ =====================
70
+
71
+ - `Overview <#overview>`__
72
+ - `Package Documentation At
73
+ Github <#package-documentation-at-github>`__
74
+ - `About facter <#about-facter>`__
75
+ - `Part of BISOS — ByStar Internet Services Operating
76
+ System <#part-of-bisos-----bystar-internet-services-operating-system>`__
77
+ - `bisos.facter is a Command-Services PyCS
78
+ Facility <#bisosfacter-is-a-command-services-pycs-facility>`__
79
+ - `bisos.facter as a Standalone Piece of
80
+ BISOS <#bisosfacter-as-a-standalone-piece-of-bisos>`__
81
+ - `Installation <#installation>`__
82
+
83
+ - `Installation With pip <#installation-with-pip>`__
84
+ - `Installation With pipx <#installation-with-pipx>`__
85
+ - `Post Installation Basic
86
+ Testing <#post-installation-basic-testing>`__
87
+
88
+ - `Usage <#usage>`__
89
+
90
+ - `Local Usage (system
91
+ command-line) <#local-usage-system-command-line>`__
92
+ - `Remote Usage (as a service –
93
+ Performer+Invoker) <#remote-usage-as-a-service----performerinvoker>`__
94
+
95
+ - `Performer <#performer>`__
96
+ - `Invoker <#invoker>`__
97
+
98
+ - `Use by python script <#use-by-python-script>`__
99
+
100
+ - `bisos.facter as an Example of Command Services (PyCS) – Code
101
+ Walkthrough <#bisosfacter-as-an-example-of-command-services-pycs----code-walkthrough>`__
102
+
103
+ - `./bin/facter.cs (./bin/roPerf-facter.cs
104
+ ./bin/roInv-facter.cs) <#py3binfactercs--binroperf-factercs--binroinv-factercs>`__
105
+ - `./bisos/facter/facter.py (COMEEGA
106
+ Python) <#py3bisosfacterfacterpy-comeega-python>`__
107
+ - `./bisos/facter/facter\ conv.py (Conventional
108
+ Python) <#py3bisosfacterfacter_convpy-conventional-python>`__
109
+ - `./bisos/facter/facter\ csu.py <#py3bisosfacterfacter_csupy>`__
110
+ - `PyPi and Github Packaging <#pypi-and-github-packaging>`__
111
+
112
+ - `Documentation and Blee-Panels <#documentation-and-blee-panels>`__
113
+
114
+ - `bisos.facter Blee-Panels <#bisosfacter-blee-panels>`__
115
+
116
+ - `Support <#support>`__
117
+ - `Planned Improvements <#planned-improvements>`__
118
+
119
+ About facter
120
+ ============
121
+
122
+ `Facter <https://www.puppet.com/docs/puppet/7/facter.html>`__ is part of
123
+ `puppet <https://www.puppet.com/>`__, but it can also be used without
124
+ puppet. Facter gathers information about the system as sets of
125
+ hierarchical variables.
126
+
127
+ To install facter:
128
+
129
+ .. code:: bash
130
+
131
+ sudo apt-get install -y facter
132
+
133
+ Facter is a ruby package. This bisos.facter python package provides
134
+ access to facter information through python both locally and remotely.
135
+
136
+ Part of BISOS — ByStar Internet Services Operating System
137
+ =========================================================
138
+
139
+ | Layered on top of Debian, **BISOS**: (By\* Internet Services Operating
140
+ System) is a unified and universal framework for developing both
141
+ internet services and software-service continuums that use internet
142
+ services. See `Bootstrapping ByStar, BISOS and
143
+ Blee <https://github.com/bxGenesis/start>`__ for information about
144
+ getting started with BISOS.
145
+ | **BISOS** is a foundation for **The Libre-Halaal ByStar Digital
146
+ Ecosystem** which is described as a cure for losses of autonomy and
147
+ privacy in a book titled: `Nature of
148
+ Polyexistentials <https://github.com/bxplpc/120033>`__
149
+
150
+ *bisos.facter* is part of BISOS. Within BISOS, bisos.cmdb uses
151
+ bisos.facter for Configuration Management DataBase purposes.
152
+
153
+ bisos.facter is a Command-Services PyCS Facility
154
+ ================================================
155
+
156
+ bisos.facter can be used locally on command-line or remotely as a
157
+ service. bisos.facter is a PyCS multi-unit command-service. PyCS is a
158
+ framework that converges development of CLI and Services. PyCS is an
159
+ alternative to FastAPI, Typer and Click.
160
+
161
+ bisos.facter uses the PyCS-Framework to:
162
+
163
+ #. Provide access to facter facilities through native python.
164
+ #. Provide local access to facter facilities on CLI.
165
+ #. Provide remote access to facter facilities through remote invocation
166
+ of python Expectation Complete Operations using
167
+ `rpyc <https://github.com/tomerfiliba-org/rpyc>`__.
168
+ #. Provide remote access to facter facilities on CLI.
169
+
170
+ What is unique in the PyCS-Framework is that these four models are all a
171
+ single abstraction.
172
+
173
+ The core of PyCS-Framework is the *bisos.b* package (the
174
+ PyCS-Foundation). See https://github.com/bisos-pip/b for an overview.
175
+
176
+ bisos.facter as a Standalone Piece of BISOS
177
+ ===========================================
178
+
179
+ bisos.facter is a standalone piece of BISOS. It can be used as a
180
+ self-contained Python package separate from BISOS. Follow the
181
+ installation and usage instructions below for your own use.
182
+
183
+ Installation
184
+ ============
185
+
186
+ The sources for the bisos.facter pip package are maintained at:
187
+ https://github.com/bisos-pip/facter.
188
+
189
+ The bisos.facter pip package is available at PYPI as
190
+ https://pypi.org/project/bisos.facter
191
+
192
+ You can install bisos.facter with pip or pipx.
193
+
194
+ Installation With pip
195
+ ---------------------
196
+
197
+ If you need access to bisos.facter as a python module, you can install
198
+ it with pip:
199
+
200
+ .. code:: bash
201
+
202
+ pip install bisos.facter
203
+
204
+ Installation With pipx
205
+ ----------------------
206
+
207
+ If you only need access to bisos.facter on command-line, you can install
208
+ it with pipx:
209
+
210
+ .. code:: bash
211
+
212
+ pipx install bisos.facter
213
+
214
+ The following commands are made available:
215
+
216
+ - facter.cs
217
+ - roInv-facter.cs
218
+ - roPerf-facter.cs
219
+
220
+ These are all one file with 3 names. *roInv-facter.cs* and
221
+ *roPerf-facter.cs* are sym-links to *facter.cs*
222
+
223
+ Post Installation Basic Testing
224
+ -------------------------------
225
+
226
+ After the installation, run some basic tests:
227
+
228
+ .. code:: bash
229
+
230
+ facter.cs
231
+ facter networking.interfaces.lo.bindings
232
+
233
+ Usage
234
+ =====
235
+
236
+ Local Usage (system command-line)
237
+ ---------------------------------
238
+
239
+ ``facter.cs`` does the equivalent of facter.
240
+
241
+ .. code:: bash
242
+
243
+ bin/facter.cs
244
+
245
+ Remote Usage (as a service – Performer+Invoker)
246
+ -----------------------------------------------
247
+
248
+ You can also run:
249
+
250
+ Performer
251
+ ~~~~~~~~~
252
+
253
+ Invoke performer as:
254
+
255
+ .. code:: bash
256
+
257
+ bin/roPerf-facter.cs
258
+
259
+ Invoker
260
+ ~~~~~~~
261
+
262
+ .. code:: bash
263
+
264
+ bin/roInv-facter.cs
265
+
266
+ Use by python script
267
+ --------------------
268
+
269
+ bisos.facter Source Code is in written in COMEEGA (Collaborative
270
+ Org-Mode Enhanced Emacs Generalized Authorship) –
271
+ https://github.com/bx-blee/comeega.
272
+
273
+ The primary API for bisos.facter is
274
+ `file:./bisos/facter/facter_csu.py <./bisos/facter/facter_csu.py>`__. It
275
+ is self documented in COMEEGA.
276
+
277
+ bisos.facter as an Example of Command Services (PyCS) – Code Walkthrough
278
+ ========================================================================
279
+
280
+ An overview of the relevant files of the bisos.facter package is
281
+ provided below.
282
+
283
+ ./bin/facter.cs (./bin/roPerf-facter.cs ./bin/roInv-facter.cs)
284
+ --------------------------------------------------------------
285
+
286
+ The file `file:./bin/facter.cs <./bin/facter.cs>`__ is a CS-MU
287
+ (Command-Services Multi-Unit). It is fundamentally a boiler plate that
288
+ has the main framework org-mode Dynamic Block and which imports its
289
+ commands from bisos.facter.facter\ :sub:`csu` and
290
+ bisos.banna.bannaPortNu modules.
291
+
292
+ ./bisos/facter/facter.py (COMEEGA Python)
293
+ -----------------------------------------
294
+
295
+ The file `file:./bisos/facter/facter.py <./bisos/facter/facter.py>`__
296
+ includes functions that run a sub-process with "facter –json", obtain
297
+ the json result as a collection of namedtuples. This can then be
298
+ subjected to caching and then retrieved based on string representations
299
+ mapping to namedtuples.
300
+
301
+ ./bisos/facter/facter\ :sub:`conv`.py (Conventional Python)
302
+ -----------------------------------------------------------
303
+
304
+ The file
305
+ `file:./bisos/facter/facter_conv.py <./bisos/facter/facter_conv.py>`__
306
+ is same as `file:./bisos/facter/facter.py <./bisos/facter/facter.py>`__
307
+ without use of COMEEGA. Without Emacs, it is not easy to read the
308
+ COMEEGA files and some people prefer not to use or know about COMEEGA.
309
+ In such situations facter\ :sub:`conv`.py can be considered as
310
+ conventional sample code.
311
+
312
+ ./bisos/facter/facter\ :sub:`csu`.py
313
+ ------------------------------------
314
+
315
+ The file
316
+ `file:./bisos/facter/facter_csu.py <./bisos/facter/facter_csu.py>`__ is
317
+ a CS-U (Command-Services Unit). It includes definitions of commands and
318
+ their CLI params and args.
319
+
320
+ Implementation of commands in facter\ :sub:`csu`.py rely on facilities
321
+ provided in facter.py.
322
+
323
+ PyPi and Github Packaging
324
+ -------------------------
325
+
326
+ All bisos-pip repos in the https://github.com/bisos-pip github
327
+ organization follow the same structure. They all have
328
+ `file:./setup.py <./setup.py>`__ files that are driven by
329
+ `file:./pypiProc.sh <./pypiProc.sh>`__.
330
+
331
+ The `file:./setup.py <./setup.py>`__ file is a series of consistent
332
+ org-mode Dynamic Block that automatically determine the module name and
333
+ the installed and pypi revisions.
334
+
335
+ The `file:./pypiProc.sh <./pypiProc.sh>`__ uses setup.py and pushes to
336
+ pypi when desired and allows for isolated testing using pipx.
337
+
338
+ Documentation and Blee-Panels
339
+ =============================
340
+
341
+ bisos.facter is part of ByStar Digital Ecosystem http://www.by-star.net.
342
+
343
+ This module's primary documentation is in the form of Blee-Panels.
344
+ Additional information is also available in:
345
+ http://www.by-star.net/PLPC/180047
346
+
347
+ bisos.facter Blee-Panels
348
+ ------------------------
349
+
350
+ bisos.facter Blee-Panles are in ./panels directory. From within Blee and
351
+ BISOS these panles are accessible under the Blee "Panels" menu.
352
+
353
+ See
354
+ `file:./panels/_nodeBase_/fullUsagePanel-en.org <./panels/_nodeBase_/fullUsagePanel-en.org>`__
355
+ for a starting point.
356
+
357
+ Support
358
+ =======
359
+
360
+ | For support, criticism, comments and questions; please contact the
361
+ author/maintainer
362
+ | `Mohsen Banan <http://mohsen.1.banan.byname.net>`__ at:
363
+ http://mohsen.1.banan.byname.net/contact
364
+
365
+ Planned Improvements
366
+ ====================
367
+
368
+ One material use of bisos.facter is to facilitate developement of an
369
+ automated Configuration Management DataBase (CMDB) as a centralized
370
+ facility that organizes information about system, including the
371
+ relationships between hardware, software, and networks. On a per-system
372
+ base, bisos.facter can obtain much of that information and through PyCS
373
+ it can deliver that information remotely to centralized CMDBs. In this
374
+ context CMDBs generally function as invokers and we need to facilitate
375
+ ever present bisos.facter performers.
376
+
377
+ The CMDB invoker part is implemented as bisos.cmdb.
378
+
379
+ Each BISOS platform needs to run an instance under systemd. I have done
380
+ something similar to this for bisos.marmee. That piece need to be
381
+ absorbed.