Skip to content

Commit 1a0d028

Browse files
authored
Merge pull request #5925: Pants: add dependencies to the st2common python_distribution
2 parents a43c70b + 2fa16d8 commit 1a0d028

File tree

6 files changed

+90
-6
lines changed

6 files changed

+90
-6
lines changed

CHANGELOG.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Added
1616
to pants' use of PEX lockfiles. This is not a user-facing addition.
1717
#5778 #5789 #5817 #5795 #5830 #5833 #5834 #5841 #5840 #5838 #5842 #5837 #5849 #5850
1818
#5846 #5853 #5848 #5847 #5858 #5857 #5860 #5868 #5871 #5864 #5874 #5884 #5893 #5891
19-
#5890 #5898 #5901 #5906 #5899 #5907 #5909 #5922 #5926 #5927
19+
#5890 #5898 #5901 #5906 #5899 #5907 #5909 #5922 #5926 #5927 #5925
2020
Contributed by @cognifloyd
2121

2222
* Added a joint index to solve the problem of slow mongo queries for scheduled executions. #5805

st2common/BUILD

+64
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ st2_component_python_distribution(
2020
"bin/st2-pack-download",
2121
"bin/st2-pack-setup-virtualenv",
2222
"bin/migrations/v3.5/st2-migrate-db-dict-field-values",
23+
"bin/migrations/v3.8/st2-drop-st2exporter-marker-collections",
2324
"bin/st2-run-pack-tests:shell",
2425
"bin/st2ctl:shell",
2526
"bin/st2-self-check:shell",
@@ -36,4 +37,67 @@ st2_component_python_distribution(
3637
"noop": "st2common.rbac.backends.noop:NoOpRBACBackend",
3738
},
3839
},
40+
dependencies=[
41+
# no entry-point or script yet
42+
"./st2common/garbage_collection/inquiries.py", # missing cmd + ./bin/st2-purge-inquiries
43+
#
44+
# Things that need to be included as part of the st2common library's API:
45+
#
46+
# ### Public API ###
47+
#
48+
"./st2common/logging", # used by all of our logging conf files
49+
"./st2common/models/system", # used by runners
50+
"./st2common/policies", # used by policies (see st2actions.policies)
51+
"./st2common/runners", # used by runners and python actions
52+
#
53+
# ### Mixed Public+Internal API ###
54+
#
55+
"./st2common/services", # used by runners, python actions, st2api, ...
56+
#
57+
# ### Internal API ###
58+
#
59+
"./st2common/constants/garbage_collection.py", # used by garbage collector
60+
"./st2common/constants/policy.py", # used by st2scheduler (in st2actions)
61+
"./st2common/constants/timer.py", # used by st2timersengine (in st2reactor)
62+
"./st2common/middleware", # used by st2auth, st2api, st2stream
63+
"./st2common/models/api", # used by st2auth, st2api, st2stream
64+
"./st2common/models/system", # used by st2auth, st2api, st2stream
65+
"./st2common/models/db/timer.py", # used by st2api
66+
"./st2common/models/db/webhook.py", # used by st2api
67+
"./st2common/persistence/execution_queue.py", # used by st2scheduler (in st2actions)
68+
"./st2common/stream", # used by st2stream
69+
"./st2common/transport/consumers.py", # used by st2actions- and st2reactor-related services
70+
"./st2common/util/actionalias_helpstring.py", # used by st2api
71+
"./st2common/util/auth.py", # used by st2api, st2auth
72+
"./st2common/util/keyvalue.py", # used by st2api
73+
"./st2common/util/sandboxing.py", # used by python runner and sensor container
74+
"./st2common/util/service.py", # used by st2scheduler (in st2actions)
75+
"./st2common/util/wsgi.py", # used by st2stream
76+
"./st2common/validators/api/misc.py", # used by st2api
77+
#
78+
# ### Dead Code (?) ###
79+
#
80+
# Added gunicorn bug workaround for SyncWorker users in #2571. No known active users. To use:
81+
# `gunicorn -k st2common.util.gunicorn_workers.EventletSyncWorker ...`
82+
# "./st2common/util/gunicorn_workers.py",
83+
#
84+
# Known dead code that should be deleted. Do not add these:
85+
# ./st2common/callback/* (was for the old mistral_v2 runner. see #4038)
86+
# ./st2common/constants/scheduler.py (unused since #4397)
87+
# ./st2common/content/validators.py (unused since #939)
88+
# ./st2common/exceptions/api.py (unused since #1840)
89+
# ./st2common/exceptions/connection.py (unused since #1794)
90+
# ./st2common/exceptions/resultstracker.py (unused since #5011)
91+
# ./st2common/models/api/actionrunner.py (unused since #442)
92+
# ./st2common/models/db/reactor.py (unused since #5922)
93+
# ./st2common/persistence/reactor.py (unused since #5922)
94+
# ./st2common/util/argument_parser.py (never used since added in e9ae7e31e1eb47e49f0fdc414ed6d2b8eccf4748)
95+
# ./st2common/validators/workflow (unused since #5011)
96+
],
97+
# commands helpful in inspecting the dependencies (the "=(...)" is zsh syntax)
98+
# python files under st2common that will not be included in the wheel
99+
# comm -13 =(./pants dependencies --transitive st2common:st2common | grep -v -e : -e __init__.py | grep st2common/st2common | sort) =(find st2common/st2common -name '*.py' -and -not -name '__init__.py' | sort)
100+
#
101+
# python files required by other wheels that are missing from st2common
102+
# comm -13 =(./pants dependencies --transitive st2common:st2common | grep st2common/st2common | sort) =(./pants list --filter-target-type=python_distribution --filter-address-regex=-st2common:st2common :: | xargs ./pants dependencies --transitive | grep st2common/st2common | sort)
39103
)

st2common/bin/BUILD

+18
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,22 @@ st2_shell_sources_and_resources(
99
name="shell",
1010
sources=["st2ctl", "st2-self-check", "st2-run-pack-tests"],
1111
skip_shellcheck=True,
12+
overrides={
13+
"st2ctl": {
14+
"dependencies": [
15+
"./st2-register-content",
16+
"./st2-cleanup-db",
17+
],
18+
},
19+
"st2-self-check": {
20+
"dependencies": [
21+
"./st2ctl:shell",
22+
# TODO: dep on st2client cli?
23+
],
24+
},
25+
# st2-run-pack-tests creates its own virtualenv on the fly and
26+
# installs its dependencies, so they don't need to be listed here.
27+
# It can optionally use the deps installed with st2tests package.
28+
# "st2-run-pack-tests": {},
29+
},
1230
)

st2common/bin/migrations/v3.5/BUILD

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# TODO: what to do about st2-migrate-db-dict-field-values ?
22
# st2_migrate_db_dict_field_values.py is a symlink to st2-migrate-db-dict-field-values
3-
python_sources()
3+
python_sources(
4+
sources=["*.py", "st2*"],
5+
)

st2common/bin/migrations/v3.8/BUILD

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
python_sources(
2+
sources=["st2*"],
3+
)

st2common/bin/migrations/v3.8/st2-drop-st2exporter-marker-collections

100644100755
+1-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ and the collections were not configured to be created automatically.
2424
import sys
2525
import traceback
2626

27-
import mongoengine as me
28-
2927
from mongoengine.connection import get_db
30-
from oslo_config import cfg
3128

3229
from st2common import config
3330
from st2common.service_setup import db_setup
@@ -56,7 +53,7 @@ def main():
5653
db_setup()
5754

5855
try:
59-
delete_marker_collections(display_prompt=not cfg.CONF.yes)
56+
delete_marker_collections()
6057
exit_code = 0
6158
except Exception as e:
6259
print("ABORTED: Collection deletion aborted on first failure: %s" % (str(e)))

0 commit comments

Comments
 (0)