wwpdb.apps.val-rel 0.27.dev1__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.
- wwpdb_apps_val_rel-0.27.dev1/.gitignore +113 -0
- wwpdb_apps_val_rel-0.27.dev1/PKG-INFO +185 -0
- wwpdb_apps_val_rel-0.27.dev1/README.md +151 -0
- wwpdb_apps_val_rel-0.27.dev1/pyproject.toml +175 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/PopulateValidateRelease.py +311 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/RemoveExcessOutputFolders.py +92 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/ValidateRelease.py +740 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/__init__.py +1 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/config/ValConfig.py +124 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/config/__init__.py +0 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/service/ValidationReleaseServiceHandler.py +345 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/service/__init__.py +0 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/CutOffUtils.py +32 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/Files.py +72 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/FindAndProcessEntries.py +220 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/FindEntries.py +70 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/PersistFileCache.py +192 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/ValDataStore.py +40 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/ValidationRun.py +112 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/XmlInfo.py +21 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/__init__.py +0 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/checkModifications.py +25 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/check_results.py +386 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/emailHandler.py +77 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/fileConversion.py +32 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/find_and_run_missing.py +100 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/ftp_protocol/getFilesReleaseFTP_EMDB.py +251 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/ftp_protocol/getFilesReleaseFTP_PDB.py +193 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/ftp_protocol/getRemoteFilesFTP.py +309 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/getFilesRelease.py +178 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/getFilesReleaseBase.py +116 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/getFilesReleaseOneDep.py +143 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/http_protocol/__init__.py +0 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/http_protocol/getFilesReleaseHTTP_EMDB.py +277 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/http_protocol/getFilesReleaseHTTP_PDB.py +192 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/http_protocol/getRemoteFilesHTTP.py +200 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/mmCIFInfo.py +264 -0
- wwpdb_apps_val_rel-0.27.dev1/wwpdb/apps/val_rel/utils/outputFiles.py +246 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
MANIFEST
|
|
27
|
+
|
|
28
|
+
# PyInstaller
|
|
29
|
+
# Usually these files are written by a python script from a template
|
|
30
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
.cache
|
|
44
|
+
nosetests.xml
|
|
45
|
+
coverage.xml
|
|
46
|
+
*.cover
|
|
47
|
+
.hypothesis/
|
|
48
|
+
.pytest_cache/
|
|
49
|
+
|
|
50
|
+
# Translations
|
|
51
|
+
*.mo
|
|
52
|
+
*.pot
|
|
53
|
+
|
|
54
|
+
# Django stuff:
|
|
55
|
+
*.log
|
|
56
|
+
local_settings.py
|
|
57
|
+
db.sqlite3
|
|
58
|
+
|
|
59
|
+
# Flask stuff:
|
|
60
|
+
instance/
|
|
61
|
+
.webassets-cache
|
|
62
|
+
|
|
63
|
+
# Scrapy stuff:
|
|
64
|
+
.scrapy
|
|
65
|
+
|
|
66
|
+
# Sphinx documentation
|
|
67
|
+
docs/_build/
|
|
68
|
+
|
|
69
|
+
# PyBuilder
|
|
70
|
+
target/
|
|
71
|
+
|
|
72
|
+
# Jupyter Notebook
|
|
73
|
+
.ipynb_checkpoints
|
|
74
|
+
|
|
75
|
+
# pyenv
|
|
76
|
+
.python-version
|
|
77
|
+
|
|
78
|
+
# celery beat schedule file
|
|
79
|
+
celerybeat-schedule
|
|
80
|
+
|
|
81
|
+
# SageMath parsed files
|
|
82
|
+
*.sage.py
|
|
83
|
+
|
|
84
|
+
# Environments
|
|
85
|
+
.env
|
|
86
|
+
.venv
|
|
87
|
+
env/
|
|
88
|
+
venv/
|
|
89
|
+
ENV/
|
|
90
|
+
env.bak/
|
|
91
|
+
venv.bak/
|
|
92
|
+
|
|
93
|
+
# Spyder project settings
|
|
94
|
+
.spyderproject
|
|
95
|
+
.spyproject
|
|
96
|
+
|
|
97
|
+
# Rope project settings
|
|
98
|
+
.ropeproject
|
|
99
|
+
|
|
100
|
+
# mkdocs documentation
|
|
101
|
+
/site
|
|
102
|
+
|
|
103
|
+
# mypy
|
|
104
|
+
.mypy_cache/
|
|
105
|
+
|
|
106
|
+
# vscode
|
|
107
|
+
.idea
|
|
108
|
+
.vscode
|
|
109
|
+
|
|
110
|
+
# Emacs backup
|
|
111
|
+
*~
|
|
112
|
+
|
|
113
|
+
tests/test-output
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: wwpdb.apps.val-rel
|
|
3
|
+
Version: 0.27.dev1
|
|
4
|
+
Summary: wwPDB validation processing for weekly release
|
|
5
|
+
Project-URL: Homepage, https://github.com/wwpdb/py-wwpdb_apps_val_rel
|
|
6
|
+
Author-email: Ezra Peisach <ezra.peisach@rcsb.org>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Natural Language :: English
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Requires-Dist: filelock
|
|
16
|
+
Requires-Dist: mmcif
|
|
17
|
+
Requires-Dist: oslo-concurrency
|
|
18
|
+
Requires-Dist: requests
|
|
19
|
+
Requires-Dist: urllib3
|
|
20
|
+
Requires-Dist: wwpdb-apps-validation~=2.49
|
|
21
|
+
Requires-Dist: wwpdb-io<2.0,>=0.15
|
|
22
|
+
Requires-Dist: wwpdb-utils-config>=0.24
|
|
23
|
+
Requires-Dist: wwpdb-utils-detach
|
|
24
|
+
Requires-Dist: wwpdb-utils-dp
|
|
25
|
+
Requires-Dist: wwpdb-utils-message-queue~=0.6
|
|
26
|
+
Requires-Dist: wwpdb-utils-nmr
|
|
27
|
+
Requires-Dist: wwpdb-utils-session
|
|
28
|
+
Requires-Dist: wwpdb-utils-ws-utils
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: check-manifest; extra == 'dev'
|
|
31
|
+
Provides-Extra: test
|
|
32
|
+
Requires-Dist: coverage; extra == 'test'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# py-wwpdb_apps_val_rel
|
|
36
|
+
Service to prepare weekly validation reports
|
|
37
|
+
|
|
38
|
+
## requirements
|
|
39
|
+
In site-config the following must be set
|
|
40
|
+
|
|
41
|
+
VAL_REL_PROTOCOL = determines the protocol to use (ftp, http, https) if local ftp tree is not available.
|
|
42
|
+
VAL_REL_ADMIN_EMAIL = comma separated list of who to contact on failures
|
|
43
|
+
VAL_REL_DISABLE_MULTITHREAD = if set disable validation code from running in parallel fashion
|
|
44
|
+
SITE_PDB_FTP_ROOT_DIR = the root of the PDB FTP tree (before pdb/data) - this can be not set if its not available at the local site
|
|
45
|
+
SITE_EMDB_FTP_ROOT_DIR = the root of the EMDB FTP tree (before emdb/structures) - this can be not set if its not available at the local site
|
|
46
|
+
SITE_FTP_SERVER = this will default to ftp.wwpdb.org if not set
|
|
47
|
+
SITE_FTP_SERVER_PREFIX = this is the prefix in the URL at the FTP server until you get to the PDB or EMDB data - i.e. on ftp.wwpdb.org this is "pub"
|
|
48
|
+
SITE_HTTP_SERVER = this will default to files.wwpdb.org if not set
|
|
49
|
+
SITE_HTTP_SERVER_PREFIX = this is the prefix in the URL at the HTTP server until you get to the PDB or EMDB data - i.e. on files.wwpdb.org this is "pub"
|
|
50
|
+
SITE_RBMQ_SERVER_HOST = this is the host that runs the rabbitMQ server
|
|
51
|
+
|
|
52
|
+
## to setup rabbitMQ
|
|
53
|
+
|
|
54
|
+
See
|
|
55
|
+
|
|
56
|
+
https://github.com/wwPDB/onedep-maintenance/blob/master/pdbe_redhat7/server_scripts/setup_rabbitMQ.sh
|
|
57
|
+
|
|
58
|
+
## usage
|
|
59
|
+
|
|
60
|
+
This process has two parts
|
|
61
|
+
1) finding entries to run validation reports and adding to a rabbitMQ queue
|
|
62
|
+
2) workers which take work from the rabbitMQ queue and create validation reports
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### 1) Finding entries
|
|
67
|
+
|
|
68
|
+
Entries are found by a script which searches the for_release folder
|
|
69
|
+
|
|
70
|
+
python -m wwpdb.apps.val_rel.PopulateValidateRelease
|
|
71
|
+
usage options are
|
|
72
|
+
--pdb_release - find PDB entries in the for_release/{added/modified} folders
|
|
73
|
+
--emdb_release - find EMDB entries in the for_release/emd folder
|
|
74
|
+
--skip_emdb - if only PDB entry reports with no visual analysis is required.
|
|
75
|
+
--entry_list - comma separated list of entries
|
|
76
|
+
--entry_file - file containing entries, one per line
|
|
77
|
+
--output_root - to output to a path of your choice
|
|
78
|
+
--help for other options
|
|
79
|
+
|
|
80
|
+
This should be run on a cron every few hours.
|
|
81
|
+
|
|
82
|
+
If a priority queue is required, add the option --priority.
|
|
83
|
+
|
|
84
|
+
### 2) validation report workers
|
|
85
|
+
|
|
86
|
+
workers pick up work from the rabbitMQ queue and generate validation reports.
|
|
87
|
+
To start one worker
|
|
88
|
+
|
|
89
|
+
python -m wwpdb.apps.val_rel.service.ValidationReleaseServiceHandler --start
|
|
90
|
+
|
|
91
|
+
To read from a priority queue, add the option --priority.
|
|
92
|
+
|
|
93
|
+
To start several workers - below example starts 50 workers
|
|
94
|
+
|
|
95
|
+
for i in {1..50}
|
|
96
|
+
do
|
|
97
|
+
echo ${i}
|
|
98
|
+
python -m wwpdb.apps.val_rel.service.ValidationReleaseServiceHandler --start --instance ${i}
|
|
99
|
+
done
|
|
100
|
+
|
|
101
|
+
To stop workers
|
|
102
|
+
|
|
103
|
+
python -m wwpdb.apps.val_rel.service.ValidationReleaseServiceHandler --stop
|
|
104
|
+
or
|
|
105
|
+
python -m wwpdb.apps.val_rel.service.ValidationReleaseServiceHandler --stop --instance ${i}
|
|
106
|
+
|
|
107
|
+
### 3) To find missing entries and queue for the following week
|
|
108
|
+
|
|
109
|
+
To find missing entries and write them out to a temporary file
|
|
110
|
+
|
|
111
|
+
python -m wwpdb.apps.val_rel.utils.find_and_run_missing --write_missing
|
|
112
|
+
|
|
113
|
+
then to read the temporary file and load the entries into the missing queue
|
|
114
|
+
|
|
115
|
+
python -m wwpdb.apps.val_rel.utils.find_and_run_missing --read_missing
|
|
116
|
+
|
|
117
|
+
For priority queues, add --priority along with --read_missing.
|
|
118
|
+
|
|
119
|
+
### to run on a single entry without the rabbitMQ queue
|
|
120
|
+
|
|
121
|
+
python -m wwpdb.apps.val_rel.ValidateRelease
|
|
122
|
+
usage options are
|
|
123
|
+
--pdbid - a single pdb id
|
|
124
|
+
--emdbid - a single emdb id
|
|
125
|
+
--output_root - to output to a path of your choice
|
|
126
|
+
|
|
127
|
+
### 4) Publishing and consuming from a priority queue
|
|
128
|
+
|
|
129
|
+
By default, the queues are not priority queues.
|
|
130
|
+
|
|
131
|
+
To make priority queues, pass an argument of --priority to PopulateValidateRelease, ValidationReleaseServiceHandler, and find_and_run_missing.
|
|
132
|
+
|
|
133
|
+
Priority queues cannot write to or read from non-priority queues, and an error is thrown if you attempt to mix them.
|
|
134
|
+
|
|
135
|
+
Therefore, an argument of --priority is always specified for priority queues.
|
|
136
|
+
|
|
137
|
+
The priority values are determined automatically, with higher values having higher priority.
|
|
138
|
+
|
|
139
|
+
- 10 missing
|
|
140
|
+
- 8 new pdb
|
|
141
|
+
- 6 new emdb
|
|
142
|
+
- 4 modified pdb
|
|
143
|
+
- 2 modified emdb
|
|
144
|
+
- 1 default
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### 5) Subscription queues
|
|
148
|
+
|
|
149
|
+
By default, the queues are persistent queues that store messages regardless of the existence of producers or consumers.
|
|
150
|
+
|
|
151
|
+
However, even with priority queues, it's not possible to read a subset of messages with particular attributes, for example only emdb messages.
|
|
152
|
+
|
|
153
|
+
Therefore, subscription queues have been built which, if necessary, enable higher specificity.
|
|
154
|
+
|
|
155
|
+
Subscription queues publish to a larger number of exchanges and then subscribe to exchanges of choice.
|
|
156
|
+
|
|
157
|
+
To make subscription queues, pass an argument of --subscribe to PopulateValidateRelease and ValidationReleaseServiceHandler, followed by an exchange name which should be the same for both.
|
|
158
|
+
|
|
159
|
+
You must invoke the consumer before the producer or else the messages will be lost.
|
|
160
|
+
|
|
161
|
+
A subscription queue is only temporary until the consumer closes, therefore they are not intended to be relied upon exclusively, rather as a supplement to already existing queues.
|
|
162
|
+
|
|
163
|
+
Once the consumer is stopped, the queue and all of its contents will be deleted.
|
|
164
|
+
|
|
165
|
+
Subscription queues may have advantages during service peaks.
|
|
166
|
+
|
|
167
|
+
For example, to relieve congestion in the emdb folder, stop the regular producer crons, then start selective consumers with exchange names 'pdb_production_exchange' and 'emdb_production_exchange', then start corresponding producers with the same exchange names, one with option '--pdb_release' and one with option '--emdb_release'.
|
|
168
|
+
|
|
169
|
+
In the present system, subscription queues must not be run at the same time as the regular queues, at least not with the same options, or else they will both publish/consume the same files.
|
|
170
|
+
|
|
171
|
+
### 6) Debugging
|
|
172
|
+
|
|
173
|
+
ValidationReleaseServiceHandler runs a background process which is difficult to get debugging information from.
|
|
174
|
+
|
|
175
|
+
If errors occur from mixing of priority and non-priority queues, ValidationReleaseServiceHandler will not report them.
|
|
176
|
+
|
|
177
|
+
One possible side effect is that consumers will not stop when attempting to stop them with ValidationReleaseServiceHandler.
|
|
178
|
+
|
|
179
|
+
If consumers will not stop, pass an argument of --list to ValidationReleaseServiceHandler.
|
|
180
|
+
|
|
181
|
+
The running consumer process ids will be listed.
|
|
182
|
+
|
|
183
|
+
If it's possible to detect the processes that are responsible, delete all or some of the running process ids and their associated pid files.
|
|
184
|
+
|
|
185
|
+
The path to the pids file directory is printed out with each invocation of ValidationReleaseServiceHandler.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# py-wwpdb_apps_val_rel
|
|
2
|
+
Service to prepare weekly validation reports
|
|
3
|
+
|
|
4
|
+
## requirements
|
|
5
|
+
In site-config the following must be set
|
|
6
|
+
|
|
7
|
+
VAL_REL_PROTOCOL = determines the protocol to use (ftp, http, https) if local ftp tree is not available.
|
|
8
|
+
VAL_REL_ADMIN_EMAIL = comma separated list of who to contact on failures
|
|
9
|
+
VAL_REL_DISABLE_MULTITHREAD = if set disable validation code from running in parallel fashion
|
|
10
|
+
SITE_PDB_FTP_ROOT_DIR = the root of the PDB FTP tree (before pdb/data) - this can be not set if its not available at the local site
|
|
11
|
+
SITE_EMDB_FTP_ROOT_DIR = the root of the EMDB FTP tree (before emdb/structures) - this can be not set if its not available at the local site
|
|
12
|
+
SITE_FTP_SERVER = this will default to ftp.wwpdb.org if not set
|
|
13
|
+
SITE_FTP_SERVER_PREFIX = this is the prefix in the URL at the FTP server until you get to the PDB or EMDB data - i.e. on ftp.wwpdb.org this is "pub"
|
|
14
|
+
SITE_HTTP_SERVER = this will default to files.wwpdb.org if not set
|
|
15
|
+
SITE_HTTP_SERVER_PREFIX = this is the prefix in the URL at the HTTP server until you get to the PDB or EMDB data - i.e. on files.wwpdb.org this is "pub"
|
|
16
|
+
SITE_RBMQ_SERVER_HOST = this is the host that runs the rabbitMQ server
|
|
17
|
+
|
|
18
|
+
## to setup rabbitMQ
|
|
19
|
+
|
|
20
|
+
See
|
|
21
|
+
|
|
22
|
+
https://github.com/wwPDB/onedep-maintenance/blob/master/pdbe_redhat7/server_scripts/setup_rabbitMQ.sh
|
|
23
|
+
|
|
24
|
+
## usage
|
|
25
|
+
|
|
26
|
+
This process has two parts
|
|
27
|
+
1) finding entries to run validation reports and adding to a rabbitMQ queue
|
|
28
|
+
2) workers which take work from the rabbitMQ queue and create validation reports
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### 1) Finding entries
|
|
33
|
+
|
|
34
|
+
Entries are found by a script which searches the for_release folder
|
|
35
|
+
|
|
36
|
+
python -m wwpdb.apps.val_rel.PopulateValidateRelease
|
|
37
|
+
usage options are
|
|
38
|
+
--pdb_release - find PDB entries in the for_release/{added/modified} folders
|
|
39
|
+
--emdb_release - find EMDB entries in the for_release/emd folder
|
|
40
|
+
--skip_emdb - if only PDB entry reports with no visual analysis is required.
|
|
41
|
+
--entry_list - comma separated list of entries
|
|
42
|
+
--entry_file - file containing entries, one per line
|
|
43
|
+
--output_root - to output to a path of your choice
|
|
44
|
+
--help for other options
|
|
45
|
+
|
|
46
|
+
This should be run on a cron every few hours.
|
|
47
|
+
|
|
48
|
+
If a priority queue is required, add the option --priority.
|
|
49
|
+
|
|
50
|
+
### 2) validation report workers
|
|
51
|
+
|
|
52
|
+
workers pick up work from the rabbitMQ queue and generate validation reports.
|
|
53
|
+
To start one worker
|
|
54
|
+
|
|
55
|
+
python -m wwpdb.apps.val_rel.service.ValidationReleaseServiceHandler --start
|
|
56
|
+
|
|
57
|
+
To read from a priority queue, add the option --priority.
|
|
58
|
+
|
|
59
|
+
To start several workers - below example starts 50 workers
|
|
60
|
+
|
|
61
|
+
for i in {1..50}
|
|
62
|
+
do
|
|
63
|
+
echo ${i}
|
|
64
|
+
python -m wwpdb.apps.val_rel.service.ValidationReleaseServiceHandler --start --instance ${i}
|
|
65
|
+
done
|
|
66
|
+
|
|
67
|
+
To stop workers
|
|
68
|
+
|
|
69
|
+
python -m wwpdb.apps.val_rel.service.ValidationReleaseServiceHandler --stop
|
|
70
|
+
or
|
|
71
|
+
python -m wwpdb.apps.val_rel.service.ValidationReleaseServiceHandler --stop --instance ${i}
|
|
72
|
+
|
|
73
|
+
### 3) To find missing entries and queue for the following week
|
|
74
|
+
|
|
75
|
+
To find missing entries and write them out to a temporary file
|
|
76
|
+
|
|
77
|
+
python -m wwpdb.apps.val_rel.utils.find_and_run_missing --write_missing
|
|
78
|
+
|
|
79
|
+
then to read the temporary file and load the entries into the missing queue
|
|
80
|
+
|
|
81
|
+
python -m wwpdb.apps.val_rel.utils.find_and_run_missing --read_missing
|
|
82
|
+
|
|
83
|
+
For priority queues, add --priority along with --read_missing.
|
|
84
|
+
|
|
85
|
+
### to run on a single entry without the rabbitMQ queue
|
|
86
|
+
|
|
87
|
+
python -m wwpdb.apps.val_rel.ValidateRelease
|
|
88
|
+
usage options are
|
|
89
|
+
--pdbid - a single pdb id
|
|
90
|
+
--emdbid - a single emdb id
|
|
91
|
+
--output_root - to output to a path of your choice
|
|
92
|
+
|
|
93
|
+
### 4) Publishing and consuming from a priority queue
|
|
94
|
+
|
|
95
|
+
By default, the queues are not priority queues.
|
|
96
|
+
|
|
97
|
+
To make priority queues, pass an argument of --priority to PopulateValidateRelease, ValidationReleaseServiceHandler, and find_and_run_missing.
|
|
98
|
+
|
|
99
|
+
Priority queues cannot write to or read from non-priority queues, and an error is thrown if you attempt to mix them.
|
|
100
|
+
|
|
101
|
+
Therefore, an argument of --priority is always specified for priority queues.
|
|
102
|
+
|
|
103
|
+
The priority values are determined automatically, with higher values having higher priority.
|
|
104
|
+
|
|
105
|
+
- 10 missing
|
|
106
|
+
- 8 new pdb
|
|
107
|
+
- 6 new emdb
|
|
108
|
+
- 4 modified pdb
|
|
109
|
+
- 2 modified emdb
|
|
110
|
+
- 1 default
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
### 5) Subscription queues
|
|
114
|
+
|
|
115
|
+
By default, the queues are persistent queues that store messages regardless of the existence of producers or consumers.
|
|
116
|
+
|
|
117
|
+
However, even with priority queues, it's not possible to read a subset of messages with particular attributes, for example only emdb messages.
|
|
118
|
+
|
|
119
|
+
Therefore, subscription queues have been built which, if necessary, enable higher specificity.
|
|
120
|
+
|
|
121
|
+
Subscription queues publish to a larger number of exchanges and then subscribe to exchanges of choice.
|
|
122
|
+
|
|
123
|
+
To make subscription queues, pass an argument of --subscribe to PopulateValidateRelease and ValidationReleaseServiceHandler, followed by an exchange name which should be the same for both.
|
|
124
|
+
|
|
125
|
+
You must invoke the consumer before the producer or else the messages will be lost.
|
|
126
|
+
|
|
127
|
+
A subscription queue is only temporary until the consumer closes, therefore they are not intended to be relied upon exclusively, rather as a supplement to already existing queues.
|
|
128
|
+
|
|
129
|
+
Once the consumer is stopped, the queue and all of its contents will be deleted.
|
|
130
|
+
|
|
131
|
+
Subscription queues may have advantages during service peaks.
|
|
132
|
+
|
|
133
|
+
For example, to relieve congestion in the emdb folder, stop the regular producer crons, then start selective consumers with exchange names 'pdb_production_exchange' and 'emdb_production_exchange', then start corresponding producers with the same exchange names, one with option '--pdb_release' and one with option '--emdb_release'.
|
|
134
|
+
|
|
135
|
+
In the present system, subscription queues must not be run at the same time as the regular queues, at least not with the same options, or else they will both publish/consume the same files.
|
|
136
|
+
|
|
137
|
+
### 6) Debugging
|
|
138
|
+
|
|
139
|
+
ValidationReleaseServiceHandler runs a background process which is difficult to get debugging information from.
|
|
140
|
+
|
|
141
|
+
If errors occur from mixing of priority and non-priority queues, ValidationReleaseServiceHandler will not report them.
|
|
142
|
+
|
|
143
|
+
One possible side effect is that consumers will not stop when attempting to stop them with ValidationReleaseServiceHandler.
|
|
144
|
+
|
|
145
|
+
If consumers will not stop, pass an argument of --list to ValidationReleaseServiceHandler.
|
|
146
|
+
|
|
147
|
+
The running consumer process ids will be listed.
|
|
148
|
+
|
|
149
|
+
If it's possible to detect the processes that are responsible, delete all or some of the running process ids and their associated pid files.
|
|
150
|
+
|
|
151
|
+
The path to the pids file directory is printed out with each invocation of ValidationReleaseServiceHandler.
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "wwpdb.apps.val-rel"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "wwPDB validation processing for weekly release"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "Ezra Peisach", email = "ezra.peisach@rcsb.org" },
|
|
13
|
+
]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: Apache Software License",
|
|
18
|
+
"Natural Language :: English",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.8",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"filelock",
|
|
24
|
+
"mmcif",
|
|
25
|
+
"oslo_concurrency",
|
|
26
|
+
"requests",
|
|
27
|
+
"urllib3",
|
|
28
|
+
"wwpdb.apps.validation ~= 2.49",
|
|
29
|
+
"wwpdb.io >=0.15, < 2.0",
|
|
30
|
+
"wwpdb.utils.config >= 0.24",
|
|
31
|
+
"wwpdb.utils.detach",
|
|
32
|
+
"wwpdb.utils.dp",
|
|
33
|
+
"wwpdb.utils.message_queue ~= 0.6",
|
|
34
|
+
"wwpdb.utils.nmr",
|
|
35
|
+
"wwpdb.utils.session",
|
|
36
|
+
"wwpdb.utils.ws_utils",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
requires-python = ">=3.8"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
[project.optional-dependencies]
|
|
43
|
+
dev = [
|
|
44
|
+
"check-manifest",
|
|
45
|
+
]
|
|
46
|
+
test = [
|
|
47
|
+
"coverage",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[project.urls]
|
|
51
|
+
Homepage = "https://github.com/wwpdb/py-wwpdb_apps_val_rel"
|
|
52
|
+
|
|
53
|
+
[tool.hatch.version]
|
|
54
|
+
path = "wwpdb/apps/val_rel/__init__.py"
|
|
55
|
+
|
|
56
|
+
[tool.hatch.build.targets.sdist]
|
|
57
|
+
include = [
|
|
58
|
+
"/wwpdb",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[tool.hatch.build.targets.wheel]
|
|
62
|
+
packages = ["wwpdb"]
|
|
63
|
+
|
|
64
|
+
#=================================== Ruff basics =============================#
|
|
65
|
+
[tool.ruff]
|
|
66
|
+
target-version = "py38"
|
|
67
|
+
output-format = "concise"
|
|
68
|
+
|
|
69
|
+
line-length = 120 # 120 is hatch's default via 'hatch init'
|
|
70
|
+
include = [
|
|
71
|
+
"*.py", # Source
|
|
72
|
+
"pyproject.toml", # This file (RUF rules only)
|
|
73
|
+
"*.ipynb", # Jupyter notebooks
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
#
|
|
77
|
+
#=================================== Ruff lint ==============================#
|
|
78
|
+
|
|
79
|
+
[tool.ruff.lint]
|
|
80
|
+
|
|
81
|
+
#
|
|
82
|
+
# ------------------------- Ruff misc. options ----------------------
|
|
83
|
+
preview = false
|
|
84
|
+
explicit-preview-rules = true
|
|
85
|
+
|
|
86
|
+
ignore = [
|
|
87
|
+
"C402", # Unnecessary generator (rewrite as a `dict` comprehension)
|
|
88
|
+
"EXE001", # Shebang is present but file is not executabl
|
|
89
|
+
"FA100", # Add `from __future__ import annotations` to simplify `typing.Optional`
|
|
90
|
+
"FBT002", # Boolean default positional argument in function definition
|
|
91
|
+
"FBT001", # Boolean-typed positional argument in function definition
|
|
92
|
+
"FURB113", # Use `stPL.extend(...)` instead of repeatedly calling `stPL.append()`
|
|
93
|
+
"INP001", # File `xx` is part of an implicit namespace package. Add an `__init__.py
|
|
94
|
+
"N801", # Class name `markdownTests` should use CapWords convention
|
|
95
|
+
"N802", # Function name should be lowercase
|
|
96
|
+
"N803", # Argument name should be lowercase
|
|
97
|
+
"N806", # in function should be lowercase
|
|
98
|
+
"N815", # Caiable... in class shope should not be mixedCase
|
|
99
|
+
"N816", # Variable in global scope should not be mixedCase
|
|
100
|
+
"N999", # Invalid module name,
|
|
101
|
+
"PERF401", # Use a list comprehension to create a transformed list
|
|
102
|
+
"PERF403", # Use a dictionary comprehension instead of a for-loop
|
|
103
|
+
"PLR1714", # Consider merging multiple comparisons
|
|
104
|
+
"PLR2004", # Magic value used in comparison, consider replacing
|
|
105
|
+
"PLR6201", # Use a `set` literal when testing for membership
|
|
106
|
+
"PLR6301", # Method `` could be a function, class method, or static method
|
|
107
|
+
"PLW1514", # `open` in text mode without explicit `encoding` argument
|
|
108
|
+
"PT009", # Use a regular `assert` instead of unittest-style `assertGreater`
|
|
109
|
+
"RET504", # Unnecessary assignment to `X` before `return` statement
|
|
110
|
+
"PT027", # Use `pytest.raises` instead of unittest-style `assertRaises`
|
|
111
|
+
"RUF100", # RUF REMOVES FLAKE8 noqa!
|
|
112
|
+
"S110", # `try`-`except`-`pass` detected, consider logging the exception
|
|
113
|
+
"SIM102", # Use a single `if` statement instead of nested `if` statements
|
|
114
|
+
"SIM103", # Return the condition directly
|
|
115
|
+
"SIM108", # Use ternary operator
|
|
116
|
+
"SIM115", # Use context handler for opening files
|
|
117
|
+
"TRY300", # Consider moving this statement to an `else` block
|
|
118
|
+
"TRY400", # Use `logging.exception` instead of `logging.error`
|
|
119
|
+
"TRY401", # Redundant exception object included in `logging.exception` call
|
|
120
|
+
"UP008", # Use `super()` instead of `super(__class__, self)`
|
|
121
|
+
"UP031", # Use format specifiers instead of percent format
|
|
122
|
+
"UP036" # Version block is outdated for minimum Python version
|
|
123
|
+
]
|
|
124
|
+
|
|
125
|
+
# -------------------- default environment scripts ------------------
|
|
126
|
+
[tool.hatch.envs.default]
|
|
127
|
+
skip-install = true
|
|
128
|
+
dependencies = ["mypy", "ruff >=0.6.9", "wwpdb.utils.config", "wwpdb.utils.message_queue", "wwpdb.io", "wwpdb.utils.dp", "wwpdb.utils.session", "wwpdb.utils.detach"]
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
[tool.hatch.envs.default.scripts]
|
|
132
|
+
|
|
133
|
+
# 'format' formats and fixes issues but does not complain
|
|
134
|
+
format = [
|
|
135
|
+
"ruff format",
|
|
136
|
+
"ruff check --fix-only",
|
|
137
|
+
]
|
|
138
|
+
|
|
139
|
+
# 'format-python' just excludes Prettier
|
|
140
|
+
format-python = ["ruff format", "ruff check --fix-only"]
|
|
141
|
+
|
|
142
|
+
# 'check' only checks but never fixes
|
|
143
|
+
check = ["ruff check --no-fix .", "mypy --non-interactive --install-types -p wwpdb -p tests --strict"]
|
|
144
|
+
|
|
145
|
+
# only checks with ruff (mypy has a lot of false positives)
|
|
146
|
+
check-ruff = "ruff check --no-fix . {args}"
|
|
147
|
+
|
|
148
|
+
# to complement 'check-ruff'
|
|
149
|
+
check-mypy = "mypy --non-interactive --install-types -p wwpdb -p tests {args}"
|
|
150
|
+
|
|
151
|
+
# only check security via Bandit; we require these rules to pass
|
|
152
|
+
check-security = "ruff check --select S --no-fix ."
|
|
153
|
+
|
|
154
|
+
# ----------------------- testing environment ----------------
|
|
155
|
+
[tool.hatch.envs.hatch-test]
|
|
156
|
+
dependencies = ["tox"]
|
|
157
|
+
|
|
158
|
+
[tool.hatch.envs.hatch-test.scripts]
|
|
159
|
+
run = ["tox"]
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
# ------------------------- Mypy disable ---------
|
|
163
|
+
[[tool.mypy.overrides]]
|
|
164
|
+
module = ["oslo_concurrency.*", "wwpdb.io.*", "mmcif.*", "wwpdb.utils.ws_utils.*", "wwpdb.utils.dp.*", "wwpdb.apps.validation.*", "wwpdb.utils.detach.*","wwpdb.utils.message_queue.*", "wwpdb.utils.session.*", "filelock"]
|
|
165
|
+
ignore_missing_imports = true
|
|
166
|
+
|
|
167
|
+
[tool.mypy]
|
|
168
|
+
exclude = [
|
|
169
|
+
"test-output",
|
|
170
|
+
]
|
|
171
|
+
|
|
172
|
+
# ------------------------ ruff disable until typing added
|
|
173
|
+
[tool.ruff.lint.per-file-ignores]
|
|
174
|
+
"wwpdb/apps/val_rel/utils/check_results.py" = ["T201", "T203"] # Command line script
|
|
175
|
+
"tests/test_get_files_release_ftp_emdb.py" = ["T201"]
|