2023-10-02T13:57:02,847 Created temporary directory: /tmp/pip-build-tracker-6mmfya3k 2023-10-02T13:57:02,848 Initialized build tracking at /tmp/pip-build-tracker-6mmfya3k 2023-10-02T13:57:02,848 Created build tracker: /tmp/pip-build-tracker-6mmfya3k 2023-10-02T13:57:02,849 Entered build tracker: /tmp/pip-build-tracker-6mmfya3k 2023-10-02T13:57:02,850 Created temporary directory: /tmp/pip-wheel-scghtw34 2023-10-02T13:57:02,853 Created temporary directory: /tmp/pip-ephem-wheel-cache-oez17ppf 2023-10-02T13:57:02,874 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2023-10-02T13:57:02,878 2 location(s) to search for versions of body-scan: 2023-10-02T13:57:02,878 * https://pypi.org/simple/body-scan/ 2023-10-02T13:57:02,878 * https://www.piwheels.org/simple/body-scan/ 2023-10-02T13:57:02,879 Fetching project page and analyzing links: https://pypi.org/simple/body-scan/ 2023-10-02T13:57:02,879 Getting page https://pypi.org/simple/body-scan/ 2023-10-02T13:57:02,881 Found index url https://pypi.org/simple/ 2023-10-02T13:57:03,022 Fetched page https://pypi.org/simple/body-scan/ as application/vnd.pypi.simple.v1+json 2023-10-02T13:57:03,026 Found link https://files.pythonhosted.org/packages/77/dc/4976c62af72e792f4f7db06b16e1e198f94fb784b77eba4ff5971b3353a8/BODY_SCAN-0.0.4.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.4 2023-10-02T13:57:03,027 Found link https://files.pythonhosted.org/packages/01/8c/c52ee48475ed68b45b98392b3bfd2e663ec0145f32885f4d3c33e2bb8bca/BODY_SCAN-0.0.5.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.5 2023-10-02T13:57:03,028 Found link https://files.pythonhosted.org/packages/6c/11/bfba6fac13e340bd3c5fdc1e1fb983f9620253b819098776d5233a1a5d92/BODY_SCAN-0.0.6.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.6 2023-10-02T13:57:03,028 Found link https://files.pythonhosted.org/packages/7e/d4/a65b4e09fb2e6fcb68a92ae4e46f0d31053ff97db90da1c919d5dd901597/BODY_SCAN-0.0.7.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.7 2023-10-02T13:57:03,029 Found link https://files.pythonhosted.org/packages/01/99/28ef7ebbedaa67d7466130d182bd36f23e6bdbd91329bf3d5b0bc2902ff2/BODY_SCAN-0.0.8.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.8 2023-10-02T13:57:03,030 Found link https://files.pythonhosted.org/packages/0c/06/f7f5639e4d08db4bddc61e23a7d515fd7fd4155c543e29c93c4928b01ddf/BODY_SCAN-0.0.9.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.9 2023-10-02T13:57:03,030 Found link https://files.pythonhosted.org/packages/e1/0b/9761b575e8dc7f822e7ad9a61197b0f837c7ba3c328eb458e0047bc16fd2/BODY_SCAN-0.0.10.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.10 2023-10-02T13:57:03,031 Found link https://files.pythonhosted.org/packages/d2/39/f97e5e82655f5acba2ae8181371e3aeee766f136902395006f467f75c83e/BODY_SCAN-0.0.11.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.11 2023-10-02T13:57:03,032 Found link https://files.pythonhosted.org/packages/e1/2b/d62073bb40f891cfc72057c5a70b3b0c6f28fb75160da25f3debba05d52c/BODY_SCAN-0.0.12.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.12 2023-10-02T13:57:03,033 Found link https://files.pythonhosted.org/packages/e6/dc/318f507bf42aee42ecbfeb89aa792f0d6aaa8f4113d0d6369c4128a868b2/BODY_SCAN-0.0.13.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.13 2023-10-02T13:57:03,033 Found link https://files.pythonhosted.org/packages/39/6a/9c41261dc1211e0799e7579d6bb3c1e872f952f8333cf7d29fcaa3522406/BODY_SCAN-0.0.14.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.14 2023-10-02T13:57:03,034 Found link https://files.pythonhosted.org/packages/5b/ae/3fa5ba9379e44d9a5cab2474ce36172334f49c1b8a6e8024ec97e3978e2d/BODY_SCAN-0.0.15.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.15 2023-10-02T13:57:03,035 Found link https://files.pythonhosted.org/packages/4a/7b/2bf405077a418312446509ddabd2c8d002e8af140f7793ccddf28678961d/BODY_SCAN-0.0.16.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.16 2023-10-02T13:57:03,035 Found link https://files.pythonhosted.org/packages/68/f2/983e8acc6c0c023262813b15fcfe0e009ece07dbf410330f91efd0a8b8c4/BODY_SCAN-0.0.17.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.17 2023-10-02T13:57:03,036 Found link https://files.pythonhosted.org/packages/fe/0c/4536463d789cd0af663160d6067ee38f781a94d3f32d0813f768043ad5d9/BODY_SCAN-0.0.18.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.18 2023-10-02T13:57:03,037 Found link https://files.pythonhosted.org/packages/06/ef/d681b5d6e3fac73ea73a92b7405dc0753be266f6277288197a26522acbd8/BODY_SCAN-0.0.19.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.19 2023-10-02T13:57:03,038 Found link https://files.pythonhosted.org/packages/bc/a4/64783f579d22ef1abc746160acddc0e45647fac921396c25e74ddf55bc70/BODY_SCAN-0.0.20.tar.gz (from https://pypi.org/simple/body-scan/), version: 0.0.20 2023-10-02T13:57:03,038 Fetching project page and analyzing links: https://www.piwheels.org/simple/body-scan/ 2023-10-02T13:57:03,039 Getting page https://www.piwheels.org/simple/body-scan/ 2023-10-02T13:57:03,040 Found index url https://www.piwheels.org/simple/ 2023-10-02T13:57:03,201 Fetched page https://www.piwheels.org/simple/body-scan/ as text/html 2023-10-02T13:57:03,204 Skipping link: No binaries permitted for body-scan: https://www.piwheels.org/simple/body-scan/BODY_SCAN-0.0.12-py3-none-any.whl#sha256=c47b6c6185220002a9a4516a3318b3adb398aeaef695d7438448f074638d2d5c (from https://www.piwheels.org/simple/body-scan/) 2023-10-02T13:57:03,205 Skipping link: No binaries permitted for body-scan: https://www.piwheels.org/simple/body-scan/BODY_SCAN-0.0.11-py3-none-any.whl#sha256=c44320cba95859a174b73fcfc745fc84303ee6538c7eb22127f2eba8b90c3172 (from https://www.piwheels.org/simple/body-scan/) 2023-10-02T13:57:03,205 Skipping link: No binaries permitted for body-scan: https://www.piwheels.org/simple/body-scan/BODY_SCAN-0.0.10-py3-none-any.whl#sha256=62a48f3d91ec5fb86f3f4ecc66b13e1c32db3ff1d13a0bb9937959d63fe49508 (from https://www.piwheels.org/simple/body-scan/) 2023-10-02T13:57:03,206 Skipping link: No binaries permitted for body-scan: https://www.piwheels.org/simple/body-scan/BODY_SCAN-0.0.9-py3-none-any.whl#sha256=f3f38b657baa7d42a5723d1e6662fab7119e81a91c3234a1d68309d325808d62 (from https://www.piwheels.org/simple/body-scan/) 2023-10-02T13:57:03,206 Skipping link: No binaries permitted for body-scan: https://www.piwheels.org/simple/body-scan/BODY_SCAN-0.0.8-py3-none-any.whl#sha256=b9f54ed05f7df8ac520a5344098d064a328cc616bae8a220989deabf6a7901e1 (from https://www.piwheels.org/simple/body-scan/) 2023-10-02T13:57:03,207 Skipping link: No binaries permitted for body-scan: https://www.piwheels.org/simple/body-scan/BODY_SCAN-0.0.7-py3-none-any.whl#sha256=5a2e6708cc66b7576d6772cc72a8dec53b05a5cbf2f46880f3f80e405a4ca0bb (from https://www.piwheels.org/simple/body-scan/) 2023-10-02T13:57:03,208 Skipping link: No binaries permitted for body-scan: https://www.piwheels.org/simple/body-scan/BODY_SCAN-0.0.6-py3-none-any.whl#sha256=90f3d906b9a019b4d9dd1ae5f4c46bb24243e3ab6402d6a5ce2b2dbea1491f02 (from https://www.piwheels.org/simple/body-scan/) 2023-10-02T13:57:03,208 Skipping link: No binaries permitted for body-scan: https://www.piwheels.org/simple/body-scan/BODY_SCAN-0.0.5-py3-none-any.whl#sha256=77f25f9133ce1bff3a3cff52eced709f5d9b0069bc81a3552e05263ff5bd9390 (from https://www.piwheels.org/simple/body-scan/) 2023-10-02T13:57:03,209 Skipping link: No binaries permitted for body-scan: https://www.piwheels.org/simple/body-scan/BODY_SCAN-0.0.4-py3-none-any.whl#sha256=ee8f6804722d4cbe2bd07d4ef1011044bf7a3bdcfdb81607ca039b775978e9e9 (from https://www.piwheels.org/simple/body-scan/) 2023-10-02T13:57:03,210 Skipping link: not a file: https://www.piwheels.org/simple/body-scan/ 2023-10-02T13:57:03,210 Skipping link: not a file: https://pypi.org/simple/body-scan/ 2023-10-02T13:57:03,232 Given no hashes to check 1 links for project 'body-scan': discarding no candidates 2023-10-02T13:57:03,251 Collecting body-scan==0.0.13 2023-10-02T13:57:03,254 Created temporary directory: /tmp/pip-unpack-l7q6oy90 2023-10-02T13:57:03,468 Downloading BODY_SCAN-0.0.13.tar.gz (7.0 kB) 2023-10-02T13:57:03,512 Added body-scan==0.0.13 from https://files.pythonhosted.org/packages/e6/dc/318f507bf42aee42ecbfeb89aa792f0d6aaa8f4113d0d6369c4128a868b2/BODY_SCAN-0.0.13.tar.gz to build tracker '/tmp/pip-build-tracker-6mmfya3k' 2023-10-02T13:57:03,514 Running setup.py (path:/tmp/pip-wheel-scghtw34/body-scan_78fce7edae1b4a49a1e66fcc0a663f4b/setup.py) egg_info for package body-scan 2023-10-02T13:57:03,515 Created temporary directory: /tmp/pip-pip-egg-info-8vps2f3b 2023-10-02T13:57:03,515 Preparing metadata (setup.py): started 2023-10-02T13:57:03,516 Running command python setup.py egg_info 2023-10-02T13:57:04,548 # BODY SCAN 2023-10-02T13:57:04,549 ## EXAMPLE OUTPUT: 2023-10-02T13:57:04,549 ```JSON 2023-10-02T13:57:04,550 { 2023-10-02T13:57:04,550 "PATHS": [ 2023-10-02T13:57:04,551 { 2023-10-02T13:57:04,551 "PATH": "PATH_1_HEALTH.py", 2023-10-02T13:57:04,551 "STATS": { 2023-10-02T13:57:04,552 "PASSES": 2, 2023-10-02T13:57:04,552 "ALARMS": 1 2023-10-02T13:57:04,553 }, 2023-10-02T13:57:04,553 "CHECKS": [ 2023-10-02T13:57:04,554 { 2023-10-02T13:57:04,554 "CHECK": "CHECK 1", 2023-10-02T13:57:04,555 "PASSED": true, 2023-10-02T13:57:04,555 "ELAPSED": [ 2023-10-02T13:57:04,556 5.320599666447379e-05, 2023-10-02T13:57:04,556 "SECONDS" 2023-10-02T13:57:04,557 ] 2023-10-02T13:57:04,557 }, 2023-10-02T13:57:04,558 { 2023-10-02T13:57:04,558 "CHECK": "CHECK 2", 2023-10-02T13:57:04,559 "PASSED": true, 2023-10-02T13:57:04,559 "ELAPSED": [ 2023-10-02T13:57:04,560 1.0949999705189839e-05, 2023-10-02T13:57:04,560 "SECONDS" 2023-10-02T13:57:04,561 ] 2023-10-02T13:57:04,561 }, 2023-10-02T13:57:04,562 { 2023-10-02T13:57:04,562 "CHECK": "CHECK 3", 2023-10-02T13:57:04,563 "PASSED": false, 2023-10-02T13:57:04,563 "EXCEPTION": "Exception('NOT 100%')", 2023-10-02T13:57:04,564 "EXCEPTION TRACE": [ 2023-10-02T13:57:04,565 "Traceback (most recent call last):", 2023-10-02T13:57:04,565 " File \"/REPTILIAN_CLIMATES/MODULES/BODY_SCAN/src/SCAN_PROC/KEG/SCAN.py\", line 69, in SCAN", 2023-10-02T13:57:04,566 " CHECKS [ CHECK ] ()", 2023-10-02T13:57:04,566 " File \"\", line 24, in CHECK_3", 2023-10-02T13:57:04,567 "Exception: NOT 100%" 2023-10-02T13:57:04,567 ] 2023-10-02T13:57:04,568 } 2023-10-02T13:57:04,569 ] 2023-10-02T13:57:04,569 }, 2023-10-02T13:57:04,570 { 2023-10-02T13:57:04,570 "PATH": "PATH_2_HEALTH.py", 2023-10-02T13:57:04,571 "EMPTY": true 2023-10-02T13:57:04,571 } 2023-10-02T13:57:04,572 ], 2023-10-02T13:57:04,572 "STATS": { 2023-10-02T13:57:04,573 "EMPTY": 1, 2023-10-02T13:57:04,573 "CHECKS": { 2023-10-02T13:57:04,574 "PASSES": 2, 2023-10-02T13:57:04,574 "ALARMS": 1 2023-10-02T13:57:04,575 } 2023-10-02T13:57:04,576 } 2023-10-02T13:57:04,576 } 2023-10-02T13:57:04,577 ``` 2023-10-02T13:57:04,578 ## HOW TO WRITE CHECKS: 2023-10-02T13:57:04,579 The "CHECKS" dictionary is retrieved with the python "exec" 2023-10-02T13:57:04,580 and then each "CHECK" in "CHECKS" is run. 2023-10-02T13:57:04,581 These checks correspond to the example output shown above. 2023-10-02T13:57:04,582 ``` 2023-10-02T13:57:04,582 PATH_1_HEALTH.py 2023-10-02T13:57:04,583 ``` 2023-10-02T13:57:04,584 ``` 2023-10-02T13:57:04,584 def CHECK_1 (): 2023-10-02T13:57:04,585 print ("CHECK 1") 2023-10-02T13:57:04,585 def CHECK_2 (): 2023-10-02T13:57:04,586 print ("CHECK 2") 2023-10-02T13:57:04,587 def CHECK_3 (): 2023-10-02T13:57:04,587 raise Exception ("NOT 100%") 2023-10-02T13:57:04,588 CHECKS = { 2023-10-02T13:57:04,588 "CHECK 1": CHECK_1, 2023-10-02T13:57:04,589 "CHECK 2": CHECK_2, 2023-10-02T13:57:04,589 "CHECK 3": CHECK_3 2023-10-02T13:57:04,590 } 2023-10-02T13:57:04,590 ``` 2023-10-02T13:57:04,590 ``` 2023-10-02T13:57:04,591 PATH_2_HEALTH.py 2023-10-02T13:57:04,591 ``` 2023-10-02T13:57:04,592 ``` 2023-10-02T13:57:04,592 # 2023-10-02T13:57:04,592 # There isn't a "CHECKS" dictionary present, 2023-10-02T13:57:04,593 # so the scanner reports: 2023-10-02T13:57:04,593 # 2023-10-02T13:57:04,594 # "EMPTY": true 2023-10-02T13:57:04,594 # 2023-10-02T13:57:04,595 ``` 2023-10-02T13:57:04,595 ## HOW TO START THE BODY SCANNER 2023-10-02T13:57:04,596 ### REQUIRED 2023-10-02T13:57:04,597 ``` 2023-10-02T13:57:04,597 "GLOB" is all the files that are sent to the scanner. 2023-10-02T13:57:04,598 ``` 2023-10-02T13:57:04,599 ### OPTIONAL 2023-10-02T13:57:04,599 ``` 2023-10-02T13:57:04,599 "MODULE_PATHS" is folders that are added to "sys.path" 2023-10-02T13:57:04,600 "RELATIVE_PATH" is the folders to remove from the paths in the output 2023-10-02T13:57:04,600 ``` 2023-10-02T13:57:04,601 ### NOTES 2023-10-02T13:57:04,602 ``` 2023-10-02T13:57:04,602 Currently all the checks aren't run in parallel, 2023-10-02T13:57:04,602 but sequential order of paths found in glob is not guaranteed. 2023-10-02T13:57:04,603 ``` 2023-10-02T13:57:04,603 ``` 2023-10-02T13:57:04,604 Each check suite found by the glob is encapsulated in 2023-10-02T13:57:04,604 a process with a flask API, that is opened on the first available port found. 2023-10-02T13:57:04,605 ``` 2023-10-02T13:57:04,606 ```python3 2023-10-02T13:57:04,607 import BODY_SCAN 2023-10-02T13:57:04,608 import pathlib 2023-10-02T13:57:04,608 THIS_FOLDER = pathlib.Path (__file__).parent.resolve () 2023-10-02T13:57:04,610 from os.path import dirname, join, normpath 2023-10-02T13:57:04,610 SEARCH = normpath (join (THIS_FOLDER, "MODULE")) 2023-10-02T13:57:04,611 # 2023-10-02T13:57:04,612 # These are added to the sys.path before scan is started. 2023-10-02T13:57:04,612 # 2023-10-02T13:57:04,613 MODULE_PATH = [ 2023-10-02T13:57:04,614 normpath (join (SEARCH, "MODULES")) 2023-10-02T13:57:04,614 ] 2023-10-02T13:57:04,615 SCAN = BODY_SCAN.START ( 2023-10-02T13:57:04,616 # REQUIRED 2023-10-02T13:57:04,617 GLOB = SEARCH + '/**/*HEALTH.py', 2023-10-02T13:57:04,618 # OPTIONAL 2023-10-02T13:57:04,618 MODULE_PATHS = MODULE_PATH, 2023-10-02T13:57:04,619 # OPTIONAL 2023-10-02T13:57:04,620 RELATIVE_PATH = SEARCH 2023-10-02T13:57:04,620 ) 2023-10-02T13:57:04,621 ``` 2023-10-02T13:57:04,623 running egg_info 2023-10-02T13:57:04,624 creating /tmp/pip-pip-egg-info-8vps2f3b/BODY_SCAN.egg-info 2023-10-02T13:57:04,624 writing /tmp/pip-pip-egg-info-8vps2f3b/BODY_SCAN.egg-info/PKG-INFO 2023-10-02T13:57:04,625 writing dependency_links to /tmp/pip-pip-egg-info-8vps2f3b/BODY_SCAN.egg-info/dependency_links.txt 2023-10-02T13:57:04,625 writing requirements to /tmp/pip-pip-egg-info-8vps2f3b/BODY_SCAN.egg-info/requires.txt 2023-10-02T13:57:04,626 writing top-level names to /tmp/pip-pip-egg-info-8vps2f3b/BODY_SCAN.egg-info/top_level.txt 2023-10-02T13:57:04,626 writing manifest file '/tmp/pip-pip-egg-info-8vps2f3b/BODY_SCAN.egg-info/SOURCES.txt' 2023-10-02T13:57:04,680 reading manifest file '/tmp/pip-pip-egg-info-8vps2f3b/BODY_SCAN.egg-info/SOURCES.txt' 2023-10-02T13:57:04,682 adding license file 'LICENSE' 2023-10-02T13:57:04,684 writing manifest file '/tmp/pip-pip-egg-info-8vps2f3b/BODY_SCAN.egg-info/SOURCES.txt' 2023-10-02T13:57:04,795 Preparing metadata (setup.py): finished with status 'done' 2023-10-02T13:57:04,799 Source in /tmp/pip-wheel-scghtw34/body-scan_78fce7edae1b4a49a1e66fcc0a663f4b has version 0.0.13, which satisfies requirement body-scan==0.0.13 from https://files.pythonhosted.org/packages/e6/dc/318f507bf42aee42ecbfeb89aa792f0d6aaa8f4113d0d6369c4128a868b2/BODY_SCAN-0.0.13.tar.gz 2023-10-02T13:57:04,801 Removed body-scan==0.0.13 from https://files.pythonhosted.org/packages/e6/dc/318f507bf42aee42ecbfeb89aa792f0d6aaa8f4113d0d6369c4128a868b2/BODY_SCAN-0.0.13.tar.gz from build tracker '/tmp/pip-build-tracker-6mmfya3k' 2023-10-02T13:57:04,805 Created temporary directory: /tmp/pip-unpack-3nc9ocsh 2023-10-02T13:57:04,806 Created temporary directory: /tmp/pip-unpack-c_uqz8v6 2023-10-02T13:57:04,812 Building wheels for collected packages: body-scan 2023-10-02T13:57:04,816 Created temporary directory: /tmp/pip-wheel-gj8uoskh 2023-10-02T13:57:04,816 Building wheel for body-scan (setup.py): started 2023-10-02T13:57:04,817 Destination directory: /tmp/pip-wheel-gj8uoskh 2023-10-02T13:57:04,818 Running command python setup.py bdist_wheel 2023-10-02T13:57:05,223 # BODY SCAN 2023-10-02T13:57:05,224 ## EXAMPLE OUTPUT: 2023-10-02T13:57:05,224 ```JSON 2023-10-02T13:57:05,225 { 2023-10-02T13:57:05,225 "PATHS": [ 2023-10-02T13:57:05,226 { 2023-10-02T13:57:05,226 "PATH": "PATH_1_HEALTH.py", 2023-10-02T13:57:05,226 "STATS": { 2023-10-02T13:57:05,227 "PASSES": 2, 2023-10-02T13:57:05,228 "ALARMS": 1 2023-10-02T13:57:05,228 }, 2023-10-02T13:57:05,228 "CHECKS": [ 2023-10-02T13:57:05,229 { 2023-10-02T13:57:05,229 "CHECK": "CHECK 1", 2023-10-02T13:57:05,230 "PASSED": true, 2023-10-02T13:57:05,230 "ELAPSED": [ 2023-10-02T13:57:05,231 5.320599666447379e-05, 2023-10-02T13:57:05,231 "SECONDS" 2023-10-02T13:57:05,232 ] 2023-10-02T13:57:05,232 }, 2023-10-02T13:57:05,233 { 2023-10-02T13:57:05,234 "CHECK": "CHECK 2", 2023-10-02T13:57:05,234 "PASSED": true, 2023-10-02T13:57:05,235 "ELAPSED": [ 2023-10-02T13:57:05,235 1.0949999705189839e-05, 2023-10-02T13:57:05,236 "SECONDS" 2023-10-02T13:57:05,236 ] 2023-10-02T13:57:05,237 }, 2023-10-02T13:57:05,238 { 2023-10-02T13:57:05,238 "CHECK": "CHECK 3", 2023-10-02T13:57:05,239 "PASSED": false, 2023-10-02T13:57:05,239 "EXCEPTION": "Exception('NOT 100%')", 2023-10-02T13:57:05,240 "EXCEPTION TRACE": [ 2023-10-02T13:57:05,240 "Traceback (most recent call last):", 2023-10-02T13:57:05,241 " File \"/REPTILIAN_CLIMATES/MODULES/BODY_SCAN/src/SCAN_PROC/KEG/SCAN.py\", line 69, in SCAN", 2023-10-02T13:57:05,241 " CHECKS [ CHECK ] ()", 2023-10-02T13:57:05,242 " File \"\", line 24, in CHECK_3", 2023-10-02T13:57:05,242 "Exception: NOT 100%" 2023-10-02T13:57:05,243 ] 2023-10-02T13:57:05,243 } 2023-10-02T13:57:05,244 ] 2023-10-02T13:57:05,244 }, 2023-10-02T13:57:05,245 { 2023-10-02T13:57:05,245 "PATH": "PATH_2_HEALTH.py", 2023-10-02T13:57:05,246 "EMPTY": true 2023-10-02T13:57:05,247 } 2023-10-02T13:57:05,247 ], 2023-10-02T13:57:05,248 "STATS": { 2023-10-02T13:57:05,249 "EMPTY": 1, 2023-10-02T13:57:05,249 "CHECKS": { 2023-10-02T13:57:05,250 "PASSES": 2, 2023-10-02T13:57:05,250 "ALARMS": 1 2023-10-02T13:57:05,251 } 2023-10-02T13:57:05,251 } 2023-10-02T13:57:05,252 } 2023-10-02T13:57:05,253 ``` 2023-10-02T13:57:05,254 ## HOW TO WRITE CHECKS: 2023-10-02T13:57:05,255 The "CHECKS" dictionary is retrieved with the python "exec" 2023-10-02T13:57:05,255 and then each "CHECK" in "CHECKS" is run. 2023-10-02T13:57:05,256 These checks correspond to the example output shown above. 2023-10-02T13:57:05,257 ``` 2023-10-02T13:57:05,257 PATH_1_HEALTH.py 2023-10-02T13:57:05,257 ``` 2023-10-02T13:57:05,258 ``` 2023-10-02T13:57:05,258 def CHECK_1 (): 2023-10-02T13:57:05,259 print ("CHECK 1") 2023-10-02T13:57:05,259 def CHECK_2 (): 2023-10-02T13:57:05,260 print ("CHECK 2") 2023-10-02T13:57:05,261 def CHECK_3 (): 2023-10-02T13:57:05,261 raise Exception ("NOT 100%") 2023-10-02T13:57:05,262 CHECKS = { 2023-10-02T13:57:05,262 "CHECK 1": CHECK_1, 2023-10-02T13:57:05,263 "CHECK 2": CHECK_2, 2023-10-02T13:57:05,263 "CHECK 3": CHECK_3 2023-10-02T13:57:05,264 } 2023-10-02T13:57:05,264 ``` 2023-10-02T13:57:05,265 ``` 2023-10-02T13:57:05,265 PATH_2_HEALTH.py 2023-10-02T13:57:05,265 ``` 2023-10-02T13:57:05,266 ``` 2023-10-02T13:57:05,266 # 2023-10-02T13:57:05,267 # There isn't a "CHECKS" dictionary present, 2023-10-02T13:57:05,267 # so the scanner reports: 2023-10-02T13:57:05,268 # 2023-10-02T13:57:05,268 # "EMPTY": true 2023-10-02T13:57:05,269 # 2023-10-02T13:57:05,269 ``` 2023-10-02T13:57:05,270 ## HOW TO START THE BODY SCANNER 2023-10-02T13:57:05,271 ### REQUIRED 2023-10-02T13:57:05,271 ``` 2023-10-02T13:57:05,272 "GLOB" is all the files that are sent to the scanner. 2023-10-02T13:57:05,272 ``` 2023-10-02T13:57:05,273 ### OPTIONAL 2023-10-02T13:57:05,273 ``` 2023-10-02T13:57:05,274 "MODULE_PATHS" is folders that are added to "sys.path" 2023-10-02T13:57:05,274 "RELATIVE_PATH" is the folders to remove from the paths in the output 2023-10-02T13:57:05,275 ``` 2023-10-02T13:57:05,276 ### NOTES 2023-10-02T13:57:05,277 ``` 2023-10-02T13:57:05,277 Currently all the checks aren't run in parallel, 2023-10-02T13:57:05,278 but sequential order of paths found in glob is not guaranteed. 2023-10-02T13:57:05,278 ``` 2023-10-02T13:57:05,279 ``` 2023-10-02T13:57:05,280 Each check suite found by the glob is encapsulated in 2023-10-02T13:57:05,280 a process with a flask API, that is opened on the first available port found. 2023-10-02T13:57:05,281 ``` 2023-10-02T13:57:05,282 ```python3 2023-10-02T13:57:05,283 import BODY_SCAN 2023-10-02T13:57:05,284 import pathlib 2023-10-02T13:57:05,284 THIS_FOLDER = pathlib.Path (__file__).parent.resolve () 2023-10-02T13:57:05,285 from os.path import dirname, join, normpath 2023-10-02T13:57:05,286 SEARCH = normpath (join (THIS_FOLDER, "MODULE")) 2023-10-02T13:57:05,287 # 2023-10-02T13:57:05,288 # These are added to the sys.path before scan is started. 2023-10-02T13:57:05,288 # 2023-10-02T13:57:05,289 MODULE_PATH = [ 2023-10-02T13:57:05,290 normpath (join (SEARCH, "MODULES")) 2023-10-02T13:57:05,290 ] 2023-10-02T13:57:05,291 SCAN = BODY_SCAN.START ( 2023-10-02T13:57:05,292 # REQUIRED 2023-10-02T13:57:05,292 GLOB = SEARCH + '/**/*HEALTH.py', 2023-10-02T13:57:05,293 # OPTIONAL 2023-10-02T13:57:05,294 MODULE_PATHS = MODULE_PATH, 2023-10-02T13:57:05,295 # OPTIONAL 2023-10-02T13:57:05,295 RELATIVE_PATH = SEARCH 2023-10-02T13:57:05,296 ) 2023-10-02T13:57:05,297 ``` 2023-10-02T13:57:05,845 running bdist_wheel 2023-10-02T13:57:05,979 running build 2023-10-02T13:57:05,979 running build_py 2023-10-02T13:57:06,007 creating build 2023-10-02T13:57:06,008 creating build/lib 2023-10-02T13:57:06,009 creating build/lib/BODY_SCAN 2023-10-02T13:57:06,010 copying src/START_MULTIPLE_PROCESSES.py -> build/lib/BODY_SCAN 2023-10-02T13:57:06,012 copying src/__init__.py -> build/lib/BODY_SCAN 2023-10-02T13:57:06,014 creating build/lib/BODY_SCAN/AGGREGATOR 2023-10-02T13:57:06,015 copying src/AGGREGATOR/START.py -> build/lib/BODY_SCAN/AGGREGATOR 2023-10-02T13:57:06,017 creating build/lib/BODY_SCAN/AGGREGATE 2023-10-02T13:57:06,018 copying src/AGGREGATE/__init__.py -> build/lib/BODY_SCAN/AGGREGATE 2023-10-02T13:57:06,021 creating build/lib/BODY_SCAN/SCAN_PROC 2023-10-02T13:57:06,022 copying src/SCAN_PROC/START.py -> build/lib/BODY_SCAN/SCAN_PROC 2023-10-02T13:57:06,024 creating build/lib/BODY_SCAN/FUNCTIONS 2023-10-02T13:57:06,025 copying src/FUNCTIONS/START_A_SCAN.py -> build/lib/BODY_SCAN/FUNCTIONS 2023-10-02T13:57:06,026 copying src/FUNCTIONS/CHECK_STATUS_LOCATION.py -> build/lib/BODY_SCAN/FUNCTIONS 2023-10-02T13:57:06,028 copying src/FUNCTIONS/START_THE_CORE_KEG.py -> build/lib/BODY_SCAN/FUNCTIONS 2023-10-02T13:57:06,030 creating build/lib/BODY_SCAN/AGGREGATOR/KEG 2023-10-02T13:57:06,031 copying src/AGGREGATOR/KEG/__init__.py -> build/lib/BODY_SCAN/AGGREGATOR/KEG 2023-10-02T13:57:06,033 creating build/lib/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:57:06,034 copying src/SCAN_PROC/KEG/__init__.py -> build/lib/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:57:06,035 copying src/SCAN_PROC/KEG/SCAN.py -> build/lib/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:57:06,068 /usr/local/lib/python3.11/dist-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. 2023-10-02T13:57:06,068 !! 2023-10-02T13:57:06,069 ******************************************************************************** 2023-10-02T13:57:06,070 Please avoid running ``setup.py`` directly. 2023-10-02T13:57:06,070 Instead, use pypa/build, pypa/installer or other 2023-10-02T13:57:06,071 standards-based tools. 2023-10-02T13:57:06,072 See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. 2023-10-02T13:57:06,072 ******************************************************************************** 2023-10-02T13:57:06,073 !! 2023-10-02T13:57:06,074 self.initialize_options() 2023-10-02T13:57:06,094 installing to build/bdist.linux-armv7l/wheel 2023-10-02T13:57:06,094 running install 2023-10-02T13:57:06,118 running install_lib 2023-10-02T13:57:06,144 creating build/bdist.linux-armv7l 2023-10-02T13:57:06,144 creating build/bdist.linux-armv7l/wheel 2023-10-02T13:57:06,146 creating build/bdist.linux-armv7l/wheel/BODY_SCAN 2023-10-02T13:57:06,147 copying build/lib/BODY_SCAN/START_MULTIPLE_PROCESSES.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN 2023-10-02T13:57:06,149 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATOR 2023-10-02T13:57:06,150 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATOR/KEG 2023-10-02T13:57:06,151 copying build/lib/BODY_SCAN/AGGREGATOR/KEG/__init__.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATOR/KEG 2023-10-02T13:57:06,153 copying build/lib/BODY_SCAN/AGGREGATOR/START.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATOR 2023-10-02T13:57:06,155 copying build/lib/BODY_SCAN/__init__.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN 2023-10-02T13:57:06,158 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATE 2023-10-02T13:57:06,158 copying build/lib/BODY_SCAN/AGGREGATE/__init__.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATE 2023-10-02T13:57:06,161 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/SCAN_PROC 2023-10-02T13:57:06,162 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:57:06,163 copying build/lib/BODY_SCAN/SCAN_PROC/KEG/__init__.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:57:06,165 copying build/lib/BODY_SCAN/SCAN_PROC/KEG/SCAN.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:57:06,167 copying build/lib/BODY_SCAN/SCAN_PROC/START.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/SCAN_PROC 2023-10-02T13:57:06,169 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/FUNCTIONS 2023-10-02T13:57:06,170 copying build/lib/BODY_SCAN/FUNCTIONS/START_A_SCAN.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/FUNCTIONS 2023-10-02T13:57:06,172 copying build/lib/BODY_SCAN/FUNCTIONS/CHECK_STATUS_LOCATION.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/FUNCTIONS 2023-10-02T13:57:06,173 copying build/lib/BODY_SCAN/FUNCTIONS/START_THE_CORE_KEG.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/FUNCTIONS 2023-10-02T13:57:06,175 running install_egg_info 2023-10-02T13:57:06,205 running egg_info 2023-10-02T13:57:06,230 writing BODY_SCAN.egg-info/PKG-INFO 2023-10-02T13:57:06,233 writing dependency_links to BODY_SCAN.egg-info/dependency_links.txt 2023-10-02T13:57:06,234 writing requirements to BODY_SCAN.egg-info/requires.txt 2023-10-02T13:57:06,236 writing top-level names to BODY_SCAN.egg-info/top_level.txt 2023-10-02T13:57:06,265 reading manifest file 'BODY_SCAN.egg-info/SOURCES.txt' 2023-10-02T13:57:06,267 adding license file 'LICENSE' 2023-10-02T13:57:06,269 writing manifest file 'BODY_SCAN.egg-info/SOURCES.txt' 2023-10-02T13:57:06,270 Copying BODY_SCAN.egg-info to build/bdist.linux-armv7l/wheel/BODY_SCAN-0.0.13-py3.11.egg-info 2023-10-02T13:57:06,281 running install_scripts 2023-10-02T13:57:06,294 creating build/bdist.linux-armv7l/wheel/BODY_SCAN-0.0.13.dist-info/WHEEL 2023-10-02T13:57:06,297 creating '/tmp/pip-wheel-gj8uoskh/BODY_SCAN-0.0.13-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2023-10-02T13:57:06,299 adding 'BODY_SCAN/START_MULTIPLE_PROCESSES.py' 2023-10-02T13:57:06,301 adding 'BODY_SCAN/__init__.py' 2023-10-02T13:57:06,302 adding 'BODY_SCAN/AGGREGATE/__init__.py' 2023-10-02T13:57:06,304 adding 'BODY_SCAN/AGGREGATOR/START.py' 2023-10-02T13:57:06,306 adding 'BODY_SCAN/AGGREGATOR/KEG/__init__.py' 2023-10-02T13:57:06,307 adding 'BODY_SCAN/FUNCTIONS/CHECK_STATUS_LOCATION.py' 2023-10-02T13:57:06,308 adding 'BODY_SCAN/FUNCTIONS/START_A_SCAN.py' 2023-10-02T13:57:06,310 adding 'BODY_SCAN/FUNCTIONS/START_THE_CORE_KEG.py' 2023-10-02T13:57:06,311 adding 'BODY_SCAN/SCAN_PROC/START.py' 2023-10-02T13:57:06,313 adding 'BODY_SCAN/SCAN_PROC/KEG/SCAN.py' 2023-10-02T13:57:06,314 adding 'BODY_SCAN/SCAN_PROC/KEG/__init__.py' 2023-10-02T13:57:06,316 adding 'BODY_SCAN-0.0.13.dist-info/LICENSE' 2023-10-02T13:57:06,318 adding 'BODY_SCAN-0.0.13.dist-info/METADATA' 2023-10-02T13:57:06,319 adding 'BODY_SCAN-0.0.13.dist-info/WHEEL' 2023-10-02T13:57:06,319 adding 'BODY_SCAN-0.0.13.dist-info/top_level.txt' 2023-10-02T13:57:06,320 adding 'BODY_SCAN-0.0.13.dist-info/RECORD' 2023-10-02T13:57:06,322 removing build/bdist.linux-armv7l/wheel 2023-10-02T13:57:06,443 Building wheel for body-scan (setup.py): finished with status 'done' 2023-10-02T13:57:06,446 Created wheel for body-scan: filename=BODY_SCAN-0.0.13-py3-none-any.whl size=9511 sha256=cbd161b8a6d142c2ace2be1042f211467c31e8077aa3293e65090e72e75f3973 2023-10-02T13:57:06,447 Stored in directory: /tmp/pip-ephem-wheel-cache-oez17ppf/wheels/08/18/17/11d6cf9a2d9e98139201939b9a86a4824a5c2214500dca2008 2023-10-02T13:57:06,457 Successfully built body-scan 2023-10-02T13:57:06,460 Removed build tracker: '/tmp/pip-build-tracker-6mmfya3k'