diff options
-rwxr-xr-x | jjb/armband/armband-deploy.sh | 25 | ||||
-rw-r--r-- | prototypes/bifrost/README.md | 10 | ||||
-rw-r--r-- | prototypes/bifrost/playbooks/test-bifrost-infracloud.yaml | 17 | ||||
-rwxr-xr-x | prototypes/bifrost/scripts/destroy-env.sh | 2 | ||||
-rwxr-xr-x | prototypes/bifrost/scripts/test-bifrost-deployment.sh | 7 | ||||
-rwxr-xr-x | utils/test/reporting/functest/reporting-status.py | 2 | ||||
-rwxr-xr-x | utils/test/reporting/functest/reporting-tempest.py | 4 | ||||
-rwxr-xr-x | utils/test/reporting/functest/reporting-vims.py | 4 | ||||
-rw-r--r-- | utils/test/reporting/functest/reportingConf.py | 2 | ||||
-rw-r--r-- | utils/test/reporting/functest/reportingUtils.py | 4 | ||||
-rw-r--r-- | utils/test/reporting/yardstick/reporting-status.py | 2 | ||||
-rw-r--r-- | utils/test/reporting/yardstick/reportingConf.py | 2 |
12 files changed, 63 insertions, 18 deletions
diff --git a/jjb/armband/armband-deploy.sh b/jjb/armband/armband-deploy.sh index fb4c1ead5..4041a6b14 100755 --- a/jjb/armband/armband-deploy.sh +++ b/jjb/armband/armband-deploy.sh @@ -62,8 +62,13 @@ fi # releng wants us to use nothing else but opnfv.iso for now. We comply. ISO_FILE=$WORKSPACE/opnfv.iso +# log file name +FUEL_LOG_FILENAME="${JOB_NAME}_${BUILD_NUMBER}.log.tar.gz" + # construct the command -DEPLOY_COMMAND="$WORKSPACE/ci/deploy.sh -l $LAB_NAME -p $POD_NAME -b ${LAB_CONFIG_URL} -s $DEPLOY_SCENARIO -i file://${ISO_FILE} -H -B ${DEFAULT_BRIDGE:-pxebr} -S $TMPDIR" +DEPLOY_COMMAND="$WORKSPACE/ci/deploy.sh -b ${LAB_CONFIG_URL} \ + -l $LAB_NAME -p $POD_NAME -s $DEPLOY_SCENARIO -i file://${ISO_FILE} \ + -H -B ${DEFAULT_BRIDGE:-pxebr} -S $TMPDIR -L $WORKSPACE/$FUEL_LOG_FILENAME" # log info to console echo "Deployment parameters" @@ -83,7 +88,23 @@ echo "$DEPLOY_COMMAND" echo $DEPLOY_COMMAND +exit_code=$? echo echo "--------------------------------------------------------" -echo "Deployment is done successfully!" +echo "Deployment is done!" + +# upload logs for baremetal deployments +# work with virtual deployments is still going on so we skip that for the timebeing +if [[ "$JOB_NAME" =~ "baremetal-daily" ]]; then + echo "Uploading deployment logs" + gsutil cp $WORKSPACE/$FUEL_LOG_FILENAME gs://$GS_URL/logs/$FUEL_LOG_FILENAME > /dev/null 2>&1 + echo "Logs are available as http://$GS_URL/logs/$FUEL_LOG_FILENAME" +fi + +if [[ $exit_code -ne 0 ]]; then + echo "Deployment failed!" + exit $exit_code +else + echo "Deployment is successful!" +fi diff --git a/prototypes/bifrost/README.md b/prototypes/bifrost/README.md index f50ffb217..4bba0dbc0 100644 --- a/prototypes/bifrost/README.md +++ b/prototypes/bifrost/README.md @@ -21,12 +21,14 @@ Please follow that steps: cp -R /opt/releng/prototypes/bifrost/* /opt/bifrost/ -5. Run destroy script if you need to cleanup previous environment:: +5. If you are on a RHEL/CentOS box, ensure that selinux is disabled + +6. Run destroy script if you need to cleanup previous environment:: cd /opt/bifrost ./scripts/destroy-env.sh -6. Run deployment script to spin up 3 vms with bifrost: jumphost, controller and compute:: +7. Run deployment script to spin up 3 vms with bifrost: jumphost, controller and compute:: cd /opt/bifrost ./scripts/test-bifrost-deployment.sh @@ -39,10 +41,10 @@ It is likely that the script will show some errors due to timeout. Please ignore And wait until all the vms are in **active** Provisioning State. -7. Check the IPs assigned to each of the VMS. You can check it by looking at inventory: +8. Check the IPs assigned to each of the VMS. You can check it by looking at inventory: cat /tmp/baremetal.csv -8. You can enter into the vms with devuser login/pass: +9. You can enter into the vms with devuser login/pass: ssh devuser@192.168.122.2 diff --git a/prototypes/bifrost/playbooks/test-bifrost-infracloud.yaml b/prototypes/bifrost/playbooks/test-bifrost-infracloud.yaml index ba548b305..b4dffdccf 100644 --- a/prototypes/bifrost/playbooks/test-bifrost-infracloud.yaml +++ b/prototypes/bifrost/playbooks/test-bifrost-infracloud.yaml @@ -41,8 +41,21 @@ # NOTE(TheJulia): While the next step creates a ramdisk, some elements # do not support ramdisk-image-create as they invoke steps to cleanup # the ramdisk which causes ramdisk-image-create to believe it failed. - - { role: bifrost-create-dib-image, dib_imagename: "{{ http_boot_folder }}/ipa", build_ramdisk: false, dib_os_element: "{{ ipa_dib_os_element|default('debian') }}", dib_os_release: "jessie", dib_elements: "ironic-agent {{ ipa_extra_dib_elements | default('') }}", when: create_ipa_image | bool == true } - - { role: bifrost-create-dib-image, dib_imagetype: "qcow2", dib_imagename: "{{deploy_image}}", dib_os_element: "ubuntu-minimal", dib_os_release: "trusty", dib_elements: "vm serial-console simple-init devuser infra-cloud-bridge puppet growroot {{ extra_dib_elements|default('') }}", dib_packages: "openssh-server,vlan,vim,less,bridge-utils,language-pack-en,iputils-ping,rsyslog,curl", when: create_image_via_dib | bool == true and transform_boot_image | bool == false } + - role: bifrost-create-dib-image + dib_imagename: "{{ http_boot_folder }}/ipa" + build_ramdisk: false + dib_os_element: "{{ ipa_dib_os_element|default('debian') }}" + dib_os_release: "jessie" + dib_elements: "ironic-agent {{ ipa_extra_dib_elements | default('') }}" + when: create_ipa_image | bool == true + - role: bifrost-create-dib-image + dib_imagetype: "qcow2" + dib_imagename: "{{deploy_image}}" + dib_os_element: "{{ lookup('env','DIB_OS_ELEMENT') }}" + dib_os_release: "{{ lookup('env', 'DIB_OS_RELEASE') }}" + dib_elements: "vm serial-console simple-init devuser infra-cloud-bridge puppet growroot {{ extra_dib_elements|default('') }}" + dib_packages: "{{ lookup('env', 'DIB_OS_PACKAGES') }}" + when: create_image_via_dib | bool == true and transform_boot_image | bool == false environment: http_proxy: "{{ lookup('env','http_proxy') }}" https_proxy: "{{ lookup('env','https_proxy') }}" diff --git a/prototypes/bifrost/scripts/destroy-env.sh b/prototypes/bifrost/scripts/destroy-env.sh index 4dffee62a..f092a658a 100755 --- a/prototypes/bifrost/scripts/destroy-env.sh +++ b/prototypes/bifrost/scripts/destroy-env.sh @@ -27,6 +27,8 @@ echo "removing logs" rm -rf /var/log/libvirt/baremetal_logs/*.log # clean up dib images only if requested explicitly +CLEAN_DIB_IMAGES=${CLEAN_DIB_IMAGES:-false} + if [ $CLEAN_DIB_IMAGES = "true" ]; then rm -rf /httpboot/* rm -rf /tftpboot/* diff --git a/prototypes/bifrost/scripts/test-bifrost-deployment.sh b/prototypes/bifrost/scripts/test-bifrost-deployment.sh index d796f3509..fb49afc42 100755 --- a/prototypes/bifrost/scripts/test-bifrost-deployment.sh +++ b/prototypes/bifrost/scripts/test-bifrost-deployment.sh @@ -57,6 +57,13 @@ export ELEMENTS_PATH=/usr/share/diskimage-builder/elements:/opt/puppet-infraclou export DIB_DEV_USER_PWDLESS_SUDO=yes export DIB_DEV_USER_PASSWORD=devuser +# settings for distro: trusty/ubuntu-minimal, 7/centos-minimal +export DIB_OS_RELEASE=${DIB_OS_RELEASE:-trusty} +export DIB_OS_ELEMENT=${DIB_OS_ELEMENT:-ubuntu-minimal} + +# for centos 7: "openssh-server,vim,less,bridge-utils,iputils,rsyslog,curl" +export DIB_OS_PACKAGES=${DIB_OS_PACKAGES:-"openssh-server,vlan,vim,less,bridge-utils,language-pack-en,iputils-ping,rsyslog,curl"} + # Source Ansible # NOTE(TheJulia): Ansible stable-1.9 source method tosses an error deep # under the hood which -x will detect, so for this step, we need to suspend diff --git a/utils/test/reporting/functest/reporting-status.py b/utils/test/reporting/functest/reporting-status.py index 7c943d8b3..e9e167d16 100755 --- a/utils/test/reporting/functest/reporting-status.py +++ b/utils/test/reporting/functest/reporting-status.py @@ -195,7 +195,7 @@ for version in conf.versions: logger.info("--------------------------") templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH) - templateEnv = jinja2.Environment(loader=templateLoader) + templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True) TEMPLATE_FILE = "/template/index-status-tmpl.html" template = templateEnv.get_template(TEMPLATE_FILE) diff --git a/utils/test/reporting/functest/reporting-tempest.py b/utils/test/reporting/functest/reporting-tempest.py index 0dc1dd343..363f123cf 100755 --- a/utils/test/reporting/functest/reporting-tempest.py +++ b/utils/test/reporting/functest/reporting-tempest.py @@ -28,7 +28,7 @@ logger.info("success rate > %s " % criteria_success_rate) for version in conf.versions: for installer in conf.installers: # we consider the Tempest results of the last PERIOD days - url = conf.URL_BASE + "?case=tempest_smoke_serial" + url = 'http://' + conf.URL_BASE + "?case=tempest_smoke_serial" request = Request(url + '&period=' + str(PERIOD) + '&installer=' + installer + '&version=' + version) @@ -116,7 +116,7 @@ for version in conf.versions: logger.error("Error field not present (Brahamputra runs?)") templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH) - templateEnv = jinja2.Environment(loader=templateLoader) + templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True) TEMPLATE_FILE = "/template/index-tempest-tmpl.html" template = templateEnv.get_template(TEMPLATE_FILE) diff --git a/utils/test/reporting/functest/reporting-vims.py b/utils/test/reporting/functest/reporting-vims.py index a83d92f0a..430a5453c 100755 --- a/utils/test/reporting/functest/reporting-vims.py +++ b/utils/test/reporting/functest/reporting-vims.py @@ -39,7 +39,7 @@ for version in conf.versions: for installer in installers: logger.info("Search vIMS results for installer: %s, version: %s" % (installer, version)) - request = Request(conf.URL_BASE + '?case=vims&installer=' + + request = Request("http://" + conf.URL_BASE + '?case=vims&installer=' + installer + '&version=' + version) try: @@ -102,7 +102,7 @@ for version in conf.versions: logger.debug("----------------------------------------") templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH) - templateEnv = jinja2.Environment(loader=templateLoader) + templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True) TEMPLATE_FILE = "/template/index-vims-tmpl.html" template = templateEnv.get_template(TEMPLATE_FILE) diff --git a/utils/test/reporting/functest/reportingConf.py b/utils/test/reporting/functest/reportingConf.py index 9230cb286..b0e4cf7a1 100644 --- a/utils/test/reporting/functest/reportingConf.py +++ b/utils/test/reporting/functest/reportingConf.py @@ -21,7 +21,7 @@ MAX_SCENARIO_CRITERIA = 50 NB_TESTS = 5 # REPORTING_PATH = "/usr/share/nginx/html/reporting/functest" REPORTING_PATH = "." -URL_BASE = 'http://testresults.opnfv.org/test/api/v1/results' +URL_BASE = 'testresults.opnfv.org/test/api/v1/results' TEST_CONF = "https://git.opnfv.org/cgit/functest/plain/ci/testcases.yaml" LOG_LEVEL = "ERROR" LOG_FILE = REPORTING_PATH + "/reporting.log" diff --git a/utils/test/reporting/functest/reportingUtils.py b/utils/test/reporting/functest/reportingUtils.py index 5051ffa95..f02620430 100644 --- a/utils/test/reporting/functest/reportingUtils.py +++ b/utils/test/reporting/functest/reportingUtils.py @@ -37,7 +37,7 @@ def getApiResults(case, installer, scenario, version): # urllib2.install_opener(opener) # url = "http://127.0.0.1:8000/results?case=" + case + \ # "&period=30&installer=" + installer - url = (conf.URL_BASE + "?case=" + case + + url = ("http://" + conf.URL_BASE + "?case=" + case + "&period=" + str(conf.PERIOD) + "&installer=" + installer + "&scenario=" + scenario + "&version=" + version + "&last=" + str(conf.NB_TESTS)) @@ -56,7 +56,7 @@ def getApiResults(case, installer, scenario, version): def getScenarios(case, installer, version): case = case.getName() - url = (conf.URL_BASE + "?case=" + case + + url = ("http://" + conf.URL_BASE + "?case=" + case + "&period=" + str(conf.PERIOD) + "&installer=" + installer + "&version=" + version) request = Request(url) diff --git a/utils/test/reporting/yardstick/reporting-status.py b/utils/test/reporting/yardstick/reporting-status.py index ed5dab044..546bf08c4 100644 --- a/utils/test/reporting/yardstick/reporting-status.py +++ b/utils/test/reporting/yardstick/reporting-status.py @@ -59,7 +59,7 @@ for version in conf.versions: logger.info("--------------------------") templateLoader = jinja2.FileSystemLoader(conf.REPORTING_PATH) - templateEnv = jinja2.Environment(loader=templateLoader) + templateEnv = jinja2.Environment(loader=templateLoader, autoescape=True) TEMPLATE_FILE = "/template/index-status-tmpl.html" template = templateEnv.get_template(TEMPLATE_FILE) diff --git a/utils/test/reporting/yardstick/reportingConf.py b/utils/test/reporting/yardstick/reportingConf.py index 9e34034e2..447b428a8 100644 --- a/utils/test/reporting/yardstick/reportingConf.py +++ b/utils/test/reporting/yardstick/reportingConf.py @@ -11,7 +11,7 @@ # **************************************************** installers = ["apex", "compass", "fuel", "joid"] -versions = ["master", "stable/colorado"] +versions = ["master", "colorado"] # get data in the past 7 days PERIOD = 7 |