{"id":352310,"date":"2024-05-20T22:06:16","date_gmt":"2024-05-20T22:06:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=352310"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=352310","title":{"rendered":"<span>\u041a\u0430\u043a \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0437\u0430\u0434\u0430\u0447 \u0432 Jenkins \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 parallel: \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c6b\/588\/67b\/c6b58867b7f873bea21628026bb8e6e1.png\" alt=\"\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 2 \u043f\u043e\u0442\u043e\u043a\u0430\" title=\"\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 2 \u043f\u043e\u0442\u043e\u043a\u0430\" width=\"3599\" height=\"582\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c6b\/588\/67b\/c6b58867b7f873bea21628026bb8e6e1.png\"\/><\/p>\n<div><figcaption><em>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 2 \u043f\u043e\u0442\u043e\u043a\u0430<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u043e \u043c\u043d\u043e\u0439 \u0432\u0441\u0442\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0435\u0441\u0442\u044c 250 \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0442 5 \u0434\u043e 30 \u043c\u0438\u043d\u0443\u0442, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438 \u0447\u0430\u0441\u044b. \u041d\u0430\u0434\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0445 \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 16 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043b\u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u044f\u0434\u0435\u0440 CPU. \u0420\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0439\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u0443\u0442\u0435\u043c \u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u044f \u0438\u043b\u0438 \u043b\u044d\u0439\u0431\u043b \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Lockable Resource \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<p>\u0412 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044f \u043f\u0440\u043e\u0448\u0435\u0440\u0441\u0442\u0438\u043b \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438 \u043d\u0430\u0448\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043d\u043e\u2026 \u041e\u043d\u0438 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u043c\u043d\u0435 \u043f\u043b\u043e\u0445\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\u043b\u0438 \u043d\u0435\u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430. \u0418 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0442\u043e\u0447\u043d\u0435\u0435, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u041d\u0438\u0436\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043c\u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u0445, \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0448\u0443 \u043c\u0438\u043d\u0443\u0441\u044b \u0438 \u043f\u043b\u044e\u0441\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e, \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u0441\u0432\u043e\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0438 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u043d\u0435\u043c\u0443. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u043d\u0430\u0442\u043a\u043d\u0435\u0442\u0435\u0441\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442, \u0440\u0435\u0448\u0430\u044f \u043f\u043e\u0445\u043e\u0436\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. \u041c\u043d\u0435 \u0431\u044b \u043e\u043d \u043f\u043e\u043c\u043e\u0433.<\/p>\n<h2>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447 \u00ab\u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438\u00bb (\u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443)<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/92d\/33f\/e09\/92d33fe094d29986ed837e5bf5a07930.png\" alt=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438\" title=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438\" width=\"1000\" height=\"638\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/92d\/33f\/e09\/92d33fe094d29986ed837e5bf5a07930.png\"\/><\/p>\n<div><figcaption><em>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0443\u043c \u0438 \u043b\u0435\u0433\u043a\u043e \u0433\u0443\u0433\u043b\u0438\u0442\u0441\u044f \u2014 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u043e N \u0448\u0442\u0443\u043a \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u0432 \u0446\u0438\u043a\u043b\u0435 \u0447\u0435\u0440\u0435\u0437 parallel. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u043c\u0435\u0441\u0442\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0431\u044b\u043b\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b.<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0434 \u0432 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0443-\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c Groovysh.<\/summary>\n<div class=\"spoiler__content\">\n<p>\u042f \u0431\u043e\u043b\u044c\u0448\u0435 Python-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0446\u0438\u043a\u043b\u044b, \u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 each \u0438\u043b\u0438 collect \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0442\u0435\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 1 \u0441\u0442\u0440\u043e\u0447\u043a\u0443. <\/p>\n<\/div>\n<\/details>\n<p> <strong>\u041a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f:<\/strong><\/p>\n<pre><code class=\"java\">node {     List&lt;Closure> groups = []     Integer groupsCount = 3     Integer taskCount = 12      (1..groupsCount).each { groups.add([:]) }     for (int i in 1..taskCount) {         groups[i % groupsCount][i] = runTest(\"${i}\")     }      for (group in groups) {         parallel group     } }   def runTest(name) {     return {         stage(name) {             println(name)         }     } }<\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u0442\u0435\u0441\u0442 \u043c\u043e\u0436\u0435\u0442 \u0434\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0438\u043d\u0443\u0442 \u0434\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0447\u0430\u0441\u043e\u0432. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041b\u0435\u0433\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u041f\u043b\u043e\u0445\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/u>. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 \u0436\u0434\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0442\u0435\u0441\u0442 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0433\u0440\u0443\u043f\u043f\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0430 \u0440\u0430\u0437\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0449\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435!<\/p>\n<h2>\u041c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434: \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Queue \u0438 threading<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/960\/342\/6ce\/9603426cee1887dbbd7428101deefe2e.png\" alt=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c\" title=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c\" width=\"1015\" height=\"230\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/960\/342\/6ce\/9603426cee1887dbbd7428101deefe2e.png\"\/><\/p>\n<div><figcaption><em>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0440\u0438\u0448\u043b\u0430 \u043c\u044b\u0441\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python-\u0441\u043a\u0440\u0438\u043f\u0442: \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e threading \u043d\u0443\u0436\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432, \u0430 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0431\u0440\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 Queue. \u041f\u043e\u043c\u0438\u043c\u043e Python, \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0438\u043b\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u0432 Jenkins shared library, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0438 \u0441\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u043e\u0434 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 Jenkins shared library, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0435\u0433\u043e \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<p><em>runTasksInParallel.groovy:<\/em><\/p>\n<pre><code class=\"python\">def call(String testSuitePath, Integer threads) {     String scripDir = \"${env.WORKSPACE}\/runTestSuite\"     String scriptName = \"run_test_suite_in_parallel.py\"     if(! fileExists(\"${scripDir}\/${scriptName}\")) {         sh(label: \"create script directory\", script: \"mkdir -p ${scripDir}\")         writeFile(file: \"${scripDir}\/${scriptName}\", text: libraryResource(scriptName))     }      dir(scripDir) {         try {             String output = sh(                 label: \"running script via python\",                 script: \"\"\"                     python3 ${scriptName} \\                         --test-suite \"${env.WORKSPACE}\/${testSuitePath}\" \\                         --threads ${threads} \\                         2>&amp;1                 \"\"\",                 returnStdout: true             )             return output         } finally {             deleteDir()         }     } }<\/code><\/pre>\n<p><em>run_test_suite_in_parallel.py:<\/em><\/p>\n<pre><code class=\"python\">import logging import argparse import queue import threading from pathlib import Path   def run_test(q: object):     while True:         test_path = q.get()         try:             print(f\"Running test from {test_path}\")         except Exception as err:             logging.error(err, stack_info=True)         finally:             q.task_done()   if __name__ == \"__main__\":     parser = argparse.ArgumentParser(description=\"Script for running tests in parallel\")     parser.add_argument(\"--test-suite\", dest=\"test_suite\", action=\"store\", required=True,                         help=\"path to test suite directory\")     parser.add_argument(\"--threads\", dest=\"threads\", action=\"store\", required=True, type=int,                         help=\"limit of concurrent threads\")      args = parser.parse_args()     q = queue.Queue()      for _ in range(args.threads):         worker = threading.Thread(target=run_test,                                   args=(q),                                   daemon=True)         worker.start()      test_suite = list(Path(args.test_suite).glob(\"**\/*.test\"))     for test in test_suite:         q.put(test)      q.join() <\/code><\/pre>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u041b\u0435\u0433\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/u>, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0430\u044f \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Python \u0438\u043b\u0438 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p><u>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/u>. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0440\u043a\u0435\u0440 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u0434\u043d\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u043e\u043d \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u041f\u043b\u043e\u0445\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/u>. \u0412\u0441\u0451 \u0441\u043a\u0440\u044b\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u044d\u0439\u0434\u0436\u0430. \u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441\u043f\u043b\u043e\u0448\u043d\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p><u>\u0427\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0430 \u043e\u0442 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430<\/u> \u0438 \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0435 \u0443\u0441\u0442\u0440\u043e\u0438\u043b\u043e \u043c\u0435\u043d\u044f \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u2014 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0448\u043b\u0438, \u0430 \u043a\u0430\u043a\u0438\u0435 \u0443\u043f\u0430\u043b\u0438. \u041f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d. \u0418 \u0447\u0442\u043e\u0431\u044b \u043b\u043e\u0433\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u044d\u0439\u0434\u0436\u0430\u0445.<\/p>\n<p>\u042f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u0444\u044d\u0439\u043a\u043e\u0432\u044b\u0435 \u0441\u0442\u044d\u0439\u0434\u0436\u0438 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0418 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043c\u0435\u043d\u044f \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u0431\u0435\u0437 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043d\u0438\u0436\u0435. \u041d\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u2026<\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u0430 \u0438\u0437 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Concurrent Step (\u043d\u043e \u043e\u043d\u043e \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430)<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8a9\/598\/88f\/8a959888ff92a0ca48a0647710f154f1.png\" alt=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u0430\u043c\u0438\" title=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u0430\u043c\u0438\" width=\"736\" height=\"491\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8a9\/598\/88f\/8a959888ff92a0ca48a0647710f154f1.png\"\/><\/p>\n<div><figcaption><em>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u0430\u043c\u0438<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 \u044d\u0442\u0438\u043c \u044f \u043d\u0430\u0448\u0435\u043b <a href=\"https:\/\/plugins.jenkins.io\/concurrent-step\/\">\u043f\u043b\u0430\u0433\u0438\u043d<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u044b \u0432 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0435. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c. \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0435\u043c\u0430\u0444\u043e\u0440 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u043e\u0432. \u0418 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 parallel \u043d\u0430\u0448 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447. \u0410 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0435\u043c\u0430\u0444\u043e\u0440.<\/p>\n<pre><code class=\"java\">@groovy.transform.Field semaphore = null  node {     semaphore = createSemaphore(permit: 3)      Map tasks = [:]     Integer taskCount = 12     for (int i in 1..taskCount) {         tasks[i] = runTest(\"${i}\")     }      parallel tasks }   def runTest(name) {     return {         stage(name) {             acquireSemaphore (semaphore) {                 println(name)             }         }     } }<\/code><\/pre>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u041b\u0435\u0433\u043a\u0430\u044f \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f.<\/u> \u0421\u0435\u043c\u0430\u0444\u043e\u0440\u044b \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0438 \u043c\u043d\u043e\u0433\u0438\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p><u>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/u>. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043c\u0430\u0444\u043e\u0440 \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0441\u0440\u0430\u0437\u0443 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u0421\u0430\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u0430\u0432\u043d\u043e \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0441\u044f<\/u> \u0438 \u0435\u0441\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c: \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u043c\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0438\u043c\u0435\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f. <\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u0441\u043a\u0438\u043d\u0443\u043b\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u0435\u0439\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 Jenkins<\/summary>\n<div class=\"spoiler__content\">\n<p><strong>Jesse Glick:<\/strong> From a brief glance at <a href=\"https:\/\/github.com\/jenkinsci\/concurrent-step-plugin\">https:\/\/github.com\/jenkinsci\/concurrent-step-plugin<\/a> I would say that it is designed incorrectly (confuses \u201cnative\u201d Java threads with \u201cvirtual\u201d CPS VM threads) and should not be used. Most or all of its steps probably could be reimplemented correctly while using the same Pipeline script interface.    <\/p>\n<blockquote>\n<p>\u0412\u0437\u044f\u0442\u043e \u0438\u0437\u00a0 <a href=\"https:\/\/issues.jenkins.io\/browse\/JENKINS-44085?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel\">https:\/\/issues.jenkins.io\/browse\/JENKINS-44085?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel<\/a> <\/p>\n<\/blockquote>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p><u>\u041f\u043b\u043e\u0445\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/u>. \u0412\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0438\u043a \u0441\u0442\u044d\u0439\u0434\u0436\u0435\u0439 \u0432 \u0433\u0440\u0430\u0444\u0435 \u0438 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432\u0441\u0451 \u044d\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0437\u0430\u043d\u044f\u043b\u043e. <\/p>\n<\/li>\n<\/ul>\n<h2>\u041c\u043e\u0439 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u043f\u044b\u0442\u0430 \u0441 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c (\u0438 \u0441 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f\u043c\u0438)<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cc1\/2bb\/87f\/cc12bb87f89d6a318dc4a6ecbcf7e764.png\" alt=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u043e\u0447\u0435\u0440\u0435\u0434\u044c\u044e \u0438 \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c\u0438\" title=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u043e\u0447\u0435\u0440\u0435\u0434\u044c\u044e \u0438 \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c\u0438\" width=\"1000\" height=\"441\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cc1\/2bb\/87f\/cc12bb87f89d6a318dc4a6ecbcf7e764.png\"\/><\/p>\n<div><figcaption><em>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u043e\u0447\u0435\u0440\u0435\u0434\u044c\u044e \u0438 \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c\u0438<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u0444\u044d\u0439\u043a\u043e\u0432\u044b\u0435 \u0441\u0442\u044d\u0439\u0434\u0436\u0438 \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0441 parallel \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 \u043e\u0447\u0435\u0440\u0435\u0434\u044c\u044e \u0438 \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c\u0438, \u0447\u0442\u043e \u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b \u0432 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0435\u0449\u0451 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0442\u043e\u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u041d\u043e \u0438\u0445 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432, \u0430 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0437\u0430\u0434\u0430\u0447 \u0441 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a. \u0421\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c parallel. \u0414\u043b\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0437\u0430\u0434\u0430\u0447 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/plugins.jenkins.io\/lockable-resources\/\">\u043f\u043b\u0430\u0433\u0438\u043d<\/a> Lockable Resource (\u043e\u043d \u0443\u0436\u0435 \u0431\u044b\u043b \u0443 \u043d\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d), \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 Jenkins shared library:<\/p>\n<pre><code class=\"java\">limitedParallel.groovy: def call(Map params) {     Integer workerCount = params.workerCount ?: 1     String resourceName = params.resourceName ?: \"cores\"     List&lt;Closure> queue = params.tasks ? params.tasks.clone() : []     Boolean failFast = params.failFast ?: false      Map workers = [\"failFast\": failFast]     for(int i in (0..workersCount-1).toList()) { \/\/ toList to make function serializable         workers[\"${resourceName}_${i}\"] = getTaskFromQueue(queue)     }      parallel workers }  def getTaskFromQueue(List&lt;Closure> queue) {     return {         Closure task = null         while(true) {             lock(\"Thread safe ${env.BUILD_TAG}\") { \/\/ Resource name should be unique among multiple concurrent job runs                 task = queue ? queue.pop() : null             }             if (task) {                 task()             } else {                 break  \/\/ queue is empty             }         }     } }<\/code><\/pre>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/u>. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u0442\u044d\u0439\u0434\u0436 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435. \u041d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0432\u0438\u0434\u043d\u043e, \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d, \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0443\u043f\u0430\u043b\u0438, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0448\u043b\u0438, \u0438 \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0434\u0443\u0442 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<\/li>\n<li>\n<p><u>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/u>. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f, \u0438 \u0442\u0430\u043a \u043f\u043e\u043a\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0435 \u0438\u0441\u0441\u044f\u043a\u043d\u0435\u0442.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0434\u0430\u0447 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0438\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0435\u0433\u043e, \u0433\u0440\u0430\u0444 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 BlueOcean \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0435\u043a, \u0438\u0445 \u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. <\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u044f \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f. \u0418 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0432\u0438\u0434\u043d\u043e, \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0430 \u0440\u0430\u0437\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0443\u0441\u043f\u0435\u0432\u0430\u044e\u0442 \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0438\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0440\u0430\u0437\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0434\u0430\u0447\u0435\u043a, \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b sleep \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u043e\u0442 1 \u0434\u043e 10 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<pre><code class=\"java\">node {     List&lt;Closure> tasks = []     Integer taskCount = 12     for (int i in 1..taskCount) {         tasks.add(runTest(\"${i}\"))     }      limitedParallel(tasks: tasks, workersCount: 4, resourceName: \"core\", failFast: true) }  def runTest(String name) {     return {         stage(name) {             Integer t = Math.abs( new Random().nextInt() % (10 - 1) ) + 1             sh(\"sleep ${t}\")         }     } }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u0443 \u0438\u0434\u0435\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043b\u0431\u044d\u043a-\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u0438. \u041d\u043e \u043c\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u044c. \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0441\u0447\u0451\u0442\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u043f\u043e\u043b\u0435 &#171;\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435&#187; \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0430\u0447 \u043f\u0440\u043e\u0448\u043b\u043e \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/124\/33b\/580\/12433b5805346d6dbdd7be6a7d5941c4.png\" alt=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430\" title=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430\" width=\"1000\" height=\"417\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/124\/33b\/580\/12433b5805346d6dbdd7be6a7d5941c4.png\"\/><\/p>\n<div><figcaption><em>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430<\/em><\/figcaption><\/div>\n<\/figure>\n<p><strong>p.s.<\/strong> \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0438\u043b\u0438 \u0437\u043d\u0430\u0435\u0442\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0440\u0438 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/754922\/\"> https:\/\/habr.com\/ru\/articles\/754922\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\">\n<div><figcaption><em>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 2 \u043f\u043e\u0442\u043e\u043a\u0430<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u043e \u043c\u043d\u043e\u0439 \u0432\u0441\u0442\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0435\u0441\u0442\u044c 250 \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0442 5 \u0434\u043e 30 \u043c\u0438\u043d\u0443\u0442, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438 \u0447\u0430\u0441\u044b. \u041d\u0430\u0434\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0445 \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 16 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043b\u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u044f\u0434\u0435\u0440 CPU. \u0420\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0439\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u0443\u0442\u0435\u043c \u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u044f \u0438\u043b\u0438 \u043b\u044d\u0439\u0431\u043b \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Lockable Resource \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<p>\u0412 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044f \u043f\u0440\u043e\u0448\u0435\u0440\u0441\u0442\u0438\u043b \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438 \u043d\u0430\u0448\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043d\u043e\u2026 \u041e\u043d\u0438 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u043c\u043d\u0435 \u043f\u043b\u043e\u0445\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\u043b\u0438 \u043d\u0435\u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430. \u0418 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0442\u043e\u0447\u043d\u0435\u0435, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u041d\u0438\u0436\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043c\u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u0445, \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0448\u0443 \u043c\u0438\u043d\u0443\u0441\u044b \u0438 \u043f\u043b\u044e\u0441\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e, \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u0441\u0432\u043e\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0438 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u043d\u0435\u043c\u0443. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u043d\u0430\u0442\u043a\u043d\u0435\u0442\u0435\u0441\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442, \u0440\u0435\u0448\u0430\u044f \u043f\u043e\u0445\u043e\u0436\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. \u041c\u043d\u0435 \u0431\u044b \u043e\u043d \u043f\u043e\u043c\u043e\u0433.<\/p>\n<h2>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447 \u00ab\u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438\u00bb (\u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443)<\/h2>\n<figure class=\"full-width\">\n<div><figcaption><em>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0443\u043c \u0438 \u043b\u0435\u0433\u043a\u043e \u0433\u0443\u0433\u043b\u0438\u0442\u0441\u044f \u2014 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u043e N \u0448\u0442\u0443\u043a \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u0432 \u0446\u0438\u043a\u043b\u0435 \u0447\u0435\u0440\u0435\u0437 parallel. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u043c\u0435\u0441\u0442\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0431\u044b\u043b\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b.<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0434 \u0432 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0443-\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c Groovysh.<\/summary>\n<div class=\"spoiler__content\">\n<p>\u042f \u0431\u043e\u043b\u044c\u0448\u0435 Python-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0446\u0438\u043a\u043b\u044b, \u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 each \u0438\u043b\u0438 collect \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0442\u0435\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 1 \u0441\u0442\u0440\u043e\u0447\u043a\u0443. <\/p>\n<\/div>\n<\/details>\n<p> <strong>\u041a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f:<\/strong><\/p>\n<pre><code class=\"java\">node {     List&lt;Closure> groups = []     Integer groupsCount = 3     Integer taskCount = 12      (1..groupsCount).each { groups.add([:]) }     for (int i in 1..taskCount) {         groups[i % groupsCount][i] = runTest(\"${i}\")     }      for (group in groups) {         parallel group     } }   def runTest(name) {     return {         stage(name) {             println(name)         }     } }<\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u0442\u0435\u0441\u0442 \u043c\u043e\u0436\u0435\u0442 \u0434\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0438\u043d\u0443\u0442 \u0434\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0447\u0430\u0441\u043e\u0432. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041b\u0435\u0433\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u041f\u043b\u043e\u0445\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/u>. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 \u0436\u0434\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0442\u0435\u0441\u0442 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0433\u0440\u0443\u043f\u043f\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0430 \u0440\u0430\u0437\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0449\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435!<\/p>\n<h2>\u041c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434: \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Queue \u0438 threading<\/h2>\n<figure class=\"full-width\">\n<div><figcaption><em>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0440\u0438\u0448\u043b\u0430 \u043c\u044b\u0441\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python-\u0441\u043a\u0440\u0438\u043f\u0442: \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e threading \u043d\u0443\u0436\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432, \u0430 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0431\u0440\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 Queue. \u041f\u043e\u043c\u0438\u043c\u043e Python, \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0438\u043b\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u0432 Jenkins shared library, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0438 \u0441\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u043e\u0434 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 Jenkins shared library, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0435\u0433\u043e \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<p><em>runTasksInParallel.groovy:<\/em><\/p>\n<pre><code class=\"python\">def call(String testSuitePath, Integer threads) {     String scripDir = \"${env.WORKSPACE}\/runTestSuite\"     String scriptName = \"run_test_suite_in_parallel.py\"     if(! fileExists(\"${scripDir}\/${scriptName}\")) {         sh(label: \"create script directory\", script: \"mkdir -p ${scripDir}\")         writeFile(file: \"${scripDir}\/${scriptName}\", text: libraryResource(scriptName))     }      dir(scripDir) {         try {             String output = sh(                 label: \"running script via python\",                 script: \"\"\"                     python3 ${scriptName} \\                         --test-suite \"${env.WORKSPACE}\/${testSuitePath}\" \\                         --threads ${threads} \\                         2>&amp;1                 \"\"\",                 returnStdout: true             )             return output         } finally {             deleteDir()         }     } }<\/code><\/pre>\n<p><em>run_test_suite_in_parallel.py:<\/em><\/p>\n<pre><code class=\"python\">import logging import argparse import queue import threading from pathlib import Path   def run_test(q: object):     while True:         test_path = q.get()         try:             print(f\"Running test from {test_path}\")         except Exception as err:             logging.error(err, stack_info=True)         finally:             q.task_done()   if __name__ == \"__main__\":     parser = argparse.ArgumentParser(description=\"Script for running tests in parallel\")     parser.add_argument(\"--test-suite\", dest=\"test_suite\", action=\"store\", required=True,                         help=\"path to test suite directory\")     parser.add_argument(\"--threads\", dest=\"threads\", action=\"store\", required=True, type=int,                         help=\"limit of concurrent threads\")      args = parser.parse_args()     q = queue.Queue()      for _ in range(args.threads):         worker = threading.Thread(target=run_test,                                   args=(q),                                   daemon=True)         worker.start()      test_suite = list(Path(args.test_suite).glob(\"**\/*.test\"))     for test in test_suite:         q.put(test)      q.join() <\/code><\/pre>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u041b\u0435\u0433\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/u>, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0430\u044f \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Python \u0438\u043b\u0438 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p><u>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/u>. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0440\u043a\u0435\u0440 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u0434\u043d\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u043e\u043d \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u041f\u043b\u043e\u0445\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/u>. \u0412\u0441\u0451 \u0441\u043a\u0440\u044b\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u044d\u0439\u0434\u0436\u0430. \u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441\u043f\u043b\u043e\u0448\u043d\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p><u>\u0427\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0430 \u043e\u0442 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430<\/u> \u0438 \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0435 \u0443\u0441\u0442\u0440\u043e\u0438\u043b\u043e \u043c\u0435\u043d\u044f \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u2014 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0448\u043b\u0438, \u0430 \u043a\u0430\u043a\u0438\u0435 \u0443\u043f\u0430\u043b\u0438. \u041f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d. \u0418 \u0447\u0442\u043e\u0431\u044b \u043b\u043e\u0433\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u044d\u0439\u0434\u0436\u0430\u0445.<\/p>\n<p>\u042f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u0444\u044d\u0439\u043a\u043e\u0432\u044b\u0435 \u0441\u0442\u044d\u0439\u0434\u0436\u0438 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0418 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043c\u0435\u043d\u044f \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u0431\u0435\u0437 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043d\u0438\u0436\u0435. \u041d\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u2026<\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u0430 \u0438\u0437 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Concurrent Step (\u043d\u043e \u043e\u043d\u043e \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430)<\/h2>\n<figure class=\"full-width\">\n<div><figcaption><em>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u0430\u043c\u0438<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 \u044d\u0442\u0438\u043c \u044f \u043d\u0430\u0448\u0435\u043b <a href=\"https:\/\/plugins.jenkins.io\/concurrent-step\/\">\u043f\u043b\u0430\u0433\u0438\u043d<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u044b \u0432 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0435. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c. \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0435\u043c\u0430\u0444\u043e\u0440 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u043e\u0432. \u0418 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 parallel \u043d\u0430\u0448 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447. \u0410 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0435\u043c\u0430\u0444\u043e\u0440.<\/p>\n<pre><code class=\"java\">@groovy.transform.Field semaphore = null  node {     semaphore = createSemaphore(permit: 3)      Map tasks = [:]     Integer taskCount = 12     for (int i in 1..taskCount) {         tasks[i] = runTest(\"${i}\")     }      parallel tasks }   def runTest(name) {     return {         stage(name) {             acquireSemaphore (semaphore) {                 println(name)             }         }     } }<\/code><\/pre>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u041b\u0435\u0433\u043a\u0430\u044f \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f.<\/u> \u0421\u0435\u043c\u0430\u0444\u043e\u0440\u044b \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0438 \u043c\u043d\u043e\u0433\u0438\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p><u>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/u>. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043c\u0430\u0444\u043e\u0440 \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0441\u0440\u0430\u0437\u0443 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u0421\u0430\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u0430\u0432\u043d\u043e \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0441\u044f<\/u> \u0438 \u0435\u0441\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c: \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u043c\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0438\u043c\u0435\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f. <\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u0441\u043a\u0438\u043d\u0443\u043b\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u0435\u0439\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 Jenkins<\/summary>\n<div class=\"spoiler__content\">\n<p><strong>Jesse Glick:<\/strong> From a brief glance at <a href=\"https:\/\/github.com\/jenkinsci\/concurrent-step-plugin\">https:\/\/github.com\/jenkinsci\/concurrent-step-plugin<\/a> I would say that it is designed incorrectly (confuses \u201cnative\u201d Java threads with \u201cvirtual\u201d CPS VM threads) and should not be used. Most or all of its steps probably could be reimplemented correctly while using the same Pipeline script interface.    <\/p>\n<blockquote>\n<p>\u0412\u0437\u044f\u0442\u043e \u0438\u0437\u00a0 <a href=\"https:\/\/issues.jenkins.io\/browse\/JENKINS-44085?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel\">https:\/\/issues.jenkins.io\/browse\/JENKINS-44085?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel<\/a> <\/p>\n<\/blockquote>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p><u>\u041f\u043b\u043e\u0445\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/u>. \u0412\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0438\u043a \u0441\u0442\u044d\u0439\u0434\u0436\u0435\u0439 \u0432 \u0433\u0440\u0430\u0444\u0435 \u0438 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432\u0441\u0451 \u044d\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0437\u0430\u043d\u044f\u043b\u043e. <\/p>\n<\/li>\n<\/ul>\n<h2>\u041c\u043e\u0439 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u043f\u044b\u0442\u0430 \u0441 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c (\u0438 \u0441 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f\u043c\u0438)<\/h2>\n<figure class=\"full-width\">\n<div><figcaption><em>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u043e\u0447\u0435\u0440\u0435\u0434\u044c\u044e \u0438 \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c\u0438<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u0444\u044d\u0439\u043a\u043e\u0432\u044b\u0435 \u0441\u0442\u044d\u0439\u0434\u0436\u0438 \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0441 parallel \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 \u043e\u0447\u0435\u0440\u0435\u0434\u044c\u044e \u0438 \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c\u0438, \u0447\u0442\u043e \u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b \u0432 Python-\u0441\u043a\u0440\u0438\u043f\u0442\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0435\u0449\u0451 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0442\u043e\u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u041d\u043e \u0438\u0445 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432, \u0430 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0437\u0430\u0434\u0430\u0447 \u0441 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a. \u0421\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c parallel. \u0414\u043b\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0437\u0430\u0434\u0430\u0447 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/plugins.jenkins.io\/lockable-resources\/\">\u043f\u043b\u0430\u0433\u0438\u043d<\/a> Lockable Resource (\u043e\u043d \u0443\u0436\u0435 \u0431\u044b\u043b \u0443 \u043d\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d), \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 Jenkins shared library:<\/p>\n<pre><code class=\"java\">limitedParallel.groovy: def call(Map params) {     Integer workerCount = params.workerCount ?: 1     String resourceName = params.resourceName ?: \"cores\"     List&lt;Closure> queue = params.tasks ? params.tasks.clone() : []     Boolean failFast = params.failFast ?: false      Map workers = [\"failFast\": failFast]     for(int i in (0..workersCount-1).toList()) { \/\/ toList to make function serializable         workers[\"${resourceName}_${i}\"] = getTaskFromQueue(queue)     }      parallel workers }  def getTaskFromQueue(List&lt;Closure> queue) {     return {         Closure task = null         while(true) {             lock(\"Thread safe ${env.BUILD_TAG}\") { \/\/ Resource name should be unique among multiple concurrent job runs                 task = queue ? queue.pop() : null             }             if (task) {                 task()             } else {                 break  \/\/ queue is empty             }         }     } }<\/code><\/pre>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><u>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/u>. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u0442\u044d\u0439\u0434\u0436 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435. \u041d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0432\u0438\u0434\u043d\u043e, \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d, \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0443\u043f\u0430\u043b\u0438, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0448\u043b\u0438, \u0438 \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0434\u0443\u0442 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<\/li>\n<li>\n<p><u>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/u>. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f, \u0438 \u0442\u0430\u043a \u043f\u043e\u043a\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0435 \u0438\u0441\u0441\u044f\u043a\u043d\u0435\u0442.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0434\u0430\u0447 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0438\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0435\u0433\u043e, \u0433\u0440\u0430\u0444 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 BlueOcean \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0435\u043a, \u0438\u0445 \u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. <\/p>\n<\/li>\n<\/ul>\n<p>\u041d<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-352310","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=352310"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352310\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=352310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=352310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=352310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}