dream
/
Jenkinsfile
927 строк · 24.9 Кб
1#!groovy
2
3def isPullRequest = env.CHANGE_ID ? true : false
4
5pipeline {
6
7agent {
8label 'dream'
9}
10environment {
11WAIT_TIMEOUT=2400
12WAIT_INTERVAL=10
13COMPOSE_HTTP_TIMEOUT=120
14}
15stages {
16stage('Checkout') {
17steps {
18script {
19def branch = "Current branch is ${env.BRANCH_NAME}"
20if (isPullRequest) {
21echo """${branch}
22Git commiter name: ${env.GIT_AUTHOR_NAME} or ${env.GIT_COMMITTER_NAME}
23Pull request: merge ${env.CHANGE_BRANCH} into ${env.CHANGE_TARGET}
24Pull request id: ${pullRequest.id} or ${env.CHANGE_ID}
25Pull request title: ${pullRequest.title}
26Pull request headRef: ${pullRequest.headRef}
27Pull request base: ${pullRequest.base}
28"""
29}
30else {
31echo "${branch}"
32}
33}
34}
35}
36// ------------------------------------------- Test prompted dists------------------------------------------------
37stage('Build-DRUXGLM') {
38steps {
39script{
40startTime = currentBuild.duration
41Exception ex = null
42catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
43try {
44sh '''
45cat /home/ignatov/secrets.txt >> .env_secret
46tests/runtests_dream_ruxglm.sh MODE=build
47'''
48}
49catch (Exception e) {
50int duration = (currentBuild.duration - startTime) / 1000
51throw e
52}
53}
54}
55}
56post {
57aborted {
58script {
59sh 'tests/runtests_dream_ruxglm.sh MODE=clean'
60}
61}
62success {
63script {
64int duration = (currentBuild.duration - startTime) / 1000
65}
66}
67}
68}
69stage('Start-DRUXGLM') {
70steps {
71script {
72startTime = currentBuild.duration
73Exception ex = null
74catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
75try {
76sh 'tests/runtests_dream_ruxglm.sh MODE=clean && tests/runtests_dream_ruxglm.sh MODE=start'
77}
78catch (Exception e) {
79int duration = (currentBuild.duration - startTime) / 1000
80throw e
81}
82}
83}
84}
85post {
86success {
87script {
88started = true
89int duration = (currentBuild.duration - startTime) / 1000
90}
91}
92aborted {
93script {
94sh 'tests/runtests_dream_ruxglm.sh MODE=clean'
95}
96}
97}
98}
99stage('Test skills-DRUXGLM') {
100steps {
101script {
102startTime = currentBuild.duration
103Exception ex = null
104catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
105try {
106sh label: 'test skills', script: 'tests/runtests_dream_ruxglm.sh MODE=test_skills'
107}
108catch (Exception e) {
109int duration = (currentBuild.duration - startTime) / 1000
110throw e
111}
112}
113}
114}
115post {
116success {
117script {
118int duration = (currentBuild.duration - startTime) / 1000
119}
120}
121aborted {
122script {
123sh 'tests/runtests_dream_ruxglm.sh MODE=clean'
124}
125}
126}
127}
128// ------------------------------------------- Test prompted dists------------------------------------------------
129stage('Build-Reason') {
130steps {
131script{
132startTime = currentBuild.duration
133Exception ex = null
134catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
135try {
136sh '''
137cat /home/ignatov/secrets.txt >> .env_secret
138tests/runtests_dream_ruxglm.sh MODE=clean
139tests/runtests_reasoning.sh MODE=build
140'''
141}
142catch (Exception e) {
143int duration = (currentBuild.duration - startTime) / 1000
144throw e
145}
146}
147}
148}
149post {
150aborted {
151script {
152sh 'tests/runtests_reasoning.sh MODE=clean'
153}
154}
155success {
156script {
157int duration = (currentBuild.duration - startTime) / 1000
158}
159}
160}
161}
162stage('Start-Reason') {
163steps {
164script {
165startTime = currentBuild.duration
166Exception ex = null
167catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
168try {
169sh 'tests/runtests_reasoning.sh MODE=clean && tests/runtests_reasoning.sh MODE=start'
170}
171catch (Exception e) {
172int duration = (currentBuild.duration - startTime) / 1000
173throw e
174}
175}
176}
177}
178post {
179success {
180script {
181started = true
182int duration = (currentBuild.duration - startTime) / 1000
183}
184}
185aborted {
186script {
187sh 'tests/runtests_reasoning.sh MODE=clean'
188}
189}
190}
191}
192stage('Test skills-Reason') {
193steps {
194script {
195startTime = currentBuild.duration
196Exception ex = null
197catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
198try {
199sh label: 'test skills', script: 'tests/runtests_reasoning.sh MODE=test_skills'
200}
201catch (Exception e) {
202int duration = (currentBuild.duration - startTime) / 1000
203throw e
204}
205}
206}
207}
208post {
209success {
210script {
211int duration = (currentBuild.duration - startTime) / 1000
212}
213}
214aborted {
215script {
216sh 'tests/runtests_reasoning.sh MODE=clean'
217}
218}
219}
220}
221// ------------------------------------------- Test prompted dists------------------------------------------------
222stage('Build-MGPT35') {
223steps {
224script{
225startTime = currentBuild.duration
226Exception ex = null
227catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
228try {
229sh '''
230cat /home/ignatov/secrets.txt >> .env_secret
231tests/runtests_reasoning.sh MODE=clean
232tests/runtests_multiskill_davinci3.sh MODE=build
233'''
234}
235catch (Exception e) {
236int duration = (currentBuild.duration - startTime) / 1000
237throw e
238}
239}
240}
241}
242post {
243aborted {
244script {
245sh 'tests/runtests_multiskill_davinci3.sh MODE=clean'
246}
247}
248success {
249script {
250int duration = (currentBuild.duration - startTime) / 1000
251}
252}
253}
254}
255stage('Start-MGPT35') {
256steps {
257script {
258startTime = currentBuild.duration
259Exception ex = null
260catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
261try {
262sh 'tests/runtests_multiskill_davinci3.sh MODE=clean && tests/runtests_multiskill_davinci3.sh MODE=start'
263}
264catch (Exception e) {
265int duration = (currentBuild.duration - startTime) / 1000
266throw e
267}
268}
269}
270}
271post {
272success {
273script {
274started = true
275int duration = (currentBuild.duration - startTime) / 1000
276}
277}
278aborted {
279script {
280sh 'tests/runtests_multiskill_davinci3.sh MODE=clean'
281}
282}
283}
284}
285stage('Test skills-MGPT35') {
286steps {
287script {
288startTime = currentBuild.duration
289Exception ex = null
290catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
291try {
292sh label: 'test skills', script: 'tests/runtests_multiskill_davinci3.sh MODE=test_skills'
293}
294catch (Exception e) {
295int duration = (currentBuild.duration - startTime) / 1000
296throw e
297}
298}
299}
300}
301post {
302success {
303script {
304int duration = (currentBuild.duration - startTime) / 1000
305}
306}
307aborted {
308script {
309sh 'tests/runtests_multiskill_davinci3.sh MODE=clean'
310}
311}
312}
313}
314// ------------------------------------------- Test prompted dists------------------------------------------------
315stage('Build-MGPTJT') {
316steps {
317script{
318startTime = currentBuild.duration
319Exception ex = null
320catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
321try {
322sh '''
323cat /home/ignatov/secrets.txt >> .env_secret
324tests/runtests_multiskill_davinci3.sh MODE=clean
325tests/runtests_marketing_gptjt.sh MODE=build
326'''
327}
328catch (Exception e) {
329int duration = (currentBuild.duration - startTime) / 1000
330throw e
331}
332}
333}
334}
335post {
336aborted {
337script {
338sh 'tests/runtests_marketing_gptjt.sh MODE=clean'
339}
340}
341success {
342script {
343int duration = (currentBuild.duration - startTime) / 1000
344}
345}
346}
347}
348stage('Start-MGPTJT') {
349steps {
350script {
351startTime = currentBuild.duration
352Exception ex = null
353catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
354try {
355sh 'tests/runtests_marketing_gptjt.sh MODE=clean && tests/runtests_marketing_gptjt.sh MODE=start'
356}
357catch (Exception e) {
358int duration = (currentBuild.duration - startTime) / 1000
359throw e
360}
361}
362}
363}
364post {
365success {
366script {
367started = true
368int duration = (currentBuild.duration - startTime) / 1000
369}
370}
371aborted {
372script {
373sh 'tests/runtests_marketing_gptjt.sh MODE=clean'
374}
375}
376}
377}
378stage('Test skills-MGPTJT') {
379steps {
380script {
381startTime = currentBuild.duration
382Exception ex = null
383catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
384try {
385sh label: 'test skills', script: 'tests/runtests_marketing_gptjt.sh MODE=test_skills'
386}
387catch (Exception e) {
388int duration = (currentBuild.duration - startTime) / 1000
389throw e
390}
391}
392}
393}
394post {
395success {
396script {
397int duration = (currentBuild.duration - startTime) / 1000
398}
399}
400aborted {
401script {
402sh 'tests/runtests_marketing_gptjt.sh MODE=clean'
403}
404}
405}
406}
407// ------------------------------------------- Test prompted dists------------------------------------------------
408stage('Build-DCGPT') {
409steps {
410script{
411startTime = currentBuild.duration
412Exception ex = null
413catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
414try {
415sh '''
416cat /home/ignatov/secrets.txt >> .env_secret
417tests/runtests_marketing_gptjt.sh MODE=clean
418tests/runtests_deeppavlov_chatgpt.sh MODE=build
419'''
420}
421catch (Exception e) {
422int duration = (currentBuild.duration - startTime) / 1000
423throw e
424}
425}
426}
427}
428post {
429aborted {
430script {
431sh 'tests/runtests_deeppavlov_chatgpt.sh MODE=clean'
432}
433}
434success {
435script {
436int duration = (currentBuild.duration - startTime) / 1000
437}
438}
439}
440}
441stage('Start-DCGPT') {
442steps {
443script {
444startTime = currentBuild.duration
445Exception ex = null
446catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
447try {
448sh 'tests/runtests_deeppavlov_chatgpt.sh MODE=clean && tests/runtests_deeppavlov_chatgpt.sh MODE=start'
449}
450catch (Exception e) {
451int duration = (currentBuild.duration - startTime) / 1000
452throw e
453}
454}
455}
456}
457post {
458success {
459script {
460started = true
461int duration = (currentBuild.duration - startTime) / 1000
462}
463}
464aborted {
465script {
466sh 'tests/runtests_deeppavlov_chatgpt.sh MODE=clean'
467}
468}
469}
470}
471stage('Test skills-DCGPT') {
472steps {
473script {
474startTime = currentBuild.duration
475Exception ex = null
476catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
477try {
478sh label: 'test skills', script: 'tests/runtests_deeppavlov_chatgpt.sh MODE=test_skills'
479}
480catch (Exception e) {
481int duration = (currentBuild.duration - startTime) / 1000
482throw e
483}
484}
485}
486}
487post {
488success {
489script {
490int duration = (currentBuild.duration - startTime) / 1000
491}
492}
493aborted {
494script {
495sh 'tests/runtests_deeppavlov_chatgpt.sh MODE=clean'
496}
497}
498}
499}
500// ------------------------------------------- Test prompted dists------------------------------------------------
501stage('Build-JRUGPT') {
502steps {
503script{
504startTime = currentBuild.duration
505Exception ex = null
506catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
507try {
508sh '''
509cat /home/ignatov/secrets.txt >> .env_secret
510tests/runtests_deeppavlov_chatgpt.sh MODE=clean
511tests/runtests_journalist_rugpt35.sh MODE=build
512'''
513}
514catch (Exception e) {
515int duration = (currentBuild.duration - startTime) / 1000
516throw e
517}
518}
519}
520}
521post {
522aborted {
523script {
524sh 'tests/runtests_journalist_rugpt35.sh MODE=clean'
525}
526}
527success {
528script {
529int duration = (currentBuild.duration - startTime) / 1000
530}
531}
532}
533}
534stage('Start-JRUGPT') {
535steps {
536script {
537startTime = currentBuild.duration
538Exception ex = null
539catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
540try {
541sh 'tests/runtests_journalist_rugpt35.sh MODE=clean && tests/runtests_journalist_rugpt35.sh MODE=start'
542}
543catch (Exception e) {
544int duration = (currentBuild.duration - startTime) / 1000
545throw e
546}
547}
548}
549}
550post {
551success {
552script {
553started = true
554int duration = (currentBuild.duration - startTime) / 1000
555}
556}
557aborted {
558script {
559sh 'tests/runtests_journalist_rugpt35.sh MODE=clean'
560}
561}
562}
563}
564stage('Test skills-JRUGPT') {
565steps {
566script {
567startTime = currentBuild.duration
568Exception ex = null
569catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
570try {
571sh label: 'test skills', script: 'tests/runtests_journalist_rugpt35.sh MODE=test_skills'
572}
573catch (Exception e) {
574int duration = (currentBuild.duration - startTime) / 1000
575throw e
576}
577}
578}
579}
580post {
581success {
582script {
583int duration = (currentBuild.duration - startTime) / 1000
584}
585}
586aborted {
587script {
588sh 'tests/runtests_journalist_rugpt35.sh MODE=clean'
589}
590}
591}
592}
593// ------------------------------------------- Test dream dist------------------------------------------------
594stage('Build-Docs') {
595steps {
596script{
597startTime = currentBuild.duration
598Exception ex = null
599catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
600try {
601sh '''
602cat /home/ignatov/secrets.txt >> .env
603tests/runtests_journalist_rugpt35.sh MODE=clean
604tests/runtests_document_based.sh MODE=build
605'''
606}
607catch (Exception e) {
608int duration = (currentBuild.duration - startTime) / 1000
609throw e
610}
611}
612}
613}
614post {
615aborted {
616script {
617sh 'tests/runtests_document_based.sh MODE=clean'
618}
619}
620success {
621script {
622int duration = (currentBuild.duration - startTime) / 1000
623}
624}
625}
626}
627
628stage('Start-Docs') {
629steps {
630script {
631startTime = currentBuild.duration
632Exception ex = null
633catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
634try {
635sh 'tests/runtests_document_based.sh MODE=clean && tests/runtests_document_based.sh MODE=start'
636}
637catch (Exception e) {
638int duration = (currentBuild.duration - startTime) / 1000
639throw e
640}
641}
642}
643}
644post {
645success {
646script {
647started = true
648int duration = (currentBuild.duration - startTime) / 1000
649}
650}
651aborted {
652script {
653sh 'tests/runtests_document_based.sh MODE=clean'
654}
655}
656}
657}
658
659stage('Test skills-Docs') {
660steps {
661script {
662startTime = currentBuild.duration
663Exception ex = null
664catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
665try {
666sh label: 'test skills', script: 'tests/runtests_document_based.sh MODE=test_skills'
667}
668catch (Exception e) {
669int duration = (currentBuild.duration - startTime) / 1000
670throw e
671}
672}
673}
674}
675post {
676success {
677script {
678int duration = (currentBuild.duration - startTime) / 1000
679}
680}
681aborted {
682script {
683sh 'tests/runtests_document_based.sh MODE=clean'
684}
685}
686}
687}
688// ------------------------------------------- Test dream dist------------------------------------------------
689stage('Build') {
690steps {
691script{
692startTime = currentBuild.duration
693Exception ex = null
694catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
695try {
696sh '''
697cat /home/ignatov/secrets.txt >> .env
698tests/runtests_document_based.sh MODE=clean
699tests/runtests.sh MODE=build
700'''
701}
702catch (Exception e) {
703int duration = (currentBuild.duration - startTime) / 1000
704throw e
705}
706}
707}
708}
709post {
710aborted {
711script {
712sh 'tests/runtests.sh MODE=clean'
713}
714}
715success {
716script {
717int duration = (currentBuild.duration - startTime) / 1000
718}
719}
720}
721}
722
723stage('Start') {
724steps {
725script {
726startTime = currentBuild.duration
727Exception ex = null
728catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
729try {
730sh 'tests/runtests.sh MODE=clean && tests/runtests.sh MODE=start'
731}
732catch (Exception e) {
733int duration = (currentBuild.duration - startTime) / 1000
734throw e
735}
736}
737}
738}
739post {
740success {
741script {
742started = true
743int duration = (currentBuild.duration - startTime) / 1000
744}
745}
746aborted {
747script {
748sh 'tests/runtests.sh MODE=clean'
749}
750}
751}
752}
753
754stage('Test dialog') {
755steps {
756script {
757startTime = currentBuild.duration
758Exception ex = null
759catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
760try {
761sh 'tests/runtests.sh MODE=test_dialog'
762}
763catch (Exception e) {
764int duration = (currentBuild.duration - startTime) / 1000
765throw e
766}
767}
768}
769}
770post {
771success {
772script {
773int duration = (currentBuild.duration - startTime) / 1000
774}
775}
776}
777}
778
779stage('Test skills') {
780steps {
781script {
782startTime = currentBuild.duration
783Exception ex = null
784catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
785try {
786sh label: 'test skills', script: 'tests/runtests.sh MODE=test_skills'
787}
788catch (Exception e) {
789int duration = (currentBuild.duration - startTime) / 1000
790throw e
791}
792}
793}
794}
795post {
796success {
797script {
798int duration = (currentBuild.duration - startTime) / 1000
799}
800}
801aborted {
802script {
803sh 'tests/runtests.sh MODE=clean'
804}
805}
806}
807}
808
809// ------------------------------------------- Test Ru dream dist------------------------------------------------
810stage('Build-RU') {
811steps {
812script{
813startTime = currentBuild.duration
814Exception ex = null
815catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
816try {
817sh '''
818cat /home/ignatov/secrets.txt >> .env_ru
819tests/runtests.sh MODE=clean
820tests/runtests_russian.sh MODE=build
821'''
822}
823catch (Exception e) {
824int duration = (currentBuild.duration - startTime) / 1000
825throw e
826}
827}
828}
829}
830post {
831aborted {
832script {
833sh 'tests/runtests_russian.sh MODE=clean'
834}
835}
836success {
837script {
838int duration = (currentBuild.duration - startTime) / 1000
839}
840}
841}
842}
843
844stage('Start-RU') {
845steps {
846script {
847startTime = currentBuild.duration
848Exception ex = null
849catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
850try {
851sh 'tests/runtests_russian.sh MODE=clean && tests/runtests_russian.sh MODE=start'
852}
853catch (Exception e) {
854int duration = (currentBuild.duration - startTime) / 1000
855throw e
856}
857}
858}
859}
860post {
861success {
862script {
863started = true
864int duration = (currentBuild.duration - startTime) / 1000
865}
866}
867aborted {
868script {
869sh 'tests/runtests_russian.sh MODE=clean'
870}
871}
872}
873}
874
875stage('Test skills-RU') {
876steps {
877script {
878startTime = currentBuild.duration
879Exception ex = null
880catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
881try {
882sh label: 'test skills', script: 'tests/runtests_russian.sh MODE=test_skills'
883}
884catch (Exception e) {
885int duration = (currentBuild.duration - startTime) / 1000
886throw e
887}
888}
889}
890}
891post {
892success {
893script {
894int duration = (currentBuild.duration - startTime) / 1000
895}
896}
897aborted {
898script {
899sh 'tests/runtests_russian.sh MODE=clean'
900}
901}
902}
903}
904
905
906}
907post {
908aborted {
909script {
910sh 'aborted'
911}
912}
913cleanup {
914script {
915if (started) {
916sh './tests/runtests_multiskill_davinci3.sh MODE=clean'
917sh './tests/runtests_marketing_gptjt.sh MODE=clean'
918sh './tests/runtests_journalist_rugpt35.sh MODE=clean'
919sh './tests/runtests_deeppavlov_chatgpt.sh MODE=clean'
920sh './tests/runtests.sh MODE=clean'
921sh './tests/runtests_russian.sh MODE=clean'
922sh './tests/runtests_multilingual.sh MODE=clean'
923}
924}
925}
926}
927}
928