X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Ffunctest%2Ffunctest.yaml;h=8e9de2d267e2e182cf6f0a83efec3f0ac85d6e25;hb=39104196379b50039ee7801514536837768112ee;hp=967ce5d77c1c56f44dc9d48074cc68a70f74ae7d;hpb=3a90a3eee631968834ef1de74f06be36b83e7a3c;p=releng.git diff --git a/jjb/functest/functest.yaml b/jjb/functest/functest.yaml index 967ce5d77..8e9de2d26 100644 --- a/jjb/functest/functest.yaml +++ b/jjb/functest/functest.yaml @@ -1,7 +1,10 @@ --- -- functest-jobs: &functest-jobs - name: 'functest-jobs' - current-parameters: true +- functest-containers: &functest-containers + name: 'functest-containers' + repo: '{repo}' + port: '{port}' + container: '{container}' + tag: '{tag}' - functest-params: &functest-params name: 'functest-params' @@ -9,42 +12,51 @@ port: tag: - latest: + from: + build_args: branch: master - slave: lf-virtual9 - dashboard_url: http://172.30.13.94 + node: lf-pod4 + DASHBOARD_URL: http://172.30.12.83 + dependency: 3.14 + - zed: + from: + build_args: + branch: stable/zed + node: lf-virtual9 + DASHBOARD_URL: http://172.30.13.94 + dependency: 3.14 + - yoga: + from: + build_args: + branch: stable/yoga + node: lf-pod4-3 + DASHBOARD_URL: http://172.30.12.88 + dependency: 3.14 + - xena: + from: + build_args: + branch: stable/xena + node: lf-pod4-2 + DASHBOARD_URL: http://172.30.12.85 + dependency: 3.14 + - wallaby: + from: + build_args: + branch: stable/wallaby + node: lf-virtual6 + DASHBOARD_URL: http://172.30.13.91 dependency: 3.13 - - leguer: - branch: stable/leguer - slave: lf-virtual9 - dashboard_url: http://172.30.13.94 - dependency: 3.12 - - kali: - branch: stable/kali - slave: lf-pod4-3 - dashboard_url: http://172.30.12.88 - dependency: 3.11 - - jerma: - branch: stable/jerma - slave: lf-pod4 - dashboard_url: http://172.30.12.83 - dependency: 3.10 - - iruya: - branch: stable/iruya - slave: lf-virtual4 - dashboard_url: http://172.30.13.89 - dependency: 3.9 - - hunter: - branch: stable/hunter - slave: lf-virtual6 - dashboard_url: http://172.30.13.91 - dependency: 3.9 + +- functest-jobs: &functest-jobs + name: 'functest-jobs' + current-parameters: true - parameter: - name: functest-slave + name: functest-node parameters: - label: - name: slave - default: '{slave}' + name: node + default: '{node}' - parameter: name: functest-build_tag @@ -58,12 +70,14 @@ - string: name: EXTERNAL_NETWORK default: public + - parameter: name: functest-VOLUME_DEVICE_NAME parameters: - string: name: VOLUME_DEVICE_NAME default: sdb + - parameter: name: functest-IMAGE_PROPERTIES parameters: @@ -71,19 +85,18 @@ name: IMAGE_PROPERTIES default: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi -- functest-containers: &functest-containers - name: 'functest-containers' - repo: '{repo}' - port: '{port}' - container: '{container}' - tag: '{tag}' - - functest-run-containers: &functest-run-containers name: 'functest-run-containers' <<: *functest-containers test: '{test}' privileged: '{privileged}' + volumes: '{volumes}' + env: '{env}' network: '{network}' + uid: '{uid}' + gid: '{gid}' + published_ports: '{published_ports}' + DASHBOARD_URL: '{DASHBOARD_URL}' - builder: name: functest-pull-containers @@ -104,6 +117,21 @@ builders: - shell: | set +x + volumes=; + if [ "{volumes}" != "None" ]; then + for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \ + do volumes="-v $i $volumes"; done + fi + env=; + if [ "{env}" != "None" ]; then + for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \ + do env="-e $i $env"; done + fi + published_ports=; + if [ "{published_ports}" != "None" ]; then + for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \ + do published_ports="-p $i $published_ports"; done + fi [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true if [ "{repo}" = "_" ]; then image={container}:{tag} @@ -112,23 +140,24 @@ else image={repo}:{port}/{container}:{tag} fi + sudo mkdir -p $WORKSPACE/results + sudo chown {uid}:{gid} $WORKSPACE/results sudo docker run --rm \ --privileged={privileged} \ --network={network} \ + $volumes \ + $env \ + $published_ports \ -e S3_ENDPOINT_URL=https://storage.googleapis.com \ -e S3_DST_URL=s3://artifacts.opnfv.org/functest/$BUILD_TAG/$JOB_NAME-$BUILD_ID \ -e HTTP_DST_URL=http://artifacts.opnfv.org/functest/$BUILD_TAG/$JOB_NAME-$BUILD_ID \ - -v /home/opnfv/functest/.boto:/root/.boto \ + -v /home/opnfv/functest/.boto:/etc/boto.cfg \ -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \ -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \ - -e NODE_NAME=$slave \ + -e NODE_NAME=$node \ -e BUILD_TAG=$BUILD_TAG \ -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \ - -e EXTERNAL_NETWORK=$EXTERNAL_NETWORK \ - -e VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME \ - -e IMAGE_PROPERTIES=$IMAGE_PROPERTIES \ - -v /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file \ - -v /home/opnfv/functest/images:/home/opnfv/functest/images \ + -e DASHBOARD_URL={DASHBOARD_URL} \ $image run_tests -t {test} -p -r - builder: @@ -145,48 +174,11 @@ fi sudo docker rmi $image || true -- functest-build-containers: &functest-build-containers - name: 'functest-build-containers' - <<: *functest-containers - ref_arg: '{ref_arg}' - path: '{path}' - -- builder: - name: functest-build-containers - builders: - - shell: | - set +x - if [ "{repo}" = "_" ]; then - image={container}:{tag} - elif [ "{port}" = "None" ]; then - image={repo}/{container}:{tag} - else - image={repo}:{port}/{container}:{tag} - fi - if [ "{ref_arg}" = "None" ]; then - build_arg="" - else - build_arg="--build-arg {ref_arg}={ref}" - fi - cd {path} - sudo docker build $build_arg \ - --pull=false --no-cache --force-rm=true \ - -t $image . - -- scm: - name: functest-scm - scm: - - git: - url: 'https://gerrit.opnfv.org/gerrit/functest' - refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*' - branches: - - '{ref}' - - job-template: name: 'functest-{repo}-{container}-{tag}-pull' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' builders: - functest-pull-containers: <<: *functest-containers @@ -236,8 +228,8 @@ - job-template: name: 'functest-{repo}-{container}-{tag}-rmi' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' builders: - functest-remove-images: <<: *functest-containers @@ -285,10 +277,10 @@ - 'functest-{repo}-{container}-{tag}-rmi' - job-template: - name: 'functest-{repo}-{container}-{tag}-{test}-run' + name: 'functest-opnfv-functest-healthcheck-{tag}-{test}-run' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' - functest-build_tag: build_tag: '' - functest-EXTERNAL_NETWORK: @@ -304,6 +296,14 @@ - project: name: 'functest-opnfv-functest-healthcheck' <<: *functest-params + volumes: + - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file + - /home/opnfv/functest/images:/home/opnfv/functest/images + env: + - EXTERNAL_NETWORK=$EXTERNAL_NETWORK + - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME + - IMAGE_PROPERTIES=$IMAGE_PROPERTIES + published_ports: container: 'functest-healthcheck' test: - connection_check @@ -321,12 +321,39 @@ - tempest_horizon privileged: 'false' network: bridge + uid: 1000 + gid: 1000 jobs: - - 'functest-{repo}-{container}-{tag}-{test}-run' + - 'functest-opnfv-functest-healthcheck-{tag}-{test}-run' + +- job-template: + name: 'functest-opnfv-functest-smoke-{tag}-{test}-run' + parameters: + - functest-node: + node: '{node}' + - functest-build_tag: + build_tag: '' + - functest-EXTERNAL_NETWORK: + EXTERNAL_NETWORK: public + - functest-VOLUME_DEVICE_NAME: + VOLUME_DEVICE_NAME: sdb + - functest-IMAGE_PROPERTIES: + IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi + builders: + - functest-run-containers: + <<: *functest-run-containers - project: name: 'functest-opnfv-functest-smoke' <<: *functest-params + volumes: + - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file + - /home/opnfv/functest/images:/home/opnfv/functest/images + env: + - EXTERNAL_NETWORK=$EXTERNAL_NETWORK + - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME + - IMAGE_PROPERTIES=$IMAGE_PROPERTIES + published_ports: container: 'functest-smoke' test: - tempest_neutron @@ -335,66 +362,53 @@ - tempest_heat - tempest_telemetry - rally_sanity - - refstack_defcore - refstack_compute - refstack_object - refstack_platform - tempest_full - tempest_scenario - tempest_slow - - patrole - patrole_admin - patrole_member - patrole_reader - - networking-bgpvpn - - networking-sfc - tempest_barbican - tempest_octavia - tempest_cyborg privileged: 'false' network: bridge - exclude: - - {'tag': 'latest', 'test': 'refstack_defcore'} - - {'tag': 'latest', 'test': 'networking-bgpvpn'} - - {'tag': 'latest', 'test': 'networking-sfc'} - - {'tag': 'latest', 'test': 'patrole'} - - {'tag': 'leguer', 'test': 'refstack_defcore'} - - {'tag': 'leguer', 'test': 'networking-bgpvpn'} - - {'tag': 'leguer', 'test': 'networking-sfc'} - - {'tag': 'leguer', 'test': 'patrole'} - - {'tag': 'kali', 'test': 'refstack_defcore'} - - {'tag': 'kali', 'test': 'networking-bgpvpn'} - - {'tag': 'kali', 'test': 'networking-sfc'} - - {'tag': 'kali', 'test': 'patrole_admin'} - - {'tag': 'kali', 'test': 'patrole_member'} - - {'tag': 'kali', 'test': 'patrole_reader'} - - {'tag': 'jerma', 'test': 'refstack_defcore'} - - {'tag': 'jerma', 'test': 'networking-bgpvpn'} - - {'tag': 'jerma', 'test': 'networking-sfc'} - - {'tag': 'jerma', 'test': 'patrole_admin'} - - {'tag': 'jerma', 'test': 'patrole_member'} - - {'tag': 'jerma', 'test': 'patrole_reader'} - - {'tag': 'jerma', 'test': 'tempest_cyborg'} - - {'tag': 'iruya', 'test': 'refstack_defcore'} - - {'tag': 'iruya', 'test': 'patrole_admin'} - - {'tag': 'iruya', 'test': 'patrole_member'} - - {'tag': 'iruya', 'test': 'patrole_reader'} - - {'tag': 'iruya', 'test': 'tempest_cyborg'} - - {'tag': 'hunter', 'test': 'refstack_compute'} - - {'tag': 'hunter', 'test': 'refstack_object'} - - {'tag': 'hunter', 'test': 'refstack_platform'} - - {'tag': 'hunter', 'test': 'tempest_octavia'} - - {'tag': 'hunter', 'test': 'tempest_telemetry'} - - {'tag': 'hunter', 'test': 'patrole_admin'} - - {'tag': 'hunter', 'test': 'patrole_member'} - - {'tag': 'hunter', 'test': 'patrole_reader'} - - {'tag': 'hunter', 'test': 'tempest_cyborg'} + uid: 1000 + gid: 1000 jobs: - - 'functest-{repo}-{container}-{tag}-{test}-run' + - 'functest-opnfv-functest-smoke-{tag}-{test}-run' + +- job-template: + name: 'functest-opnfv-functest-smoke-cntt-{tag}-{test}-run' + parameters: + - functest-node: + node: '{node}' + - functest-build_tag: + build_tag: '' + - functest-EXTERNAL_NETWORK: + EXTERNAL_NETWORK: public + - functest-VOLUME_DEVICE_NAME: + VOLUME_DEVICE_NAME: sdb + - functest-IMAGE_PROPERTIES: + IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi + builders: + - functest-run-containers: + <<: *functest-run-containers - project: name: 'functest-opnfv-functest-smoke-cntt' <<: *functest-params + volumes: + - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file + - /home/opnfv/functest/images:/home/opnfv/functest/images + env: + - EXTERNAL_NETWORK=$EXTERNAL_NETWORK + - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME + - IMAGE_PROPERTIES=$IMAGE_PROPERTIES + published_ports: container: 'functest-smoke-cntt' test: - tempest_neutron_cntt @@ -407,12 +421,39 @@ - tempest_slow_cntt privileged: 'false' network: bridge + uid: 1000 + gid: 1000 jobs: - - 'functest-{repo}-{container}-{tag}-{test}-run' + - 'functest-opnfv-functest-smoke-cntt-{tag}-{test}-run' + +- job-template: + name: 'functest-opnfv-functest-benchmarking-{tag}-{test}-run' + parameters: + - functest-node: + node: '{node}' + - functest-build_tag: + build_tag: '' + - functest-EXTERNAL_NETWORK: + EXTERNAL_NETWORK: public + - functest-VOLUME_DEVICE_NAME: + VOLUME_DEVICE_NAME: sdb + - functest-IMAGE_PROPERTIES: + IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi + builders: + - functest-run-containers: + <<: *functest-run-containers - project: name: 'functest-opnfv-functest-benchmarking' <<: *functest-params + volumes: + - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file + - /home/opnfv/functest/images:/home/opnfv/functest/images + env: + - EXTERNAL_NETWORK=$EXTERNAL_NETWORK + - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME + - IMAGE_PROPERTIES=$IMAGE_PROPERTIES + published_ports: container: 'functest-benchmarking' test: - rally_full @@ -421,24 +462,78 @@ - shaker privileged: 'false' network: bridge + uid: 1000 + gid: 1000 jobs: - - 'functest-{repo}-{container}-{tag}-{test}-run' + - 'functest-opnfv-functest-benchmarking-{tag}-{test}-run' + +- job-template: + name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-{test}-run' + parameters: + - functest-node: + node: '{node}' + - functest-build_tag: + build_tag: '' + - functest-EXTERNAL_NETWORK: + EXTERNAL_NETWORK: public + - functest-VOLUME_DEVICE_NAME: + VOLUME_DEVICE_NAME: sdb + - functest-IMAGE_PROPERTIES: + IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi + builders: + - functest-run-containers: + <<: *functest-run-containers - project: name: 'functest-opnfv-functest-benchmarking-cntt' <<: *functest-params + volumes: + - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file + - /home/opnfv/functest/images:/home/opnfv/functest/images + env: + - EXTERNAL_NETWORK=$EXTERNAL_NETWORK + - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME + - IMAGE_PROPERTIES=$IMAGE_PROPERTIES + published_ports: container: 'functest-benchmarking-cntt' test: - rally_full_cntt - rally_jobs_cntt privileged: 'false' network: bridge + uid: 1000 + gid: 1000 jobs: - - 'functest-{repo}-{container}-{tag}-{test}-run' + - 'functest-opnfv-functest-benchmarking-cntt-{tag}-{test}-run' + +- job-template: + name: 'functest-opnfv-functest-vnf-{tag}-{test}-run' + parameters: + - functest-node: + node: '{node}' + - functest-build_tag: + build_tag: '' + - functest-EXTERNAL_NETWORK: + EXTERNAL_NETWORK: public + - functest-VOLUME_DEVICE_NAME: + VOLUME_DEVICE_NAME: sdb + - functest-IMAGE_PROPERTIES: + IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi + builders: + - functest-run-containers: + <<: *functest-run-containers - project: name: 'functest-opnfv-functest-vnf' <<: *functest-params + volumes: + - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file + - /home/opnfv/functest/images:/home/opnfv/functest/images + env: + - EXTERNAL_NETWORK=$EXTERNAL_NETWORK + - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME + - IMAGE_PROPERTIES=$IMAGE_PROPERTIES + published_ports: container: 'functest-vnf' test: - cloudify @@ -448,15 +543,32 @@ - juju_epc privileged: 'false' network: bridge + uid: 1000 + gid: 1000 jobs: - - 'functest-{repo}-{container}-{tag}-{test}-run' - + - 'functest-opnfv-functest-vnf-{tag}-{test}-run' - builder: name: functest-zip builders: - shell: | set +x + volumes=; + if [ "{volumes}" != "None" ]; then + for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \ + do volumes="-v $i $volumes"; done + fi + env=; + if [ "{env}" != "None" ]; then + for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \ + do env="-e $i $env"; done + fi + published_ports=; + if [ "{published_ports}" != "None" ]; then + for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \ + do published_ports="-p $i $published_ports"; done + fi + [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true if [ "{repo}" = "_" ]; then image={container}:{tag} elif [ "{port}" = "None" ]; then @@ -464,27 +576,27 @@ else image={repo}:{port}/{container}:{tag} fi + sudo mkdir -p $WORKSPACE/results + sudo chown {uid}:{gid} $WORKSPACE/results sudo docker run --rm \ + $volumes \ + $env \ + $published_ports \ -e S3_ENDPOINT_URL=https://storage.googleapis.com \ -e S3_DST_URL=s3://artifacts.opnfv.org/functest \ -e HTTP_DST_URL=http://artifacts.opnfv.org/functest \ - -v /home/opnfv/functest/.boto:/root/.boto \ + -v /home/opnfv/functest/.boto:/etc/boto.cfg \ -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \ -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \ -e BUILD_TAG=$BUILD_TAG \ -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \ - -e EXTERNAL_NETWORK=$EXTERNAL_NETWORK \ - -e VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME \ - -e IMAGE_PROPERTIES=$IMAGE_PROPERTIES \ - -v /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file \ - -v /home/opnfv/functest/images:/home/opnfv/functest/images \ $image zip_campaign - job-template: name: 'functest-{tag}-zip' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' - functest-build_tag: build_tag: '' - functest-EXTERNAL_NETWORK: @@ -496,11 +608,26 @@ builders: - functest-zip: <<: *functest-containers + volumes: '{volumes}' + env: '{env}' + uid: '{uid}' + gid: '{gid}' + published_ports: '{published_ports}' - project: name: 'functest-{tag}-zip' <<: *functest-params + volumes: + - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file + - /home/opnfv/functest/images:/home/opnfv/functest/images + env: + - EXTERNAL_NETWORK=$EXTERNAL_NETWORK + - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME + - IMAGE_PROPERTIES=$IMAGE_PROPERTIES + published_ports: container: 'functest-healthcheck' + uid: 1000 + gid: 1000 jobs: - 'functest-{tag}-zip' @@ -510,8 +637,8 @@ triggers: - timed: '@weekly' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' - functest-build_tag: build_tag: '' - functest-EXTERNAL_NETWORK: @@ -520,12 +647,14 @@ VOLUME_DEVICE_NAME: sdb - functest-IMAGE_PROPERTIES: IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi + # PyYAML and yamllint differ here + # see https://github.com/yaml/pyyaml/issues/234 + # yamllint disable rule:indentation properties: - build-blocker: - use-build-blocker: true - blocking-level: 'NODE' blocking-jobs: - - '^functest-{tag}-(daily|docker|review)$' + - ^functest-(pi-)*{tag}-(daily|docker|review)$ + # yamllint enable rule:indentation builders: - multijob: name: remove former images @@ -601,8 +730,6 @@ <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-rally_sanity-run' <<: *functest-jobs - - name: 'functest-opnfv-functest-smoke-{tag}-refstack_defcore-run' - <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-refstack_compute-run' <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-refstack_object-run' @@ -615,18 +742,12 @@ <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-tempest_slow-run' <<: *functest-jobs - - name: 'functest-opnfv-functest-smoke-{tag}-patrole-run' - <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-patrole_admin-run' <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-patrole_member-run' <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-patrole_reader-run' <<: *functest-jobs - - name: 'functest-opnfv-functest-smoke-{tag}-networking-bgpvpn-run' - <<: *functest-jobs - - name: 'functest-opnfv-functest-smoke-{tag}-networking-sfc-run' - <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-tempest_barbican-run' <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-tempest_octavia-run' @@ -688,6 +809,75 @@ projects: - name: 'functest-{tag}-zip' <<: *functest-jobs + publishers: + - email-ext: + failure: false + first-failure: true + fixed: true + recipients: cedric.ollivier@orange.com + +- project: + name: 'functest-daily' + <<: *functest-params + jobs: + - 'functest-{tag}-daily' + +- view: + name: functest + view-type: list + columns: + - status + - weather + - job + - last-success + - last-failure + - last-duration + regex: ^functest-[a-z0-9.]+-daily$ + +- functest-build-containers: &functest-build-containers + name: 'functest-build-containers' + <<: *functest-containers + ref_arg: '{ref_arg}' + path: '{path}' + build_args: '{build_args}' + from: '{from}' + +- builder: + name: functest-build-containers + builders: + - shell: | + set +x + if [ "{repo}" = "_" ]; then + image={container}:{tag} + elif [ "{port}" = "None" ]; then + image={repo}/{container}:{tag} + else + image={repo}:{port}/{container}:{tag} + fi + build_args="" + if [ "{build_args}" != "None" ]; then + for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \ + do build_args="--build-arg $i $build_args"; done + fi + if [ "{ref_arg}" != "None" ]; then + build_args="$build_args --build-arg {ref_arg}={ref}" + fi + cd {path} + if [ "{from}" != "None" ]; then + sed -i {from} Dockerfile + fi + sudo docker build $build_args \ + --pull=false --no-cache --force-rm=true \ + -t $image . + +- scm: + name: functest-scm + scm: + - git: + url: 'https://gerrit.opnfv.org/gerrit/functest' + refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*' + branches: + - '{ref}' - functest-dep: &functest-dep name: 'functest-containers' @@ -703,10 +893,10 @@ set +x if [ "_" = "_" ]; then image=alpine:{dependency} - elif [ "_" = "None" ]; then + elif [ "None" = "None" ]; then image=_/alpine:{dependency} else - image=_:/alpine{dependency} + image=_:/alpine:{dependency} fi sudo docker pull $image || true @@ -717,18 +907,18 @@ set +x if [ "_" = "_" ]; then image=alpine:{dependency} - elif [ "_" = "None" ]; then + elif [ "" = "None" ]; then image=_/alpine:{dependency} else - image=_:/alpine{dependency} + image=_:/alpine:{dependency} fi sudo docker rmi $image || true - job-template: name: 'functest-{repo}-{tag}-dep-pull' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' builders: - functest-pull-dep-images: <<: *functest-dep @@ -742,8 +932,8 @@ - job-template: name: 'functest-{repo}-{tag}-dep-rmi' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' builders: - functest-remove-dep-images: <<: *functest-dep @@ -759,13 +949,22 @@ builders: - shell: | set +x - sudo apt-get update && sudo apt-get install software-properties-common gpg -y + sudo apt-get -o DPkg::Lock::Timeout=300 update && \ + sudo DEBIAN_FRONTEND=noninteractive apt-get \ + -o DPkg::Lock::Timeout=300 dist-upgrade -y + sudo DEBIAN_FRONTEND=noninteractive \ + apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y sudo add-apt-repository -y ppa:deadsnakes/ppa - sudo apt-get update && sudo apt-get install python3.8 python3.8-dev \ - python3.8-distutils \ - python3.7 python3.7-dev python3.6 python3.6-dev \ - python python-dev python3-pip enchant -y + sudo apt-get -o DPkg::Lock::Timeout=300 update && \ + sudo DEBIAN_FRONTEND=noninteractive apt-get \ + -o DPkg::Lock::Timeout=300 install \ + libxml2-dev libxslt-dev libffi-dev libjpeg-dev \ + python3.10 python3.10-dev python3.10-distutils \ + python3.9 python3.9-dev python3.9-distutils \ + python3.8 python3.8-dev python3.8-distutils \ + python3-pip enchant-2 -y sudo pip3 install tox tox-pip-version + tox - job-template: @@ -777,8 +976,8 @@ - functest-patchset-created: branch: '{branch}' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' builders: - functest-tox: @@ -788,6 +987,20 @@ jobs: - 'functest-{tag}-tox' +- job-template: + name: 'functest-{repo}-{container}-{tag}-gate' + parameters: + - functest-node: + node: '{node}' + scm: + - functest-scm: + ref: $GERRIT_REFSPEC + builders: + - functest-build-containers: + <<: *functest-build-containers + ref: $GERRIT_REFSPEC + build_args: '{build_args}' + - project: name: functest-opnfv-functest-core-{tag}-gate <<: *functest-params @@ -851,20 +1064,6 @@ jobs: - 'functest-{repo}-{container}-{tag}-gate' - -- job-template: - name: 'functest-{repo}-{container}-{tag}-gate' - parameters: - - functest-slave: - slave: '{slave}' - scm: - - functest-scm: - ref: $GERRIT_REFSPEC - builders: - - functest-build-containers: - <<: *functest-build-containers - ref: $GERRIT_REFSPEC - - trigger: name: functest-patchset-created triggers: @@ -889,8 +1088,8 @@ - functest-patchset-created: branch: '{branch}' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' - functest-build_tag: build_tag: '' - functest-EXTERNAL_NETWORK: @@ -899,12 +1098,14 @@ VOLUME_DEVICE_NAME: sdb - functest-IMAGE_PROPERTIES: IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi + # PyYAML and yamllint differ here + # see https://github.com/yaml/pyyaml/issues/234 + # yamllint disable rule:indentation properties: - build-blocker: - use-build-blocker: true - blocking-level: 'NODE' blocking-jobs: - - '^functest-{tag}-(daily|docker|review)$' + - ^functest-(pi-)*{tag}-(daily|docker|review)$ + # yamllint enable rule:indentation builders: - multijob: name: remove former images @@ -998,8 +1199,6 @@ <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-rally_sanity-run' <<: *functest-jobs - - name: 'functest-opnfv-functest-smoke-{tag}-refstack_defcore-run' - <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-refstack_compute-run' <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-refstack_object-run' @@ -1012,18 +1211,12 @@ <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-tempest_slow-run' <<: *functest-jobs - - name: 'functest-opnfv-functest-smoke-{tag}-patrole-run' - <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-patrole_admin-run' <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-patrole_member-run' <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-patrole_reader-run' <<: *functest-jobs - - name: 'functest-opnfv-functest-smoke-{tag}-networking-bgpvpn-run' - <<: *functest-jobs - - name: 'functest-opnfv-functest-smoke-{tag}-networking-sfc-run' - <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-tempest_barbican-run' <<: *functest-jobs - name: 'functest-opnfv-functest-smoke-{tag}-tempest_octavia-run' @@ -1080,6 +1273,42 @@ <<: *functest-jobs - name: 'functest-opnfv-functest-vnf-{tag}-juju_epc-run' <<: *functest-jobs + publishers: + - email-ext: + failure: false + first-failure: true + fixed: true + recipients: cedric.ollivier@orange.com + +- project: + name: 'functest-review' + <<: *functest-params + jobs: + - 'functest-{tag}-review' + +- view: + name: functest-review + view-type: list + columns: + - status + - weather + - job + - last-success + - last-failure + - last-duration + regex: ^functest-[a-z0-9.]+-review$ + +- view: + name: functest-tox + view-type: list + columns: + - status + - weather + - job + - last-success + - last-failure + - last-duration + regex: ^functest-[a-z0-9.]+-tox$ - builder: name: functest-push-containers @@ -1104,8 +1333,8 @@ - job-template: name: 'functest-{repo}-{container}-{tag}-build' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' scm: - functest-scm: ref: '{branch}' @@ -1113,6 +1342,7 @@ - functest-build-containers: <<: *functest-build-containers ref: '{branch}' + build_args: '{build_args}' - functest-push-containers: <<: *functest-build-containers ref: '{branch}' @@ -1180,7 +1410,6 @@ jobs: - 'functest-{repo}-{container}-{tag}-build' - - job-template: name: 'functest-{tag}-docker' project-type: multijob @@ -1190,14 +1419,16 @@ - functest-scm: ref: '{branch}' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' + # PyYAML and yamllint differ here + # see https://github.com/yaml/pyyaml/issues/234 + # yamllint disable rule:indentation properties: - build-blocker: - use-build-blocker: true - blocking-level: 'NODE' blocking-jobs: - - '^functest-{tag}-(daily|docker|review)$' + - ^functest-(pi-)*{tag}-(daily|docker|review)$ + # yamllint enable rule:indentation builders: - multijob: name: remove dependency @@ -1232,12 +1463,21 @@ <<: *functest-jobs - name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-build' <<: *functest-jobs + publishers: + - email-ext: + failure: false + first-failure: true + fixed: true + recipients: cedric.ollivier@orange.com - builder: name: functest-trivy builders: - shell: | - sudo apt-get update && sudo apt-get install curl -y + sudo apt-get -o DPkg::Lock::Timeout=300 update && \ + sudo DEBIAN_FRONTEND=noninteractive apt-get \ + -o DPkg::Lock::Timeout=300 install curl -y + curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b . if [ "{repo}" = "_" ]; then image={container}:{tag} @@ -1246,18 +1486,31 @@ else image={repo}:{port}/{container}:{tag} fi - ./trivy --exit-code 1 $image + ./trivy image --exit-code 1 $image - job-template: name: 'functest-{repo}-{container}-{tag}-trivy' triggers: - timed: '@weekly' parameters: - - functest-slave: - slave: '{slave}' + - functest-node: + node: '{node}' builders: - functest-trivy: <<: *functest-containers + publishers: + - email-ext: + failure: false + first-failure: true + fixed: true + recipients: cedric.ollivier@orange.com + +- project: + name: 'functest-opnfv-functest-core-trivy' + <<: *functest-params + container: 'functest-core' + jobs: + - 'functest-{repo}-{container}-{tag}-trivy' - project: name: 'functest-opnfv-functest-healthcheck-trivy' @@ -1265,59 +1518,219 @@ container: 'functest-healthcheck' jobs: - 'functest-{repo}-{container}-{tag}-trivy' + - project: name: 'functest-opnfv-functest-smoke-trivy' <<: *functest-params container: 'functest-smoke' jobs: - 'functest-{repo}-{container}-{tag}-trivy' + - project: - name: 'functest-opnfv-functest-smoke-cntt-trivy' + name: 'functest-opnfv-functest-benchmarking-trivy' <<: *functest-params - container: 'functest-smoke-cntt' + container: 'functest-benchmarking' jobs: - 'functest-{repo}-{container}-{tag}-trivy' + - project: - name: 'functest-opnfv-functest-benchmarking-trivy' + name: 'functest-opnfv-functest-vnf-trivy' <<: *functest-params - container: 'functest-benchmarking' + container: 'functest-vnf' + jobs: + - 'functest-{repo}-{container}-{tag}-trivy' + +- project: + name: 'functest-opnfv-functest-smoke-cntt-trivy' + <<: *functest-params + container: 'functest-smoke-cntt' jobs: - 'functest-{repo}-{container}-{tag}-trivy' + - project: name: 'functest-opnfv-functest-benchmarking-cntt-trivy' <<: *functest-params container: 'functest-benchmarking-cntt' jobs: - 'functest-{repo}-{container}-{tag}-trivy' + +- builder: + name: functest-grype + builders: + - shell: | + sudo apt-get -o DPkg::Lock::Timeout=300 update && \ + sudo DEBIAN_FRONTEND=noninteractive apt-get \ + -o DPkg::Lock::Timeout=300 install curl -y + + curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b . + if [ "{repo}" = "_" ]; then + image={container}:{tag} + elif [ "{port}" = "None" ]; then + image={repo}/{container}:{tag} + else + image={repo}:{port}/{container}:{tag} + fi + ./grype -q $image + +- job-template: + name: 'functest-{repo}-{container}-{tag}-grype' + triggers: + - timed: '@weekly' + parameters: + - functest-node: + node: '{node}' + builders: + - functest-grype: + <<: *functest-containers + publishers: + - email-ext: + failure: false + first-failure: true + fixed: true + recipients: cedric.ollivier@orange.com + - project: - name: 'functest-opnfv-functest-vnf-trivy' + name: 'functest-opnfv-functest-core-grype' + <<: *functest-params + container: 'functest-core' + jobs: + - 'functest-{repo}-{container}-{tag}-grype' + +- project: + name: 'functest-opnfv-functest-healthcheck-grype' + <<: *functest-params + container: 'functest-healthcheck' + jobs: + - 'functest-{repo}-{container}-{tag}-grype' + +- project: + name: 'functest-opnfv-functest-smoke-grype' + <<: *functest-params + container: 'functest-smoke' + jobs: + - 'functest-{repo}-{container}-{tag}-grype' + +- project: + name: 'functest-opnfv-functest-benchmarking-grype' + <<: *functest-params + container: 'functest-benchmarking' + jobs: + - 'functest-{repo}-{container}-{tag}-grype' + +- project: + name: 'functest-opnfv-functest-vnf-grype' <<: *functest-params container: 'functest-vnf' jobs: - - 'functest-{repo}-{container}-{tag}-trivy' + - 'functest-{repo}-{container}-{tag}-grype' + +- project: + name: 'functest-opnfv-functest-smoke-cntt-grype' + <<: *functest-params + container: 'functest-smoke-cntt' + jobs: + - 'functest-{repo}-{container}-{tag}-grype' + +- project: + name: 'functest-opnfv-functest-benchmarking-cntt-grype' + <<: *functest-params + container: 'functest-benchmarking-cntt' + jobs: + - 'functest-{repo}-{container}-{tag}-grype' + +- builder: + name: functest-sbom + builders: + - shell: | + sudo apt-get -o DPkg::Lock::Timeout=300 update && \ + sudo DEBIAN_FRONTEND=noninteractive apt-get \ + -o DPkg::Lock::Timeout=300 install curl -y + + sudo mkdir -p ~/.docker + curl -sSfL https://raw.githubusercontent.com/docker/sbom-cli-plugin/main/install.sh | sudo sh -s -- + if [ "{repo}" = "_" ]; then + image={container}:{tag} + elif [ "{port}" = "None" ]; then + image={repo}/{container}:{tag} + else + image={repo}:{port}/{container}:{tag} + fi + sudo docker sbom $image + +- job-template: + name: 'functest-{repo}-{container}-{tag}-sbom' + triggers: + - timed: '@weekly' + parameters: + - functest-node: + node: '{node}' + builders: + - functest-sbom: + <<: *functest-containers + publishers: + - email-ext: + failure: false + first-failure: true + fixed: true + recipients: cedric.ollivier@orange.com + +- project: + name: 'functest-opnfv-functest-core-sbom' + <<: *functest-params + container: 'functest-core' + jobs: + - 'functest-{repo}-{container}-{tag}-sbom' + +- project: + name: 'functest-opnfv-functest-healthcheck-sbom' + <<: *functest-params + container: 'functest-healthcheck' + jobs: + - 'functest-{repo}-{container}-{tag}-sbom' + +- project: + name: 'functest-opnfv-functest-smoke-sbom' + <<: *functest-params + container: 'functest-smoke' + jobs: + - 'functest-{repo}-{container}-{tag}-sbom' + +- project: + name: 'functest-opnfv-functest-benchmarking-sbom' + <<: *functest-params + container: 'functest-benchmarking' + jobs: + - 'functest-{repo}-{container}-{tag}-sbom' + +- project: + name: 'functest-opnfv-functest-vnf-sbom' + <<: *functest-params + container: 'functest-vnf' + jobs: + - 'functest-{repo}-{container}-{tag}-sbom' + +- project: + name: 'functest-opnfv-functest-smoke-cntt-sbom' + <<: *functest-params + container: 'functest-smoke-cntt' + jobs: + - 'functest-{repo}-{container}-{tag}-sbom' + +- project: + name: 'functest-opnfv-functest-benchmarking-cntt-sbom' + <<: *functest-params + container: 'functest-benchmarking-cntt' + jobs: + - 'functest-{repo}-{container}-{tag}-sbom' - project: name: 'functest' <<: *functest-params jobs: - - 'functest-{tag}-daily' - - 'functest-{tag}-review' - 'functest-{tag}-docker' - view: - name: functest - view-type: list - columns: - - status - - weather - - job - - last-success - - last-failure - - last-duration - regex: ^functest-[a-z0-9]+-daily$ - -- view: - name: functest-review + name: functest-docker view-type: list columns: - status @@ -1326,10 +1739,10 @@ - last-success - last-failure - last-duration - regex: ^functest-[a-z0-9]+-review$ + regex: ^functest-[a-z0-9.]+-docker$ - view: - name: functest-tox + name: functest-trivy view-type: list columns: - status @@ -1338,10 +1751,10 @@ - last-success - last-failure - last-duration - regex: ^functest-[a-z0-9]+-tox$ + regex: (?!functest-kubernetes)(?!functest-pi)^functest-[a-z-0-9.]+-trivy$ - view: - name: functest-docker + name: functest-grype view-type: list columns: - status @@ -1350,10 +1763,10 @@ - last-success - last-failure - last-duration - regex: ^functest-[a-z0-9]+-docker$ + regex: (?!functest-kubernetes)(?!functest-pi)^functest-[a-z-0-9.]+-grype$ - view: - name: functest-trivy + name: functest-sbom view-type: list columns: - status @@ -1362,4 +1775,4 @@ - last-success - last-failure - last-duration - regex: (?!functest-kubernetes)^functest-[a-z-0-9]+-trivy$ + regex: (?!functest-kubernetes)(?!functest-pi)^functest-[a-z-0-9.]+-sbom$