2023-10-02T13:57:58,432 Created temporary directory: /tmp/pip-build-tracker-5x48ggkx 2023-10-02T13:57:58,433 Initialized build tracking at /tmp/pip-build-tracker-5x48ggkx 2023-10-02T13:57:58,434 Created build tracker: /tmp/pip-build-tracker-5x48ggkx 2023-10-02T13:57:58,434 Entered build tracker: /tmp/pip-build-tracker-5x48ggkx 2023-10-02T13:57:58,435 Created temporary directory: /tmp/pip-wheel-kk1qrq36 2023-10-02T13:57:58,438 Created temporary directory: /tmp/pip-ephem-wheel-cache-8mk9onxf 2023-10-02T13:57:58,461 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2023-10-02T13:57:58,465 2 location(s) to search for versions of body-scan: 2023-10-02T13:57:58,465 * https://pypi.org/simple/body-scan/ 2023-10-02T13:57:58,465 * https://www.piwheels.org/simple/body-scan/ 2023-10-02T13:57:58,465 Fetching project page and analyzing links: https://pypi.org/simple/body-scan/ 2023-10-02T13:57:58,466 Getting page https://pypi.org/simple/body-scan/ 2023-10-02T13:57:58,468 Found index url https://pypi.org/simple/ 2023-10-02T13:57:58,608 Fetched page https://pypi.org/simple/body-scan/ as application/vnd.pypi.simple.v1+json 2023-10-02T13:57:58,612 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:58,612 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:58,613 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:58,614 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:58,614 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:58,615 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:58,616 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:58,617 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:58,618 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:58,618 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:58,619 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:58,620 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:58,620 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:58,621 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:58,622 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:58,623 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:58,623 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:58,624 Fetching project page and analyzing links: https://www.piwheels.org/simple/body-scan/ 2023-10-02T13:57:58,624 Getting page https://www.piwheels.org/simple/body-scan/ 2023-10-02T13:57:58,626 Found index url https://www.piwheels.org/simple/ 2023-10-02T13:57:58,780 Fetched page https://www.piwheels.org/simple/body-scan/ as text/html 2023-10-02T13:57:58,783 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:58,784 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:58,784 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:58,785 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:58,785 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:58,786 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:58,786 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:58,787 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:58,788 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:58,788 Skipping link: not a file: https://www.piwheels.org/simple/body-scan/ 2023-10-02T13:57:58,789 Skipping link: not a file: https://pypi.org/simple/body-scan/ 2023-10-02T13:57:58,809 Given no hashes to check 1 links for project 'body-scan': discarding no candidates 2023-10-02T13:57:58,827 Collecting body-scan==0.0.14 2023-10-02T13:57:58,829 Created temporary directory: /tmp/pip-unpack-adp5kw65 2023-10-02T13:57:59,062 Downloading BODY_SCAN-0.0.14.tar.gz (7.0 kB) 2023-10-02T13:57:59,108 Added body-scan==0.0.14 from https://files.pythonhosted.org/packages/39/6a/9c41261dc1211e0799e7579d6bb3c1e872f952f8333cf7d29fcaa3522406/BODY_SCAN-0.0.14.tar.gz to build tracker '/tmp/pip-build-tracker-5x48ggkx' 2023-10-02T13:57:59,110 Running setup.py (path:/tmp/pip-wheel-kk1qrq36/body-scan_78834ee4b7134f64b325a0ae72838b11/setup.py) egg_info for package body-scan 2023-10-02T13:57:59,111 Created temporary directory: /tmp/pip-pip-egg-info-kmnefk5t 2023-10-02T13:57:59,111 Preparing metadata (setup.py): started 2023-10-02T13:57:59,113 Running command python setup.py egg_info 2023-10-02T13:58:00,138 # BODY SCAN 2023-10-02T13:58:00,139 ## EXAMPLE OUTPUT: 2023-10-02T13:58:00,140 ```JSON 2023-10-02T13:58:00,140 { 2023-10-02T13:58:00,141 "PATHS": [ 2023-10-02T13:58:00,141 { 2023-10-02T13:58:00,142 "PATH": "PATH_1_HEALTH.py", 2023-10-02T13:58:00,142 "STATS": { 2023-10-02T13:58:00,143 "PASSES": 2, 2023-10-02T13:58:00,143 "ALARMS": 1 2023-10-02T13:58:00,144 }, 2023-10-02T13:58:00,144 "CHECKS": [ 2023-10-02T13:58:00,145 { 2023-10-02T13:58:00,145 "CHECK": "CHECK 1", 2023-10-02T13:58:00,146 "PASSED": true, 2023-10-02T13:58:00,146 "ELAPSED": [ 2023-10-02T13:58:00,147 5.320599666447379e-05, 2023-10-02T13:58:00,147 "SECONDS" 2023-10-02T13:58:00,148 ] 2023-10-02T13:58:00,148 }, 2023-10-02T13:58:00,149 { 2023-10-02T13:58:00,149 "CHECK": "CHECK 2", 2023-10-02T13:58:00,150 "PASSED": true, 2023-10-02T13:58:00,150 "ELAPSED": [ 2023-10-02T13:58:00,151 1.0949999705189839e-05, 2023-10-02T13:58:00,151 "SECONDS" 2023-10-02T13:58:00,152 ] 2023-10-02T13:58:00,153 }, 2023-10-02T13:58:00,153 { 2023-10-02T13:58:00,154 "CHECK": "CHECK 3", 2023-10-02T13:58:00,154 "PASSED": false, 2023-10-02T13:58:00,155 "EXCEPTION": "Exception('NOT 100%')", 2023-10-02T13:58:00,155 "EXCEPTION TRACE": [ 2023-10-02T13:58:00,156 "Traceback (most recent call last):", 2023-10-02T13:58:00,156 " File \"/REPTILIAN_CLIMATES/MODULES/BODY_SCAN/src/SCAN_PROC/KEG/SCAN.py\", line 69, in SCAN", 2023-10-02T13:58:00,157 " CHECKS [ CHECK ] ()", 2023-10-02T13:58:00,158 " File \"\", line 24, in CHECK_3", 2023-10-02T13:58:00,158 "Exception: NOT 100%" 2023-10-02T13:58:00,159 ] 2023-10-02T13:58:00,159 } 2023-10-02T13:58:00,160 ] 2023-10-02T13:58:00,160 }, 2023-10-02T13:58:00,161 { 2023-10-02T13:58:00,162 "PATH": "PATH_2_HEALTH.py", 2023-10-02T13:58:00,162 "EMPTY": true 2023-10-02T13:58:00,163 } 2023-10-02T13:58:00,163 ], 2023-10-02T13:58:00,164 "STATS": { 2023-10-02T13:58:00,164 "EMPTY": 1, 2023-10-02T13:58:00,165 "CHECKS": { 2023-10-02T13:58:00,166 "PASSES": 2, 2023-10-02T13:58:00,166 "ALARMS": 1 2023-10-02T13:58:00,167 } 2023-10-02T13:58:00,167 } 2023-10-02T13:58:00,168 } 2023-10-02T13:58:00,168 ``` 2023-10-02T13:58:00,170 ## HOW TO WRITE CHECKS: 2023-10-02T13:58:00,170 The "CHECKS" dictionary is retrieved with the python "exec" 2023-10-02T13:58:00,171 and then each "CHECK" in "CHECKS" is run. 2023-10-02T13:58:00,172 These checks correspond to the example output shown above. 2023-10-02T13:58:00,173 ``` 2023-10-02T13:58:00,173 PATH_1_HEALTH.py 2023-10-02T13:58:00,174 ``` 2023-10-02T13:58:00,175 ``` 2023-10-02T13:58:00,175 def CHECK_1 (): 2023-10-02T13:58:00,176 print ("CHECK 1") 2023-10-02T13:58:00,176 def CHECK_2 (): 2023-10-02T13:58:00,177 print ("CHECK 2") 2023-10-02T13:58:00,178 def CHECK_3 (): 2023-10-02T13:58:00,178 raise Exception ("NOT 100%") 2023-10-02T13:58:00,179 CHECKS = { 2023-10-02T13:58:00,179 "CHECK 1": CHECK_1, 2023-10-02T13:58:00,180 "CHECK 2": CHECK_2, 2023-10-02T13:58:00,180 "CHECK 3": CHECK_3 2023-10-02T13:58:00,180 } 2023-10-02T13:58:00,181 ``` 2023-10-02T13:58:00,181 ``` 2023-10-02T13:58:00,182 PATH_2_HEALTH.py 2023-10-02T13:58:00,182 ``` 2023-10-02T13:58:00,182 ``` 2023-10-02T13:58:00,183 # 2023-10-02T13:58:00,183 # There isn't a "CHECKS" dictionary present, 2023-10-02T13:58:00,184 # so the scanner reports: 2023-10-02T13:58:00,184 # 2023-10-02T13:58:00,185 # "EMPTY": true 2023-10-02T13:58:00,185 # 2023-10-02T13:58:00,186 ``` 2023-10-02T13:58:00,187 ## HOW TO START THE BODY SCANNER 2023-10-02T13:58:00,188 ### REQUIRED 2023-10-02T13:58:00,188 ``` 2023-10-02T13:58:00,189 "GLOB" is all the files that are sent to the scanner. 2023-10-02T13:58:00,189 ``` 2023-10-02T13:58:00,190 ### OPTIONAL 2023-10-02T13:58:00,190 ``` 2023-10-02T13:58:00,191 "MODULE_PATHS" is folders that are added to "sys.path" 2023-10-02T13:58:00,192 "RELATIVE_PATH" is the folders to remove from the paths in the output 2023-10-02T13:58:00,192 ``` 2023-10-02T13:58:00,193 ### NOTES 2023-10-02T13:58:00,193 ``` 2023-10-02T13:58:00,194 Currently all the checks aren't run in parallel, 2023-10-02T13:58:00,194 but sequential order of paths found in glob is not guaranteed. 2023-10-02T13:58:00,195 ``` 2023-10-02T13:58:00,195 ``` 2023-10-02T13:58:00,196 Each check suite found by the glob is encapsulated in 2023-10-02T13:58:00,196 a process with a flask API, that is opened on the first available port found. 2023-10-02T13:58:00,197 ``` 2023-10-02T13:58:00,198 ```python3 2023-10-02T13:58:00,199 import BODY_SCAN 2023-10-02T13:58:00,200 import pathlib 2023-10-02T13:58:00,200 THIS_FOLDER = pathlib.Path (__file__).parent.resolve () 2023-10-02T13:58:00,202 from os.path import dirname, join, normpath 2023-10-02T13:58:00,202 SEARCH = normpath (join (THIS_FOLDER, "MODULE")) 2023-10-02T13:58:00,203 # 2023-10-02T13:58:00,204 # These are added to the sys.path before scan is started. 2023-10-02T13:58:00,204 # 2023-10-02T13:58:00,205 MODULE_PATH = [ 2023-10-02T13:58:00,206 normpath (join (SEARCH, "MODULES")) 2023-10-02T13:58:00,206 ] 2023-10-02T13:58:00,207 SCAN = BODY_SCAN.START ( 2023-10-02T13:58:00,208 # REQUIRED 2023-10-02T13:58:00,208 GLOB = SEARCH + '/**/*HEALTH.py', 2023-10-02T13:58:00,210 # OPTIONAL 2023-10-02T13:58:00,210 MODULE_PATHS = MODULE_PATH, 2023-10-02T13:58:00,211 # OPTIONAL 2023-10-02T13:58:00,212 RELATIVE_PATH = SEARCH 2023-10-02T13:58:00,212 ) 2023-10-02T13:58:00,213 ``` 2023-10-02T13:58:00,215 running egg_info 2023-10-02T13:58:00,215 creating /tmp/pip-pip-egg-info-kmnefk5t/BODY_SCAN.egg-info 2023-10-02T13:58:00,216 writing /tmp/pip-pip-egg-info-kmnefk5t/BODY_SCAN.egg-info/PKG-INFO 2023-10-02T13:58:00,217 writing dependency_links to /tmp/pip-pip-egg-info-kmnefk5t/BODY_SCAN.egg-info/dependency_links.txt 2023-10-02T13:58:00,217 writing requirements to /tmp/pip-pip-egg-info-kmnefk5t/BODY_SCAN.egg-info/requires.txt 2023-10-02T13:58:00,218 writing top-level names to /tmp/pip-pip-egg-info-kmnefk5t/BODY_SCAN.egg-info/top_level.txt 2023-10-02T13:58:00,218 writing manifest file '/tmp/pip-pip-egg-info-kmnefk5t/BODY_SCAN.egg-info/SOURCES.txt' 2023-10-02T13:58:00,260 reading manifest file '/tmp/pip-pip-egg-info-kmnefk5t/BODY_SCAN.egg-info/SOURCES.txt' 2023-10-02T13:58:00,261 adding license file 'LICENSE' 2023-10-02T13:58:00,263 writing manifest file '/tmp/pip-pip-egg-info-kmnefk5t/BODY_SCAN.egg-info/SOURCES.txt' 2023-10-02T13:58:00,372 Preparing metadata (setup.py): finished with status 'done' 2023-10-02T13:58:00,378 Source in /tmp/pip-wheel-kk1qrq36/body-scan_78834ee4b7134f64b325a0ae72838b11 has version 0.0.14, which satisfies requirement body-scan==0.0.14 from https://files.pythonhosted.org/packages/39/6a/9c41261dc1211e0799e7579d6bb3c1e872f952f8333cf7d29fcaa3522406/BODY_SCAN-0.0.14.tar.gz 2023-10-02T13:58:00,379 Removed body-scan==0.0.14 from https://files.pythonhosted.org/packages/39/6a/9c41261dc1211e0799e7579d6bb3c1e872f952f8333cf7d29fcaa3522406/BODY_SCAN-0.0.14.tar.gz from build tracker '/tmp/pip-build-tracker-5x48ggkx' 2023-10-02T13:58:00,384 Created temporary directory: /tmp/pip-unpack-2l1tnp5b 2023-10-02T13:58:00,385 Created temporary directory: /tmp/pip-unpack-7gtgadpn 2023-10-02T13:58:00,391 Building wheels for collected packages: body-scan 2023-10-02T13:58:00,395 Created temporary directory: /tmp/pip-wheel-mmmh7hqb 2023-10-02T13:58:00,395 Building wheel for body-scan (setup.py): started 2023-10-02T13:58:00,396 Destination directory: /tmp/pip-wheel-mmmh7hqb 2023-10-02T13:58:00,397 Running command python setup.py bdist_wheel 2023-10-02T13:58:00,794 # BODY SCAN 2023-10-02T13:58:00,795 ## EXAMPLE OUTPUT: 2023-10-02T13:58:00,795 ```JSON 2023-10-02T13:58:00,796 { 2023-10-02T13:58:00,796 "PATHS": [ 2023-10-02T13:58:00,797 { 2023-10-02T13:58:00,797 "PATH": "PATH_1_HEALTH.py", 2023-10-02T13:58:00,798 "STATS": { 2023-10-02T13:58:00,798 "PASSES": 2, 2023-10-02T13:58:00,799 "ALARMS": 1 2023-10-02T13:58:00,799 }, 2023-10-02T13:58:00,799 "CHECKS": [ 2023-10-02T13:58:00,800 { 2023-10-02T13:58:00,800 "CHECK": "CHECK 1", 2023-10-02T13:58:00,801 "PASSED": true, 2023-10-02T13:58:00,801 "ELAPSED": [ 2023-10-02T13:58:00,802 5.320599666447379e-05, 2023-10-02T13:58:00,802 "SECONDS" 2023-10-02T13:58:00,803 ] 2023-10-02T13:58:00,804 }, 2023-10-02T13:58:00,804 { 2023-10-02T13:58:00,805 "CHECK": "CHECK 2", 2023-10-02T13:58:00,805 "PASSED": true, 2023-10-02T13:58:00,806 "ELAPSED": [ 2023-10-02T13:58:00,806 1.0949999705189839e-05, 2023-10-02T13:58:00,807 "SECONDS" 2023-10-02T13:58:00,807 ] 2023-10-02T13:58:00,808 }, 2023-10-02T13:58:00,809 { 2023-10-02T13:58:00,809 "CHECK": "CHECK 3", 2023-10-02T13:58:00,810 "PASSED": false, 2023-10-02T13:58:00,811 "EXCEPTION": "Exception('NOT 100%')", 2023-10-02T13:58:00,811 "EXCEPTION TRACE": [ 2023-10-02T13:58:00,812 "Traceback (most recent call last):", 2023-10-02T13:58:00,812 " File \"/REPTILIAN_CLIMATES/MODULES/BODY_SCAN/src/SCAN_PROC/KEG/SCAN.py\", line 69, in SCAN", 2023-10-02T13:58:00,813 " CHECKS [ CHECK ] ()", 2023-10-02T13:58:00,813 " File \"\", line 24, in CHECK_3", 2023-10-02T13:58:00,814 "Exception: NOT 100%" 2023-10-02T13:58:00,814 ] 2023-10-02T13:58:00,815 } 2023-10-02T13:58:00,815 ] 2023-10-02T13:58:00,816 }, 2023-10-02T13:58:00,817 { 2023-10-02T13:58:00,817 "PATH": "PATH_2_HEALTH.py", 2023-10-02T13:58:00,818 "EMPTY": true 2023-10-02T13:58:00,818 } 2023-10-02T13:58:00,819 ], 2023-10-02T13:58:00,819 "STATS": { 2023-10-02T13:58:00,820 "EMPTY": 1, 2023-10-02T13:58:00,821 "CHECKS": { 2023-10-02T13:58:00,821 "PASSES": 2, 2023-10-02T13:58:00,822 "ALARMS": 1 2023-10-02T13:58:00,822 } 2023-10-02T13:58:00,823 } 2023-10-02T13:58:00,824 } 2023-10-02T13:58:00,824 ``` 2023-10-02T13:58:00,825 ## HOW TO WRITE CHECKS: 2023-10-02T13:58:00,827 The "CHECKS" dictionary is retrieved with the python "exec" 2023-10-02T13:58:00,827 and then each "CHECK" in "CHECKS" is run. 2023-10-02T13:58:00,828 These checks correspond to the example output shown above. 2023-10-02T13:58:00,829 ``` 2023-10-02T13:58:00,829 PATH_1_HEALTH.py 2023-10-02T13:58:00,829 ``` 2023-10-02T13:58:00,830 ``` 2023-10-02T13:58:00,830 def CHECK_1 (): 2023-10-02T13:58:00,831 print ("CHECK 1") 2023-10-02T13:58:00,832 def CHECK_2 (): 2023-10-02T13:58:00,832 print ("CHECK 2") 2023-10-02T13:58:00,833 def CHECK_3 (): 2023-10-02T13:58:00,833 raise Exception ("NOT 100%") 2023-10-02T13:58:00,834 CHECKS = { 2023-10-02T13:58:00,834 "CHECK 1": CHECK_1, 2023-10-02T13:58:00,835 "CHECK 2": CHECK_2, 2023-10-02T13:58:00,835 "CHECK 3": CHECK_3 2023-10-02T13:58:00,836 } 2023-10-02T13:58:00,836 ``` 2023-10-02T13:58:00,837 ``` 2023-10-02T13:58:00,837 PATH_2_HEALTH.py 2023-10-02T13:58:00,837 ``` 2023-10-02T13:58:00,838 ``` 2023-10-02T13:58:00,838 # 2023-10-02T13:58:00,839 # There isn't a "CHECKS" dictionary present, 2023-10-02T13:58:00,839 # so the scanner reports: 2023-10-02T13:58:00,840 # 2023-10-02T13:58:00,840 # "EMPTY": true 2023-10-02T13:58:00,841 # 2023-10-02T13:58:00,841 ``` 2023-10-02T13:58:00,842 ## HOW TO START THE BODY SCANNER 2023-10-02T13:58:00,844 ### REQUIRED 2023-10-02T13:58:00,844 ``` 2023-10-02T13:58:00,845 "GLOB" is all the files that are sent to the scanner. 2023-10-02T13:58:00,845 ``` 2023-10-02T13:58:00,846 ### OPTIONAL 2023-10-02T13:58:00,847 ``` 2023-10-02T13:58:00,847 "MODULE_PATHS" is folders that are added to "sys.path" 2023-10-02T13:58:00,848 "RELATIVE_PATH" is the folders to remove from the paths in the output 2023-10-02T13:58:00,848 ``` 2023-10-02T13:58:00,849 ### NOTES 2023-10-02T13:58:00,850 ``` 2023-10-02T13:58:00,851 Currently all the checks aren't run in parallel, 2023-10-02T13:58:00,851 but sequential order of paths found in glob is not guaranteed. 2023-10-02T13:58:00,852 ``` 2023-10-02T13:58:00,852 ``` 2023-10-02T13:58:00,853 Each check suite found by the glob is encapsulated in 2023-10-02T13:58:00,853 a process with a flask API, that is opened on the first available port found. 2023-10-02T13:58:00,854 ``` 2023-10-02T13:58:00,855 ```python3 2023-10-02T13:58:00,856 import BODY_SCAN 2023-10-02T13:58:00,857 import pathlib 2023-10-02T13:58:00,857 THIS_FOLDER = pathlib.Path (__file__).parent.resolve () 2023-10-02T13:58:00,859 from os.path import dirname, join, normpath 2023-10-02T13:58:00,859 SEARCH = normpath (join (THIS_FOLDER, "MODULE")) 2023-10-02T13:58:00,860 # 2023-10-02T13:58:00,861 # These are added to the sys.path before scan is started. 2023-10-02T13:58:00,862 # 2023-10-02T13:58:00,862 MODULE_PATH = [ 2023-10-02T13:58:00,863 normpath (join (SEARCH, "MODULES")) 2023-10-02T13:58:00,863 ] 2023-10-02T13:58:00,864 SCAN = BODY_SCAN.START ( 2023-10-02T13:58:00,865 # REQUIRED 2023-10-02T13:58:00,865 GLOB = SEARCH + '/**/*HEALTH.py', 2023-10-02T13:58:00,866 # OPTIONAL 2023-10-02T13:58:00,867 MODULE_PATHS = MODULE_PATH, 2023-10-02T13:58:00,868 # OPTIONAL 2023-10-02T13:58:00,869 RELATIVE_PATH = SEARCH 2023-10-02T13:58:00,869 ) 2023-10-02T13:58:00,870 ``` 2023-10-02T13:58:01,382 running bdist_wheel 2023-10-02T13:58:01,474 running build 2023-10-02T13:58:01,475 running build_py 2023-10-02T13:58:01,500 creating build 2023-10-02T13:58:01,501 creating build/lib 2023-10-02T13:58:01,502 creating build/lib/BODY_SCAN 2023-10-02T13:58:01,503 copying src/START_MULTIPLE_PROCESSES.py -> build/lib/BODY_SCAN 2023-10-02T13:58:01,505 copying src/__init__.py -> build/lib/BODY_SCAN 2023-10-02T13:58:01,507 creating build/lib/BODY_SCAN/FUNCTIONS 2023-10-02T13:58:01,508 copying src/FUNCTIONS/START_THE_CORE_KEG.py -> build/lib/BODY_SCAN/FUNCTIONS 2023-10-02T13:58:01,510 copying src/FUNCTIONS/CHECK_STATUS_LOCATION.py -> build/lib/BODY_SCAN/FUNCTIONS 2023-10-02T13:58:01,511 copying src/FUNCTIONS/START_A_SCAN.py -> build/lib/BODY_SCAN/FUNCTIONS 2023-10-02T13:58:01,513 creating build/lib/BODY_SCAN/SCAN_PROC 2023-10-02T13:58:01,514 copying src/SCAN_PROC/START.py -> build/lib/BODY_SCAN/SCAN_PROC 2023-10-02T13:58:01,516 creating build/lib/BODY_SCAN/AGGREGATE 2023-10-02T13:58:01,517 copying src/AGGREGATE/__init__.py -> build/lib/BODY_SCAN/AGGREGATE 2023-10-02T13:58:01,519 creating build/lib/BODY_SCAN/AGGREGATOR 2023-10-02T13:58:01,520 copying src/AGGREGATOR/START.py -> build/lib/BODY_SCAN/AGGREGATOR 2023-10-02T13:58:01,522 creating build/lib/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:58:01,523 copying src/SCAN_PROC/KEG/__init__.py -> build/lib/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:58:01,524 copying src/SCAN_PROC/KEG/SCAN.py -> build/lib/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:58:01,526 creating build/lib/BODY_SCAN/AGGREGATOR/KEG 2023-10-02T13:58:01,527 copying src/AGGREGATOR/KEG/__init__.py -> build/lib/BODY_SCAN/AGGREGATOR/KEG 2023-10-02T13:58:01,556 /usr/local/lib/python3.11/dist-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. 2023-10-02T13:58:01,556 !! 2023-10-02T13:58:01,557 ******************************************************************************** 2023-10-02T13:58:01,558 Please avoid running ``setup.py`` directly. 2023-10-02T13:58:01,558 Instead, use pypa/build, pypa/installer or other 2023-10-02T13:58:01,559 standards-based tools. 2023-10-02T13:58:01,559 See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. 2023-10-02T13:58:01,560 ******************************************************************************** 2023-10-02T13:58:01,561 !! 2023-10-02T13:58:01,561 self.initialize_options() 2023-10-02T13:58:01,579 installing to build/bdist.linux-armv7l/wheel 2023-10-02T13:58:01,580 running install 2023-10-02T13:58:01,603 running install_lib 2023-10-02T13:58:01,627 creating build/bdist.linux-armv7l 2023-10-02T13:58:01,627 creating build/bdist.linux-armv7l/wheel 2023-10-02T13:58:01,629 creating build/bdist.linux-armv7l/wheel/BODY_SCAN 2023-10-02T13:58:01,630 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/FUNCTIONS 2023-10-02T13:58:01,631 copying build/lib/BODY_SCAN/FUNCTIONS/START_THE_CORE_KEG.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/FUNCTIONS 2023-10-02T13:58:01,633 copying build/lib/BODY_SCAN/FUNCTIONS/CHECK_STATUS_LOCATION.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/FUNCTIONS 2023-10-02T13:58:01,634 copying build/lib/BODY_SCAN/FUNCTIONS/START_A_SCAN.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/FUNCTIONS 2023-10-02T13:58:01,637 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/SCAN_PROC 2023-10-02T13:58:01,638 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:58:01,639 copying build/lib/BODY_SCAN/SCAN_PROC/KEG/__init__.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:58:01,641 copying build/lib/BODY_SCAN/SCAN_PROC/KEG/SCAN.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/SCAN_PROC/KEG 2023-10-02T13:58:01,642 copying build/lib/BODY_SCAN/SCAN_PROC/START.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/SCAN_PROC 2023-10-02T13:58:01,644 copying build/lib/BODY_SCAN/START_MULTIPLE_PROCESSES.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN 2023-10-02T13:58:01,646 copying build/lib/BODY_SCAN/__init__.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN 2023-10-02T13:58:01,648 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATE 2023-10-02T13:58:01,649 copying build/lib/BODY_SCAN/AGGREGATE/__init__.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATE 2023-10-02T13:58:01,651 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATOR 2023-10-02T13:58:01,653 creating build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATOR/KEG 2023-10-02T13:58:01,654 copying build/lib/BODY_SCAN/AGGREGATOR/KEG/__init__.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATOR/KEG 2023-10-02T13:58:01,655 copying build/lib/BODY_SCAN/AGGREGATOR/START.py -> build/bdist.linux-armv7l/wheel/BODY_SCAN/AGGREGATOR 2023-10-02T13:58:01,657 running install_egg_info 2023-10-02T13:58:01,717 running egg_info 2023-10-02T13:58:01,740 writing BODY_SCAN.egg-info/PKG-INFO 2023-10-02T13:58:01,743 writing dependency_links to BODY_SCAN.egg-info/dependency_links.txt 2023-10-02T13:58:01,744 writing requirements to BODY_SCAN.egg-info/requires.txt 2023-10-02T13:58:01,745 writing top-level names to BODY_SCAN.egg-info/top_level.txt 2023-10-02T13:58:01,773 reading manifest file 'BODY_SCAN.egg-info/SOURCES.txt' 2023-10-02T13:58:01,774 adding license file 'LICENSE' 2023-10-02T13:58:01,776 writing manifest file 'BODY_SCAN.egg-info/SOURCES.txt' 2023-10-02T13:58:01,778 Copying BODY_SCAN.egg-info to build/bdist.linux-armv7l/wheel/BODY_SCAN-0.0.14-py3.11.egg-info 2023-10-02T13:58:01,787 running install_scripts 2023-10-02T13:58:01,799 creating build/bdist.linux-armv7l/wheel/BODY_SCAN-0.0.14.dist-info/WHEEL 2023-10-02T13:58:01,801 creating '/tmp/pip-wheel-mmmh7hqb/BODY_SCAN-0.0.14-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2023-10-02T13:58:01,804 adding 'BODY_SCAN/START_MULTIPLE_PROCESSES.py' 2023-10-02T13:58:01,805 adding 'BODY_SCAN/__init__.py' 2023-10-02T13:58:01,807 adding 'BODY_SCAN/AGGREGATE/__init__.py' 2023-10-02T13:58:01,808 adding 'BODY_SCAN/AGGREGATOR/START.py' 2023-10-02T13:58:01,810 adding 'BODY_SCAN/AGGREGATOR/KEG/__init__.py' 2023-10-02T13:58:01,812 adding 'BODY_SCAN/FUNCTIONS/CHECK_STATUS_LOCATION.py' 2023-10-02T13:58:01,813 adding 'BODY_SCAN/FUNCTIONS/START_A_SCAN.py' 2023-10-02T13:58:01,814 adding 'BODY_SCAN/FUNCTIONS/START_THE_CORE_KEG.py' 2023-10-02T13:58:01,816 adding 'BODY_SCAN/SCAN_PROC/START.py' 2023-10-02T13:58:01,817 adding 'BODY_SCAN/SCAN_PROC/KEG/SCAN.py' 2023-10-02T13:58:01,818 adding 'BODY_SCAN/SCAN_PROC/KEG/__init__.py' 2023-10-02T13:58:01,820 adding 'BODY_SCAN-0.0.14.dist-info/LICENSE' 2023-10-02T13:58:01,822 adding 'BODY_SCAN-0.0.14.dist-info/METADATA' 2023-10-02T13:58:01,823 adding 'BODY_SCAN-0.0.14.dist-info/WHEEL' 2023-10-02T13:58:01,823 adding 'BODY_SCAN-0.0.14.dist-info/top_level.txt' 2023-10-02T13:58:01,824 adding 'BODY_SCAN-0.0.14.dist-info/RECORD' 2023-10-02T13:58:01,826 removing build/bdist.linux-armv7l/wheel 2023-10-02T13:58:01,943 Building wheel for body-scan (setup.py): finished with status 'done' 2023-10-02T13:58:01,946 Created wheel for body-scan: filename=BODY_SCAN-0.0.14-py3-none-any.whl size=9512 sha256=7defdc43c3d2bbbac77bb8074abc4010b7ab57e620b0a7e5a8c701fdcc7263d2 2023-10-02T13:58:01,947 Stored in directory: /tmp/pip-ephem-wheel-cache-8mk9onxf/wheels/6e/a2/ea/c827c5f7b7724c5e1fd13eb516b7a7ebc61bc6574344b87d90 2023-10-02T13:58:01,957 Successfully built body-scan 2023-10-02T13:58:01,960 Removed build tracker: '/tmp/pip-build-tracker-5x48ggkx'