@@ -17,11 +17,10 @@ Added
1717
1818 Contributed by @anirudhbagri.
1919
20- Fixed
21- ~~~~~
20+ * Various additional metrics have been added to the action runner service to provide for better
21+ operational visibility. (improvement) #4846
2222
23- * Refactor spec_loader util to use yaml.load with SafeLoader. (security)
24- Contributed by @ashwini-orchestral
23+ Contributed by @Kami.
2524
2625Changed
2726~~~~~~~
@@ -37,12 +36,142 @@ Changed
3736
3837 Contributed by @Kami and @shital.
3938
39+ * Add new ``-x `` argument to the ``st2 execution get `` command which allows
40+ ``result `` field to be excluded from the output. (improvement) #4846
41+
42+ * Update ``st2 execution get <id> `` command to also display execution ``log `` attribute which
43+ includes execution state transition information.
44+
45+ By default ``end_timestamp `` attribute and ``duration `` attribute displayed in the command
46+ output only include the time it took action runner to finish running actual action, but it
47+ doesn't include the time it it takes action runner container to fully finish running the
48+ execution - this includes persisting execution result in the database.
49+
50+ For actions which return large results, there could be a substantial discrepancy - e.g.
51+ action itself could finish in 0.5 seconds, but writing data to the database could take
52+ additional 5 seconds after the action code itself was executed.
53+
54+ For all purposes until the execution result is persisted to the database, execution is
55+ not considered as finished.
56+
57+ While writing result to the database action runner is also consuming CPU cycles since
58+ serialization of large results is a CPU intensive task.
59+
60+ This means that "elapsed" attribute and start_timestamp + end_timestamp will make it look
61+ like actual action completed in 0.5 seconds, but in reality it took 5.5 seconds (0.5 + 5 seconds).
62+
63+ Log attribute can be used to determine actual duration of the execution (from start to
64+ finish). (improvement) #4846
65+
66+ Contributed by @Kami.
67+
68+ * Various internal improvements (reducing number of DB queries, speeding up YAML parsing, using
69+ DB object cache, etc.) which should speed up pack action registration between 15-30%. This is
70+ especially pronounced with packs which have a lot of actions (e.g. aws one).
71+ (improvement) #4846
72+
73+ Contributed by @Kami.
74+
75+ * Underlying database field type and storage format for the ``Execution ``, ``LiveAction ``,
76+ ``WorkflowExecutionDB ``, ``TaskExecutionDB `` and ``TriggerInstanceDB `` database models has
77+ changed.
78+
79+ This new format is much faster and efficient than the previous one. Users with larger executions
80+ (executions with larger results) should see the biggest improvements, but the change also scales
81+ down so there should also be improvements when reading and writing executions with small and
82+ medium sized results.
83+
84+ Our micro and end to benchmarks have shown improvements up to 15-20x for write path (storing
85+ model in the database) and up to 10x for the read path.
86+
87+ To put things into perspective - with previous version, running a Python runner action which
88+ returns 8 MB result would take around ~18 seconds total, but with this new storage format, it
89+ takes around 2 seconds (in this context, duration means the from the time the execution was
90+ scheduled to the time the execution model and result was written and available in the database).
91+
92+ The difference is even larger when working with Orquesta workflows.
93+
94+ Overall performance improvement doesn't just mean large decrease in those operation timings, but
95+ also large overall reduction of CPU usage - previously serializing large results was a CPU
96+ intensive time since it included tons of conversions and transformations back and forth.
97+
98+ The new format is also around 10-20% more storage efficient which means that it should allows
99+ for larger model values (MongoDB document size limit is 16 MB).
100+
101+ The actual change should be fully opaque and transparent to the end users - it's purely a
102+ field storage implementation detail and the code takes care of automatically handling both
103+ formats when working with those object.
104+
105+ Same field data storage optimizations have also been applied to workflow related database models
106+ which should result in the same performance improvements for Orquesta workflows which pass larger
107+ data sets / execution results around.
108+
109+ Trigger instance payload field has also been updated to use this new field type which should
110+ result in lower CPU utilization and better throughput of rules engine service when working with
111+ triggers with larger payloads.
112+
113+ This should address a long standing issue where StackStorm was reported to be slow and CPU
114+ inefficient with handling large executions. (improvement) #4846
115+
116+ Contributed by @Kami.
117+
118+ * Add new ``result_size `` field to the ``ActionExecutionDB `` model. This field will only be
119+ populated for executions which utilize new field storage format.
120+
121+ It holds the size of serialzed execution result field in bytes. This field will allow us to
122+ implement more efficient execution result retrieval and provide better UX since we will be
123+ able to avoid loading execution results in the WebUI for executions with very large results
124+ (which cause browser to freeze). (improvement) #4846
125+
126+ Contributed by @Kami.
127+
128+ * Add new ``/v1/executions/<id>/result[?download=1&compress=1&pretty_format=1] `` API endpoint
129+ which can be used used to retrieve or download raw execution result as (compressed) JSON file.
130+
131+ This endpoint will primarily be used by st2web when executions produce very large results so
132+ we can avoid loading, parsing and formatting those very large results as JSON in the browser
133+ which freezes the browser window / tab. (improvement) #4846
134+
135+ Contributed by @Kami.
136+
137+ Improvements
138+ ~~~~~~~~~~~~
139+
140+ * CLI has been updated to use or ``orjson `` when parsing API response and C version of the YAML
141+ safe dumper when formatting execution result for display. This should result in speed up when
142+ displaying execution result (``st2 execution get ``, etc.) for executions with large results.
143+
144+ When testing it locally, the difference for execution with 8 MB result was 18 seconds vs ~6
145+ seconds. (improvement) #4846
146+
147+ Contributed by @Kami.
148+
149+ * Update various Jinja functiona to utilize C version of YAML ``safe_{load,dump} `` functions and
150+ orjson for better performance. (improvement) #4846
151+
152+ Contributed by @Kami.
153+
154+ * For performance reasons, use ``udatetime `` library for parsing ISO8601 / RFC3339 date strings
155+ where possible. (improvement) #4846
156+
157+ Contributed by @Kami.
158+
159+ Fixed
160+ ~~~~~
161+
162+ * Refactor spec_loader util to use yaml.load with SafeLoader. (security)
163+ Contributed by @ashwini-orchestral
164+
40165* Import ABC from collections.abc for Python 3.10 compatibility. (#5007)
41166 Contributed by @tirkarthi
42167
43168* Updated to use virtualenv 20.4.0/PIP20.3.3 and fixate-requirements to work with PIP 20.3.3 #512
44169 Contributed by Amanda McGuinness (@amanda11 Ammeon Solutions)
45170
171+ * Fix ``st2 execution get --with-schema `` flag. (bug fix) #4846
172+
173+ Contributed by @Kami.
174+
461753.4.0 - March 02, 2021
47176----------------------
48177
60189* Added st2-auth-ldap pip requirements for LDAP auth integartion. (new feature) #5082
61190 Contributed by @hnanchahal
62191
63- * Added --register-recreate-virtualenvs flag to st2ctl reload to recreate virtualenvs from scratch.
64- (part of upgrade instructions) [#5167]
192+ * Added --register-recreate-virtualenvs flag to st2ctl reload to recreate virtualenvs from
193+ scratch. (part of upgrade instructions) #5167
194+
65195 Contributed by @winem and @blag
66196
67197Changed
@@ -186,6 +316,7 @@ Added
186316
187317Changed
188318~~~~~~~
319+
189320* Switch to MongoDB ``4.0 `` as the default version starting with all supported OS's in st2
190321 ``v3.3.0 `` (improvement) #4972
191322
@@ -208,6 +339,7 @@ Changed
208339
209340Fixed
210341~~~~~
342+
211343* Fixed a bug where `type ` attribute was missing for netstat action in linux pack. Fixes #4946
212344
213345 Reported by @scguoi and contributed by Sheshagiri (@sheshagiri)
0 commit comments