diff options
author | Joerg Hofrichter <joerg.hofrichter@ni.com> | 2020-01-17 15:22:32 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-06-10 12:01:53 -0500 |
commit | 13d26a062429adc17d94f63eed17e9d39bf8a567 (patch) | |
tree | b9d84b9281e1be1277d0c5211c4aa0454f91c974 /.ci | |
parent | 2a575bf9b5a4942f60e979161764b9e942699e1e (diff) | |
download | uhd-13d26a062429adc17d94f63eed17e9d39bf8a567.tar.gz uhd-13d26a062429adc17d94f63eed17e9d39bf8a567.tar.bz2 uhd-13d26a062429adc17d94f63eed17e9d39bf8a567.zip |
uhd: ci: Add test definition for UHD CI
Co-authored-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
Co-authored-by: Cristina Fuentes <cristina.fuentes@ni.com>
Diffstat (limited to '.ci')
-rw-r--r-- | .ci/oe-for-host.yml | 187 | ||||
-rw-r--r-- | .ci/oe-x4xx-packages.yml | 175 | ||||
-rw-r--r-- | .ci/uhd-build-docker-container.yml | 5 | ||||
-rw-r--r-- | .ci/uhd-pipeline.yml | 8 | ||||
-rw-r--r-- | .ci/x4xx-devtests.yml | 76 |
5 files changed, 449 insertions, 2 deletions
diff --git a/.ci/oe-for-host.yml b/.ci/oe-for-host.yml new file mode 100644 index 000000000..6c2025a74 --- /dev/null +++ b/.ci/oe-for-host.yml @@ -0,0 +1,187 @@ +# +# Copyright 2021 Ettus Research, a National Instruments Brand +# +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# Description: +# +# Build openembedded (OE) package for host architecture (genericx86-64) +# +# The recipe to be built is specified by variable "Image" +# The package itself is built (step "build $(Image)") and also all runtime +# dependencies are built (step "build $(Image) with dependencies") +# +# For the recipes "uhd", "uhd-fpga-images" and "mpmd", the build is configured +# to use the source code from the $(Agent.BuildDirectory)/uhd directory. The +# code is checked out by this pipeline with the branch and version which +# triggered this pipeline. +# +# The pipeline generates an artifact named "genericx86-64-feed". It contains +# the file base-feeds.conf which contains the package feed URIs. This file can +# be used by the opkg package manager to install the packages from this feed. + +trigger: + branches: + include: + - master + paths: + include: + - .ci + - host + +pr: + branches: + include: + - master + paths: + include: + - .ci + - host + +variables: + SITECONF_FILE: '$(Agent.WorkFolder)/site.conf' + IMAGE_VERSION_SUFFIX: '-$(Build.BuildNumber)' + MENDER_ARTIFACT_NAME: '$(Build.BuildNumber)' + # The following variables need to be provided as pipeline variables: + # MANIFEST_URL, MANIFEST_BRANCH, MANIFEST_FILE, OE_RELEASE + +jobs: +- job: 'build' + timeoutInMinutes: 600 + cancelTimeoutInMinutes: 10 + strategy: + matrix: {'qemux86-64': {}} + + pool: + name: de-dre-lab + demands: + - openembedded + - Agent.Name -equals oss-build3 + + variables: + MENDER_ARTIFACT_NAME: '$(Build.BuildNumber)_$(System.JobName)' + + steps: + + - script: | + DEVICE=$SYSTEM_JOBNAME + TEMPLATECONF_DIR="meta-ettus/conf/qemux86-64" + BUILD_DIR="$DEVICE/build-$BUILD_BUILDNUMBER" + IMAGE_VERSION_SUFFIX="-$BUILD_BUILDNUMBER" + # set variables to be used in the pipeline + echo "###vso[task.setVariable variable=Device;isOutput=true]$DEVICE" + echo "###vso[task.setVariable variable=TemplateConf_Dir;isOutput=true]$TEMPLATECONF_DIR" + echo "###vso[task.setVariable variable=Build_Dir;isOutput=true]$BUILD_DIR" + echo "###vso[task.setVariable variable=Image_Version_Suffix;isOutput=true]$IMAGE_VERSION_SUFFIX" + name: config + + - script: env + displayName: 'Print environment' + + - script: ssh -T git@github.com || true + displayName: 'Test github authentication' + + - script: | + cd $AGENT_BUILDDIRECTORY + echo repo init -u $MANIFEST_URL -b $MANIFEST_BRANCH -m $MANIFEST_FILE + repo init -u $MANIFEST_URL -b $MANIFEST_BRANCH -m $MANIFEST_FILE + mkdir -p .repo/local_manifests + cat > .repo/local_manifests/add-meta-yocto.xml <<EOF + <?xml version="1.0" encoding="UTF-8"?> + <manifest> + <project name="meta-yocto" remote="yocto" revision="$(OE_RELEASE)" /> + </manifest> + EOF + repo forall -c git clean -fd + repo forall -c git reset --hard + repo sync --force-sync + if [ -x .repo/manifests/apply-patches.sh ]; then + .repo/manifests/apply-patches.sh + fi + displayName: 'Checkout openembedded layers' + + - checkout: self + path: uhd + displayName: 'Checkout uhd' + + - script: | + cd $AGENT_BUILDDIRECTORY + mkdir -p $PWD/$CONFIG_BUILD_DIR + export TEMPLATECONF=$PWD/$CONFIG_TEMPLATECONF_DIR + if [ -d $CONFIG_BUILD_DIR/conf ]; then + rm -rv $CONFIG_BUILD_DIR/conf + fi + source oe-core/oe-init-build-env $CONFIG_BUILD_DIR + echo "INHERIT += \"externalsrc\"" >> conf/local.conf + echo "EXTERNALSRC_pn-uhd = \"$AGENT_BUILDDIRECTORY/uhd/host\"" >> conf/local.conf + echo "EXTERNALSRC_pn-uhd-fpga-images = \"$AGENT_BUILDDIRECTORY/uhd/host\"" >> conf/local.conf + echo "EXTERNALSRC_pn-mpmd = \"$AGENT_BUILDDIRECTORY/uhd/mpm\"" >> conf/local.conf + if [ -n "$SITECONF_FILE" ]; then + cp -v $SITECONF_FILE conf/site.conf + DEPLOY_DIR_BASE=$(grep -e "^DEPLOY_DIR_BASE\s*=" conf/site.conf | sed "s|^.*=\s*\"\(\S*\)\"$|\1|") + if [ -n "$DEPLOY_DIR_BASE" ]; then + DEPLOY_DIR="$DEPLOY_DIR_BASE/${SYSTEM_DEFINITIONNAME}/${CONFIG_BUILD_DIR}" + echo "###vso[task.setVariable variable=DEPLOY_DIR]$DEPLOY_DIR" + echo "Setting DEPLOY_DIR to $DEPLOY_DIR" + echo "DEPLOY_DIR = \"$DEPLOY_DIR\"" >> conf/local.conf + PACKAGE_FEED_BASE_PATHS="$(realpath -m --relative-to="$DEPLOY_DIR_BASE" "$DEPLOY_DIR/ipk")" + echo "Setting PACKAGE_FEED_BASE_PATHS to $PACKAGE_FEED_BASE_PATHS" + echo "PACKAGE_FEED_BASE_PATHS = \"$PACKAGE_FEED_BASE_PATHS\"" >> conf/local.conf + fi + fi + for FILE in $TEMPLATECONF/multiconfig/*.sample; do + mkdir -p conf/multiconfig + cp -v $FILE conf/multiconfig/$(basename $FILE .sample) + done + echo "MENDER_ARTIFACT_NAME = \"$MENDER_ARTIFACT_NAME\"" >> conf/local.conf + + displayName: 'Setup environment' + + - script: | + cd $AGENT_BUILDDIRECTORY + source oe-core/oe-init-build-env $CONFIG_BUILD_DIR + bitbake -p || exit $? + displayName: 'Parse recipes' + + - script: | + cd $AGENT_BUILDDIRECTORY + source oe-core/oe-init-build-env $CONFIG_BUILD_DIR + for RECIPE in $(Image); do + bitbake $RECIPE:do_package_write_ipk || exit $? + done + displayName: 'build $(Image)' + + - script: | + cd $AGENT_BUILDDIRECTORY + source oe-core/oe-init-build-env $CONFIG_BUILD_DIR + for RECIPE in $(Image); do + bitbake $RECIPE || exit $? + done + displayName: 'build $(Image) with dependencies' + + - script: | + cd $AGENT_BUILDDIRECTORY + source oe-core/oe-init-build-env $CONFIG_BUILD_DIR + bitbake package-index + bitbake package-feed + for RECIPE in $(Image); do + bitbake -e $RECIPE > $RECIPE.env + grep -e "^IMAGE_NAME=" -e "^IMAGE_LINK_NAME=" -e "^IMAGE_FSTYPES=" \ + -e "^DEPLOY_DIR_IMAGE=" -e "^DEPLOY_DIR_IPK=" $RECIPE.env \ + > image.variables + break + done + source image.variables + DEST=feed + mkdir -p $DEST + cp $DEPLOY_DIR_IPK/base-feeds.conf $DEST + displayName: 'Create Feed $(System.JobName)' + + - publish: $(Agent.BuildDirectory)/$(config.Build_Dir)/feed + artifact: '$(System.JobName)-feed' + displayName: 'Publish Image feed $(System.JobName)' + + - script: | + if [ -d $(DEPLOY_DIR) ]; then mv $(DEPLOY_DIR) $(DEPLOY_DIR)_attempt_$(System.JobAttempt); fi + condition: failed() + displayName: rename deploy dir if build failed diff --git a/.ci/oe-x4xx-packages.yml b/.ci/oe-x4xx-packages.yml new file mode 100644 index 000000000..06044dd2b --- /dev/null +++ b/.ci/oe-x4xx-packages.yml @@ -0,0 +1,175 @@ +# +# Copyright 2021 Ettus Research, a National Instruments Brand +# +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# Description: +# +# Automated x4xx openembedded build on Azure DevOps +# +# This pipeline builds the following openembedded targets: +# - UHD +# - UHD FPGA images +# - MPMD +# +# It also runs UHD unit tests and publishes their results. + +trigger: + branches: + include: + - master + paths: + include: + - .ci + - host + - mpm + - images/manifest.txt + +pr: + branches: + include: + - master + paths: + include: + - .ci + - host + - mpm + - images/manifest.txt + +variables: + SITECONF_FILE: '$(Agent.WorkFolder)/site.conf' + MANIFEST_URL: 'git@github.com:EttusResearch/oe-manifest-dev.git' + MANIFEST_BRANCH: 'zeus-dev' + MANIFEST_FILE: 'head-titanium-dev.xml' + IMAGE_VERSION_SUFFIX: '-$(Build.BuildNumber)' + MENDER_ARTIFACT_NAME: '$(Build.BuildNumber)' + +jobs: +- job: 'Build_OE_packages' + timeoutInMinutes: 60 + cancelTimeoutInMinutes: 10 + strategy: + matrix: {'x4xx-rev2': {}} + + pool: + name: de-dre-lab + demands: + - openembedded + - Agent.Name -equals oss-build3 + + steps: + + - script: env + displayName: 'Print environment' + + - script: ssh -T git@github.com || true + displayName: 'Test github authentication' + + - script: | + cd $AGENT_BUILDDIRECTORY + repo init -u $MANIFEST_URL -b $MANIFEST_BRANCH -m $MANIFEST_FILE + repo forall -c git clean -fd + repo forall -c git reset --hard + repo sync + if [ -x .repo/manifests/apply-patches.sh ]; then + .repo/manifests/apply-patches.sh + fi + displayName: 'Checkout openembedded layers' + + - checkout: self + path: uhddev + displayName: 'Checkout uhddev' + + - script: | + if (echo $SYSTEM_JOBNAME | grep -q -e "-nomender$"); then + DEVICE=${SYSTEM_JOBNAME:0:-9} + TEMPLATECONF_DIR="meta-ettus/conf/without-mender/$DEVICE" + else + DEVICE=$SYSTEM_JOBNAME + TEMPLATECONF_DIR="meta-ettus/conf/with-mender/$DEVICE" + fi + BUILD_DIR="$DEVICE/build-$BUILD_BUILDNUMBER" # relative to Agent.BuildDirectory + TESTRESULTS_DIR="$BUILD_DIR/testresults" # relative to Agent.BuildDirectory + # set variables to be used in the pipeline + echo "###vso[task.setVariable variable=Device;isOutput=true]$DEVICE" + echo "###vso[task.setVariable variable=TemplateConf_Dir;isOutput=true]$TEMPLATECONF_DIR" + echo "###vso[task.setVariable variable=Build_Dir;isOutput=true]$BUILD_DIR" + echo "###vso[task.setVariable variable=TESTRESULTS_DIR;isOutput=true]$TESTRESULTS_DIR" + name: config + + - script: | + cd $AGENT_BUILDDIRECTORY + mkdir -p $PWD/$CONFIG_BUILD_DIR + export TEMPLATECONF=$PWD/$CONFIG_TEMPLATECONF_DIR + if [ -d $CONFIG_BUILD_DIR/conf ]; then + rm -rv $CONFIG_BUILD_DIR/conf + fi + source oe-core/oe-init-build-env $CONFIG_BUILD_DIR + echo "INHERIT += \"externalsrc\"" >> conf/local.conf + echo "EXTERNALSRC_pn-uhd = \"$AGENT_BUILDDIRECTORY/uhddev/host\"" >> conf/local.conf + echo "EXTERNALSRC_pn-mpmd = \"$AGENT_BUILDDIRECTORY/uhddev/mpm\"" >> conf/local.conf + echo "RRECOMMENDS_uhd_class-target_remove = \"uhd-fpga-images\"" >> conf/local.conf + echo "RDEPENDS_mpmd_remove = \"uhd-fpga-images-firmware\"" >> conf/local.conf + if [ -n "$SITECONF_FILE" ]; then + cp -v $SITECONF_FILE conf/site.conf + DEPLOY_DIR_BASE=$(grep -e "^DEPLOY_DIR_BASE\s*=" conf/site.conf | sed "s|^.*=\s*\"\(\S*\)\"$|\1|") + if [ -n "$DEPLOY_DIR_BASE" ]; then + DEPLOY_DIR="$DEPLOY_DIR_BASE/${SYSTEM_DEFINITIONNAME}/${CONFIG_BUILD_DIR}" + echo "###vso[task.setVariable variable=DEPLOY_DIR]$DEPLOY_DIR" + echo "Setting DEPLOY_DIR to $DEPLOY_DIR" + echo "DEPLOY_DIR = \"$DEPLOY_DIR\"" >> conf/local.conf + fi + echo "TESTRESULTS_DIR = \"$(Agent.BuildDirectory)/$(config.TESTRESULTS_DIR)\"" >> conf/local.conf + fi + for FILE in $TEMPLATECONF/multiconfig/*.sample; do + mkdir -p conf/multiconfig + cp -v $FILE conf/multiconfig/$(basename $FILE .sample) + done + for FILE in $(find conf -name "*.conf"); do + echo "*** content of file $FILE: ***" + cat $FILE + done + displayName: 'Setup environment' + + - script: | + cd $AGENT_BUILDDIRECTORY + source oe-core/oe-init-build-env $CONFIG_BUILD_DIR + bitbake -p + displayName: 'Parse recipes' + + - script: | + cd $AGENT_BUILDDIRECTORY + source oe-core/oe-init-build-env $CONFIG_BUILD_DIR + bitbake uhd:do_package_write_ipk + displayName: 'Build UHD' + + - script: | + cd $AGENT_BUILDDIRECTORY + source oe-core/oe-init-build-env $CONFIG_BUILD_DIR + bitbake uhd:do_run_tests + displayName: 'Run UHD tests' + continueOnError: true + + - task: PublishTestResults@2 + inputs: + testResultsFormat: 'cTest' + testResultsFiles: '**/Test.xml' + testRunTitle: 'UHD tests' + searchFolder: '$(Agent.BuildDirectory)/$(config.TESTRESULTS_DIR)/uhd' + displayName: 'Publish UHD tests results' + continueOnError: true + + - script: | + cd $AGENT_BUILDDIRECTORY + source oe-core/oe-init-build-env $CONFIG_BUILD_DIR + bitbake mpmd:do_package_write_ipk + displayName: 'Build MPM' + + - publish: '$(DEPLOY_DIR)/ipk' + artifact: 'IPK files' + displayName: 'Publish Artifacts' + + - script: | + if [ -d $(DEPLOY_DIR) ]; then mv $(DEPLOY_DIR) $(DEPLOY_DIR)_attempt_$(System.JobAttempt); fi + condition: failed() + displayName: rename deploy dir if build failed diff --git a/.ci/uhd-build-docker-container.yml b/.ci/uhd-build-docker-container.yml index 80e21825f..8712a5f58 100644 --- a/.ci/uhd-build-docker-container.yml +++ b/.ci/uhd-build-docker-container.yml @@ -1,3 +1,8 @@ +# +# Copyright 2021 Ettus Research, a National Instruments Brand +# +# SPDX-License-Identifier: LGPL-3.0-or-later +# trigger: branches: include: diff --git a/.ci/uhd-pipeline.yml b/.ci/uhd-pipeline.yml index 593ac20e9..39df8e6df 100644 --- a/.ci/uhd-pipeline.yml +++ b/.ci/uhd-pipeline.yml @@ -1,8 +1,13 @@ +# +# Copyright 2021 Ettus Research, a National Instruments Brand +# +# SPDX-License-Identifier: LGPL-3.0-or-later +# + trigger: branches: include: - master - - titanium-master paths: include: - host @@ -11,7 +16,6 @@ pr: branches: include: - master - - titanium-master paths: include: - host diff --git a/.ci/x4xx-devtests.yml b/.ci/x4xx-devtests.yml new file mode 100644 index 000000000..780d46ec8 --- /dev/null +++ b/.ci/x4xx-devtests.yml @@ -0,0 +1,76 @@ +# +# Copyright 2021 Ettus Research, a National Instruments Brand +# +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# Description: +# +# X410-Specific Pipeline to execute the devtests (equivalent to make test_x4xx) +# on the DUT. + +# no CI triggers +trigger: none + +# no PR triggers +pr: none + +variables: + UHDForHostArtifactName: 'qemux86-64-feed' + +# pipeline triggers +resources: + pipelines: + - pipeline: 'x4xx-uhddev-oe-for-host-artifacts' + source: 'x4xx-uhddev-oe-for-host' + branch: master + trigger: + # workaround if no additional branch filter is specified + enabled: True + +pool: + demands: + - 'x4xx-devtests' + +jobs: +- job: 'devtests' + + steps: + - checkout: none + + # note: 'download' parameter must not use a variable, otherwise artifact is not found + - download: 'x4xx-uhddev-oe-for-host-artifacts' + artifact: '$(UHDForHostArtifactName)' + displayName: 'Download artifact $(UHDForHostArtifactName)' + + - script: | + cp x4xx-uhddev-oe-for-host-artifacts/$(UHDForHostArtifactName)/base-feeds.conf opkg.conf + echo -e "arch all 1\narch core2-64 6\narch qemux86_64 11" >> opkg.conf + rm -rf rootfs + opkg -f opkg.conf -o rootfs update && opkg -f opkg.conf -o rootfs install uhd uhd-examples uhd-tests + workingDirectory: $(Agent.BuildDirectory) + displayName: 'Install UHD' + + - script: | + PATH="$PATH:/usr/lib/uhd/examples" + ARGS="--args=type=x4xx --devtest-pattern=x4x0 --xml" + linux-user-chroot $PWD/rootfs /usr/bin/python3 /usr/lib/uhd/tests/devtest/run_testsuite.py --src-dir=/usr/lib/uhd/tests/devtest $ARGS + workingDirectory: $(Agent.BuildDirectory) + displayName: 'Run x4xx-devtests' + continueOnError: true + + - task: PublishTestResults@2 + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: '**/TEST-*.xml' + testRunTitle: 'Devtests' + searchFolder: '$(Agent.BuildDirectory)/rootfs' + + - script: | + rm -v -f a/* + cp -v rootfs/*.log a/ + displayName: 'Prepare Logfile Artifact' + workingDirectory: $(Agent.BuildDirectory) + + - publish: '$(Agent.BuildDirectory)/a' + artifact: 'Logfiles' + displayName: 'Publish Logfiles Artifact' |