From: Cédric Ollivier Date: Mon, 26 Nov 2018 19:42:23 +0000 (+0100) Subject: Clean Functest containers even if failure X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F65397%2F2;p=releng.git Clean Functest containers even if failure It creates an additional multijob to ensure all containers are removed. It also publishes logs via gsutil. Change-Id: I45bd8aec3569e3257b94ea978c5bf2fd703649be Signed-off-by: Cédric Ollivier --- diff --git a/jjb/functest/functest-virtual.yaml b/jjb/functest/functest-virtual.yaml index cd65f9643..9671c1f16 100644 --- a/jjb/functest/functest-virtual.yaml +++ b/jjb/functest/functest-virtual.yaml @@ -10,6 +10,13 @@ - latest: branch: master +- job: + name: alpine-pull + parameters: + - functest-virtual-defaults + builders: + - shell: sudo docker pull alpine:3.8 + - job-template: name: '{repo}-functest-{container}-{tag}-pull' parameters: @@ -21,6 +28,8 @@ name: repo-functest-container-tag-pull <<: *functest-defaultparameters container: + - core + - tempest - healthcheck - smoke - benchmarking @@ -33,6 +42,9 @@ - functest-pulljobs: &functest-pulljobs name: 'functest-pulljobs' projects: + - name: 'alpine-pull' + - name: '{repo}-functest-core-{tag}-pull' + - name: '{repo}-functest-tempest-{tag}-pull' - name: '{repo}-functest-healthcheck-{tag}-pull' - name: '{repo}-functest-smoke-{tag}-pull' - name: '{repo}-functest-benchmarking-{tag}-pull' @@ -40,6 +52,35 @@ - name: '{repo}-functest-vnf-{tag}-pull' - name: '{repo}-functest-features-{tag}-pull' +- job: + name: alpine-rmi + parameters: + - functest-virtual-defaults + builders: + - shell: sudo docker rmi alpine:3.8 + +- job-template: + name: '{repo}-functest-{container}-{tag}-rmi' + parameters: + - functest-virtual-defaults + builders: + - shell: sudo docker rmi {repo}/functest-{container}:{tag} + +- project: + name: repo-functest-container-tag-rmi + <<: *functest-defaultparameters + container: + - core + - tempest + - healthcheck + - smoke + - benchmarking + - components + - vnf + - features + jobs: + - '{repo}-functest-{container}-{tag}-rmi' + - job-template: name: '{repo}-functest-{container}-{test}-{tag}-run' parameters: @@ -59,7 +100,15 @@ -v /home/opnfv/functest/rally_blacklist.yaml:\ /usr/lib/python2.7/site-packages/functest/opnfv_tests/openstack/\ rally/blacklist.yaml \ - {repo}/functest-{container}:{tag} run_tests -t {test} + {repo}/functest-{container}:{tag} run_tests -t {test} || \ + export RES=$? + gsutil -m cp -r /home/opnfv/functest/results/$JOB_NAME-$BUILD_ID \ + gs://artifacts.opnfv.org/functest/ > /dev/null + find /home/opnfv/functest/results/$JOB_NAME-$BUILD_ID -type f \ + -printf \ + "http://artifacts.opnfv.org/functest/$JOB_NAME-$BUILD_ID/%f\n" + sudo rm -rf /home/opnfv/functest/results/$JOB_NAME-$BUILD_ID + exit $RES - project: name: repo-functest-healthcheck-test-tag-run @@ -213,6 +262,46 @@ - name: '{repo}-functest-features-vgpu-{tag}-run' - name: '{repo}-functest-features-stor4nfv_os-{tag}-run' +- job-template: + name: '{repo}-functest-{tag}-run' + project-type: multijob + parameters: + - functest-virtual-defaults + builders: + - multijob: + name: healthcheck + <<: *functest-healthcheckjobs + - multijob: + name: smoke + <<: *functest-smokejobs + - multijob: + name: benchmarking + <<: *functest-benchmarkingjobs + - multijob: + name: components + <<: *functest-componentsjobs + # - multijob: + # name: vnf + # <<: *functest-vnfjobs + - multijob: + name: features + <<: *functest-featuresjobs + +- project: + name: repo-functest-tag-run + <<: *functest-defaultparameters + jobs: + - '{repo}-functest-{tag}-run' + +- functest-advcontainers-rmi: &functest-advcontainers-rmi + name: 'functest-advcontainers-rmi' + projects: + - name: '{repo}-functest-smoke-{tag}-rmi' + - name: '{repo}-functest-benchmarking-{tag}-rmi' + - name: '{repo}-functest-components-{tag}-rmi' + - name: '{repo}-functest-vnf-{tag}-rmi' + - name: '{repo}-functest-features-{tag}-rmi' + - job-template: name: '{repo}-functest-{tag}-daily' <<: *functest-defaultparameters @@ -233,23 +322,28 @@ name: pull containers <<: *functest-pulljobs - multijob: - name: healthcheck - <<: *functest-healthcheckjobs + name: run containers + condition: ALWAYS + projects: + - name: '{repo}-functest-{tag}-run' - multijob: - name: smoke - <<: *functest-smokejobs + name: remove advanced functest containers + condition: ALWAYS + <<: *functest-advcontainers-rmi - multijob: - name: benchmarking - <<: *functest-benchmarkingjobs + name: remove functest-tempest + condition: ALWAYS + projects: + - name: '{repo}-functest-tempest-{tag}-rmi' - multijob: - name: components - <<: *functest-componentsjobs - # - multijob: - # name: vnf - # <<: *functest-vnfjobs + name: remove functest-core + condition: ALWAYS + projects: + - name: '{repo}-functest-core-{tag}-rmi' - multijob: - name: features - <<: *functest-featuresjobs + name: remove alpine + projects: + - name: 'alpine-rmi' - project: name: repo-functest-tag-daily @@ -359,6 +453,10 @@ blocking-jobs: - '{repo}-functest-.*-.*' builders: + - multijob: + name: pull alpine + projects: + - name: 'alpine-pull' - multijob: name: build functest-core projects: @@ -385,23 +483,32 @@ - name: '{repo}-functest-features-{tag}-gate' <<: *functest-projectparameters - multijob: - name: healthcheck - <<: *functest-healthcheckjobs + name: run containers + condition: ALWAYS + projects: + - name: '{repo}-functest-{tag}-run' - multijob: - name: smoke - <<: *functest-smokejobs + name: remove advanced functest containers + condition: ALWAYS + <<: *functest-advcontainers-rmi - multijob: - name: benchmarking - <<: *functest-benchmarkingjobs + name: remove functest-tempest + condition: ALWAYS + projects: + - name: '{repo}-functest-tempest-{tag}-rmi' + <<: *functest-projectparameters - multijob: - name: components - <<: *functest-componentsjobs - # - multijob: - # name: vnf - # <<: *functest-vnfjobs + name: remove functest-core + condition: ALWAYS + projects: + - name: '{repo}-functest-core-{tag}-rmi' + <<: *functest-projectparameters - multijob: - name: features - <<: *functest-featuresjobs + name: remove alpine + condition: ALWAYS + projects: + - name: 'alpine-rmi' + <<: *functest-projectparameters - job-template: name: '{repo}-functest-{tag}-check' @@ -415,6 +522,10 @@ blocking-jobs: - '{repo}-functest-.*-.*' builders: + - multijob: + name: pull alpine + projects: + - name: 'alpine-pull' - multijob: name: build functest-core projects: @@ -441,23 +552,32 @@ - name: '{repo}-functest-features-{tag}-check' <<: *functest-projectparameters - multijob: - name: healthcheck - <<: *functest-healthcheckjobs + name: run containers + condition: ALWAYS + projects: + - name: '{repo}-functest-{tag}-run' - multijob: - name: smoke - <<: *functest-smokejobs + name: remove advanced functest containers + condition: ALWAYS + <<: *functest-advcontainers-rmi - multijob: - name: benchmarking - <<: *functest-benchmarkingjobs + name: remove functest-tempest + condition: ALWAYS + projects: + - name: '{repo}-functest-tempest-{tag}-rmi' + <<: *functest-projectparameters - multijob: - name: components - <<: *functest-componentsjobs - # - multijob: - # name: vnf - # <<: *functest-vnfjobs + name: remove functest-core + condition: ALWAYS + projects: + - name: '{repo}-functest-core-{tag}-rmi' + <<: *functest-projectparameters - multijob: - name: features - <<: *functest-featuresjobs + name: remove alpine + condition: ALWAYS + projects: + - name: 'alpine-rmi' + <<: *functest-projectparameters - project: name: repo-functest-tag-build