diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1a3a580631..84005045a0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,7 +16,7 @@ Added to pants' use of PEX lockfiles. This is not a user-facing addition. #5778 #5789 #5817 #5795 #5830 #5833 #5834 #5841 #5840 #5838 #5842 #5837 #5849 #5850 #5846 #5853 #5848 #5847 #5858 #5857 #5860 #5868 #5871 #5864 #5874 #5884 #5893 #5891 - #5890 #5898 #5901 #5906 #5899 #5907 + #5890 #5898 #5901 #5906 #5899 #5907 #5909 Contributed by @cognifloyd * Added a joint index to solve the problem of slow mongo queries for scheduled executions. #5805 diff --git a/pants-plugins/macros.py b/pants-plugins/macros.py index 79fad0091b..b7d2367022 100644 --- a/pants-plugins/macros.py +++ b/pants-plugins/macros.py @@ -84,6 +84,8 @@ def st2_component_python_distribution(**kwargs): description = ( f"{st2_component} StackStorm event-driven automation platform component" ) + # setup(scripts=[...]) is for pre-made scripts, which we have. + # TODO: use entry_points.console_scripts instead of hand-generating these. scripts = kwargs.pop("scripts", []) st2_license(dest=st2_component) diff --git a/st2actions/BUILD b/st2actions/BUILD new file mode 100644 index 0000000000..676079ffb0 --- /dev/null +++ b/st2actions/BUILD @@ -0,0 +1,10 @@ +st2_component_python_distribution( + component_name="st2actions", + scripts=[ + "bin/st2actionrunner", + "bin/st2notifier", + "bin/st2workflowengine", + "bin/st2scheduler", + "bin/runners.sh:shell", # used by service files installed by st2-packaging + ], +) diff --git a/st2api/BUILD b/st2api/BUILD new file mode 100644 index 0000000000..6516f44920 --- /dev/null +++ b/st2api/BUILD @@ -0,0 +1,4 @@ +st2_component_python_distribution( + component_name="st2api", + scripts=["bin/st2api"], +) diff --git a/st2auth/BUILD b/st2auth/BUILD new file mode 100644 index 0000000000..1e1d641374 --- /dev/null +++ b/st2auth/BUILD @@ -0,0 +1,9 @@ +st2_component_python_distribution( + component_name="st2auth", + scripts=["bin/st2auth"], + entry_points={ + stevedore_namespace("st2auth.sso.backends"): { + "noop": "st2auth.sso.noop:NoOpSingleSignOnBackend", + }, + }, +) diff --git a/st2client/BUILD b/st2client/BUILD new file mode 100644 index 0000000000..96c25c45c2 --- /dev/null +++ b/st2client/BUILD @@ -0,0 +1,8 @@ +st2_component_python_distribution( + component_name="st2client", + entry_points={ + "console_scripts": { + "st2": "st2client.shell:main", + }, + }, +) diff --git a/st2common/BUILD b/st2common/BUILD new file mode 100644 index 0000000000..75e35c9fc5 --- /dev/null +++ b/st2common/BUILD @@ -0,0 +1,39 @@ +st2_component_python_distribution( + component_name="st2common", + scripts=[ + # some scripts in bin are only for development and should not be included. + "bin/st2-bootstrap-rmq", + "bin/st2-cleanup-db", + "bin/st2-register-content", + "bin/st2-purge-executions", + "bin/st2-purge-workflows", + "bin/st2-purge-task-executions", + "bin/st2-purge-tokens", + "bin/st2-purge-trigger-instances", + "bin/st2-purge-traces", + "bin/st2-purge-rule-enforcements", + "bin/st2-generate-symmetric-crypto-key", + "bin/st2-track-result", + "bin/st2-validate-pack", + "bin/st2-validate-pack-config", + "bin/st2-pack-install", + "bin/st2-pack-download", + "bin/st2-pack-setup-virtualenv", + "bin/migrations/v3.5/st2-migrate-db-dict-field-values", + "bin/st2-run-pack-tests:shell", + "bin/st2ctl:shell", + "bin/st2-self-check:shell", + # dev scripts we might want to include + # "bin/st2-generate-schemas", + ], + entry_points={ + stevedore_namespace("st2common.metrics.driver"): { + "statsd": "st2common.metrics.drivers.statsd_driver:StatsdDriver", + "noop": "st2common.metrics.drivers.noop_driver:NoopDriver", + "echo": "st2common.metrics.drivers.echo_driver:EchoDriver", + }, + stevedore_namespace("st2common.rbac.backend"): { + "noop": "st2common.rbac.backends.noop:NoOpRBACBackend", + }, + }, +) diff --git a/st2common/bin/st2-purge-task-executions b/st2common/bin/st2-purge-task-executions old mode 100644 new mode 100755 diff --git a/st2common/bin/st2-purge-workflows b/st2common/bin/st2-purge-workflows old mode 100644 new mode 100755 diff --git a/st2reactor/BUILD b/st2reactor/BUILD new file mode 100644 index 0000000000..ba8bf89a93 --- /dev/null +++ b/st2reactor/BUILD @@ -0,0 +1,11 @@ +st2_component_python_distribution( + component_name="st2reactor", + scripts=[ + "bin/st2-rule-tester", + "bin/st2-trigger-refire", + "bin/st2rulesengine", + "bin/st2sensorcontainer", + "bin/st2garbagecollector", + "bin/st2timersengine", + ], +) diff --git a/st2stream/BUILD b/st2stream/BUILD new file mode 100644 index 0000000000..233bb07a2b --- /dev/null +++ b/st2stream/BUILD @@ -0,0 +1,4 @@ +st2_component_python_distribution( + component_name="st2stream", + scripts=["bin/st2stream"], +) diff --git a/st2tests/BUILD b/st2tests/BUILD new file mode 100644 index 0000000000..a6188b03a9 --- /dev/null +++ b/st2tests/BUILD @@ -0,0 +1,3 @@ +st2_component_python_distribution( + component_name="st2tests", +)