From 888dea07daf4eb134686440f9f09dddc498b7b9e Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Fri, 25 Oct 2019 12:42:54 -0400 Subject: [PATCH] CART-89 build: Update to use current packaging standards (#226) Build on Leap 15, using mock instead of obs-build. Also generally sync up with DAOS build. Signed-off-by: Brian J. Murrell --- .gitignore | 3 + Jenkinsfile | 687 ++++++++++++------ Makefile | 233 ------ utils/build.config | 6 +- utils/docker/Dockerfile-debbuild.ubuntu.18.04 | 101 --- utils/docker/Dockerfile-debbuild.ubuntu.18.10 | 75 -- utils/docker/Dockerfile-mockbuild.centos.7 | 50 -- utils/docker/Dockerfile-rpmbuild.leap.42.3 | 72 -- utils/docker/Dockerfile-rpmbuild.sles.12.3 | 74 -- utils/rpms/Makefile | 40 + cart.spec => utils/rpms/cart.spec | 58 +- {debian => utils/rpms/debian}/cart-docs.docs | 0 {debian => utils/rpms/debian}/cart-tests.dirs | 0 .../rpms/debian}/cart-tests.install | 0 {debian => utils/rpms/debian}/cart.dirs | 0 {debian => utils/rpms/debian}/cart.install | 0 {debian => utils/rpms/debian}/changelog | 6 + {debian => utils/rpms/debian}/compat | 0 {debian => utils/rpms/debian}/control | 0 {debian => utils/rpms/debian}/copyright | 0 .../rpms/debian}/libcart-dev.dirs | 0 .../rpms/debian}/libcart-dev.install | 0 {debian => utils/rpms/debian}/libcart1.dirs | 0 .../rpms/debian}/libcart1.install | 0 {debian => utils/rpms/debian}/rules | 0 {debian => utils/rpms/debian}/source/format | 0 utils/rpms/packaging/Dockerfile.mockbuild | 30 + utils/rpms/packaging/Dockerfile.ubuntu.18.04 | 28 + utils/rpms/packaging/Dockerfile.ubuntu.18.10 | 24 + utils/rpms/packaging/Makefile_packaging.mk | 480 ++++++++++++ 30 files changed, 1127 insertions(+), 840 deletions(-) delete mode 100644 Makefile delete mode 100644 utils/docker/Dockerfile-debbuild.ubuntu.18.04 delete mode 100644 utils/docker/Dockerfile-debbuild.ubuntu.18.10 delete mode 100644 utils/docker/Dockerfile-mockbuild.centos.7 delete mode 100644 utils/docker/Dockerfile-rpmbuild.leap.42.3 delete mode 100644 utils/docker/Dockerfile-rpmbuild.sles.12.3 create mode 100644 utils/rpms/Makefile rename cart.spec => utils/rpms/cart.spec (79%) rename {debian => utils/rpms/debian}/cart-docs.docs (100%) rename {debian => utils/rpms/debian}/cart-tests.dirs (100%) rename {debian => utils/rpms/debian}/cart-tests.install (100%) rename {debian => utils/rpms/debian}/cart.dirs (100%) rename {debian => utils/rpms/debian}/cart.install (100%) rename {debian => utils/rpms/debian}/changelog (88%) rename {debian => utils/rpms/debian}/compat (100%) rename {debian => utils/rpms/debian}/control (100%) rename {debian => utils/rpms/debian}/copyright (100%) rename {debian => utils/rpms/debian}/libcart-dev.dirs (100%) rename {debian => utils/rpms/debian}/libcart-dev.install (100%) rename {debian => utils/rpms/debian}/libcart1.dirs (100%) rename {debian => utils/rpms/debian}/libcart1.install (100%) rename {debian => utils/rpms/debian}/rules (100%) rename {debian => utils/rpms/debian}/source/format (100%) create mode 100644 utils/rpms/packaging/Dockerfile.mockbuild create mode 100644 utils/rpms/packaging/Dockerfile.ubuntu.18.04 create mode 100644 utils/rpms/packaging/Dockerfile.ubuntu.18.10 create mode 100644 utils/rpms/packaging/Makefile_packaging.mk diff --git a/.gitignore b/.gitignore index e79c0c06a..e258c20c4 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,6 @@ __pycache__ /valgrind_results/ pylint.log .checkpatch-camelcase.git. +tags +*.code-workspace +utils/rpms/_topdir/ \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 38afab510..f9c919bc6 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,9 +40,25 @@ // I.e. for testing library changes //@Library(value="pipeline-lib@your_branch") _ -def arch="-Linux" +def arch = "-Linux" def sanitized_JOB_NAME = JOB_NAME.toLowerCase().replaceAll('/', '-').replaceAll('%2f', '-') +def component_repos = "" +def cart_repo = "cart@${env.BRANCH_NAME}:${env.BUILD_NUMBER}" +def cart_repos = component_repos + ' ' + cart_repo +//def cart_rpms = "openpa libfabric pmix ompi mercury" +// don't need to install any RPMs for testing yet +def cart_rpms = "" + +// bail out of branch builds that are not on a whitelist +if (!env.CHANGE_ID && + (env.BRANCH_NAME != "weekly-testing" && + env.BRANCH_NAME != "master" && + env.BRANCH_NAME != "daos_devel")) { + currentBuild.result = 'SUCCESS' + return +} + pipeline { agent { label 'lightweight' } @@ -54,13 +70,20 @@ pipeline { GITHUB_USER = credentials('daos-jenkins-review-posting') BAHTTPS_PROXY = "${env.HTTP_PROXY ? '--build-arg HTTP_PROXY="' + env.HTTP_PROXY + '" --build-arg http_proxy="' + env.HTTP_PROXY + '"' : ''}" BAHTTP_PROXY = "${env.HTTP_PROXY ? '--build-arg HTTPS_PROXY="' + env.HTTPS_PROXY + '" --build-arg https_proxy="' + env.HTTPS_PROXY + '"' : ''}" - UID=sh(script: "id -u", returnStdout: true) - BUILDARGS = "--build-arg NOBUILD=1 --build-arg UID=$env.UID $env.BAHTTP_PROXY $env.BAHTTPS_PROXY" + UID = sh(script: "id -u", returnStdout: true) + BUILDARGS = "$env.BAHTTP_PROXY $env.BAHTTPS_PROXY " + + "--build-arg NOBUILD=1 --build-arg UID=$env.UID " + + "--build-arg JENKINS_URL=$env.JENKINS_URL " + + "--build-arg CACHEBUST=${currentBuild.startTimeInMillis}" + SSH_KEY_ARGS="-ici_key" + CLUSH_ARGS="-o$SSH_KEY_ARGS" } options { // preserve stashes so that jobs can be started at the test stage preserveStashes(buildCount: 5) + // How can we have different timeouts for weekly and master and PRs? + timeout(time: 2, unit: 'HOURS') } stages { @@ -71,6 +94,13 @@ pipeline { } } stage('Pre-build') { + when { + beforeAgent true + allOf { + not { branch 'weekly-testing' } + expression { env.CHANGE_TARGET != 'weekly-testing' } + } + } parallel { stage('checkpatch') { agent { @@ -123,15 +153,30 @@ pipeline { stage('Build') { /* Don't use failFast here as whilst it avoids using extra resources * and gives faster results for PRs it's also on for master where we - * do want complete results in the case of partial failure - */ + * do want complete results in the case of partial failure + */ //failFast true + when { + beforeAgent true + // expression { skipTest != true } + expression { + sh script: 'git show -s --format=%B | grep "^Skip-build: true"', + returnStatus: true + } + } parallel { stage('Build RPM on CentOS 7') { + when { + beforeAgent true + allOf { + not { branch 'weekly-testing' } + expression { env.CHANGE_TARGET != 'weekly-testing' } + } + } agent { dockerfile { - filename 'Dockerfile-mockbuild.centos.7' - dir 'utils/docker' + filename 'Dockerfile.mockbuild' + dir 'utils/rpms/packaging' label 'docker_runner' additionalBuildArgs '--build-arg UID=$(id -u) --build-arg JENKINS_URL=' + env.JENKINS_URL @@ -139,7 +184,7 @@ pipeline { } } steps { - githubNotify credentialsId: 'daos-jenkins-commit-status', + githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, context: "build" + "/" + env.STAGE_NAME, status: "PENDING" @@ -147,27 +192,24 @@ pipeline { sh label: env.STAGE_NAME, script: '''rm -rf artifacts/centos7/ mkdir -p artifacts/centos7/ - if make srpm; then - if make mockbuild; then - (cd /var/lib/mock/epel-7-x86_64/result/ && - cp -r . $OLDPWD/artifacts/centos7/) - createrepo artifacts/centos7/ - else - rc=\${PIPESTATUS[0]} - (cd /var/lib/mock/epel-7-x86_64/result/ && - cp -r . $OLDPWD/artifacts/centos7/) - cp -af _topdir/SRPMS artifacts/centos7/ - exit \$rc - fi - else - exit \${PIPESTATUS[0]} - fi''' + if git show -s --format=%B | grep "^Skip-build: true"; then + exit 0 + fi + make CHROOT_NAME="epel-7-x86_64" -C utils/rpms chrootbuild''' } post { - always { - archiveArtifacts artifacts: 'artifacts/centos7/**' - } success { + sh label: "Collect artifacts", + script: '''mockroot=/var/lib/mock/epel-7-x86_64 + (cd $mockroot/result/ && + cp -r . $OLDPWD/artifacts/centos7/) + createrepo artifacts/centos7/ + cat $mockroot/result/{root,build}.log''' + publishToRepository product: 'cart', + format: 'yum', + maturity: 'stable', + tech: 'el-7', + repo_dir: 'artifacts/centos7/' stepResult name: env.STAGE_NAME, context: "build", result: "SUCCESS" } @@ -179,6 +221,22 @@ pipeline { stepResult name: env.STAGE_NAME, context: "build", result: "FAILURE" } + unsuccessful { + sh label: "Collect artifacts", + script: '''mockroot=/var/lib/mock/epel-7-x86_64 + artdir=$PWD/artifacts/centos7 + if srpms=$(ls _topdir/SRPMS/*); then + cp -af $srpms $artdir + fi + (if cd $mockroot/result/; then + cp -r . $artdir + fi) + cat $mockroot/result/{root,build}.log \ + 2>/dev/null || true''' + } + cleanup { + archiveArtifacts artifacts: 'artifacts/centos7/**' + } } } stage('Build RPM on SLES 12.3') { @@ -187,21 +245,23 @@ pipeline { allOf { expression { false } environment name: 'SLES12_3_DOCKER', value: 'true' + not { branch 'weekly-testing' } + expression { env.CHANGE_TARGET != 'weekly-testing' } } } agent { dockerfile { - filename 'Dockerfile-rpmbuild.sles.12.3' - dir 'utils/docker' + filename 'Dockerfile.mockbuild' + dir 'utils/rpms/packaging' label 'docker_runner' - additionalBuildArgs '--build-arg UID=$(id -u) ' + - '--build-arg JENKINS_URL=' + - env.JENKINS_URL + - " --build-arg CACHEBUST=${currentBuild.startTimeInMillis}" + args '--privileged=true' + additionalBuildArgs '--build-arg UID=$(id -u) --build-arg JENKINS_URL=' + + env.JENKINS_URL + args '--group-add mock --cap-add=SYS_ADMIN --privileged=true' } } steps { - githubNotify credentialsId: 'daos-jenkins-commit-status', + githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, context: "build" + "/" + env.STAGE_NAME, status: "PENDING" @@ -209,24 +269,24 @@ pipeline { sh label: env.STAGE_NAME, script: '''rm -rf artifacts/sles12.3/ mkdir -p artifacts/sles12.3/ - rm -rf _topdir/SRPMS - if make srpm; then - rm -rf _topdir/RPMS - if make rpms; then - ln _topdir/{RPMS/*,SRPMS}/* artifacts/sles12.3/ - createrepo artifacts/sles12.3/ - else - exit \${PIPESTATUS[0]} - fi - else - exit \${PIPESTATUS[0]} - fi''' + if git show -s --format=%B | grep "^Skip-build: true"; then + exit 0 + fi + make CHROOT_NAME="suse-12.3-x86_64" -C utils/rpms chrootbuild''' } post { - always { - archiveArtifacts artifacts: 'artifacts/sles12.3/**' - } success { + sh label: "Collect artifacts", + script: '''mockroot=/var/lib/mock/suse-12.3-x86_64 + (cd $mockroot/result/ && + cp -r . $OLDPWD/artifacts/sles12.3/) + createrepo artifacts/sles12.3/ + cat $mockroot/result/{root,build}.log''' + publishToRepository product: 'cart', + format: 'yum', + maturity: 'stable', + tech: 'sles-12', + repo_dir: 'artifacts/sles12.3/' stepResult name: env.STAGE_NAME, context: "build", result: "SUCCESS" } @@ -238,26 +298,47 @@ pipeline { stepResult name: env.STAGE_NAME, context: "build", result: "FAILURE" } + unsuccessful { + sh label: "Collect artifacts", + script: '''mockroot=/var/lib/mock/suse-12.3-x86_64 + cat $mockroot/result/{root,build}.log + artdir=$PWD/artifacts/sles12.3 + if srpms=$(ls _topdir/SRPMS/*); then + cp -af $srpms $artdir + fi + (if cd $mockroot/result/; then + cp -r . $artdir + fi) + cat $mockroot/result/{root,build}.log \ + 2>/dev/null || true''' + } + cleanup { + archiveArtifacts artifacts: 'artifacts/sles12.3/**' + } } } stage('Build RPM on Leap 42.3') { when { beforeAgent true - expression { false } + allOf { + expression { false } + not { branch 'weekly-testing' } + expression { env.CHANGE_TARGET != 'weekly-testing' } + } } agent { dockerfile { - filename 'Dockerfile-rpmbuild.leap.42.3' - dir 'utils/docker' + filename 'Dockerfile.mockbuild' + dir 'utils/rpms/packaging' label 'docker_runner' - additionalBuildArgs '--build-arg UID=$(id -u) ' + - '--build-arg JENKINS_URL=' + - env.JENKINS_URL + - " --build-arg CACHEBUST=${currentBuild.startTimeInMillis}" + args '--privileged=true' + additionalBuildArgs '--build-arg UID=$(id -u) --build-arg JENKINS_URL=' + + env.JENKINS_URL + args '--group-add mock --cap-add=SYS_ADMIN --privileged=true' } } steps { - githubNotify credentialsId: 'daos-jenkins-commit-status', + githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, context: "build" + "/" + env.STAGE_NAME, status: "PENDING" @@ -265,24 +346,98 @@ pipeline { sh label: env.STAGE_NAME, script: '''rm -rf artifacts/leap42.3/ mkdir -p artifacts/leap42.3/ - rm -rf _topdir/SRPMS - if make srpm; then - rm -rf _topdir/RPMS - if make rpms; then - ln _topdir/{RPMS/*,SRPMS}/* artifacts/leap42.3/ - createrepo artifacts/leap42.3/ - else - exit \${PIPESTATUS[0]} - fi - else - exit \${PIPESTATUS[0]} - fi''' + if git show -s --format=%B | grep "^Skip-build: true"; then + exit 0 + fi + make CHROOT_NAME="opensuse-leap-42.3-x86_64" -C utils/rpms chrootbuild''' } post { - always { + success { + sh label: "Collect artifacts", + script: '''mockroot=/var/lib/mock/opensuse-leap-42.3-x86_64 + (cd $mockroot/result/ && + cp -r . $OLDPWD/artifacts/leap42.3/) + createrepo artifacts/leap42.3/ + cat $mockroot/result/{root,build}.log''' + publishToRepository product: 'cart', + format: 'yum', + maturity: 'stable', + tech: 'leap-42', + repo_dir: 'artifacts/leap42.3/' + stepResult name: env.STAGE_NAME, context: "build", + result: "SUCCESS" + } + unstable { + stepResult name: env.STAGE_NAME, context: "build", + result: "UNSTABLE" + } + failure { + stepResult name: env.STAGE_NAME, context: "build", + result: "FAILURE" + } + unsuccessful { + sh label: "Collect artifacts", + script: '''mockroot=/var/lib/mock/opensuse-leap-42.3-x86_64 + cat $mockroot/result/{root,build}.log + artdir=$PWD/artifacts/leap42.3 + if srpms=$(ls _topdir/SRPMS/*); then + cp -af $srpms $artdir + fi + (if cd $mockroot/result/; then + cp -r . $artdir + fi) + cat $mockroot/result/{root,build}.log \ + 2>/dev/null || true''' + } + cleanup { archiveArtifacts artifacts: 'artifacts/leap42.3/**' } + } + } + stage('Build RPM on Leap 15') { + when { + beforeAgent true + allOf { + not { branch 'weekly-testing' } + expression { env.CHANGE_TARGET != 'weekly-testing' } + } + } + agent { + dockerfile { + filename 'Dockerfile.mockbuild' + dir 'utils/rpms/packaging' + label 'docker_runner' + args '--privileged=true' + additionalBuildArgs '--build-arg UID=$(id -u) --build-arg JENKINS_URL=' + + env.JENKINS_URL + args '--group-add mock --cap-add=SYS_ADMIN --privileged=true' + } + } + steps { + githubNotify credentialsId: 'daos-jenkins-commit-status', + description: env.STAGE_NAME, + context: "build" + "/" + env.STAGE_NAME, + status: "PENDING" + checkoutScm withSubmodules: true + sh label: env.STAGE_NAME, + script: '''rm -rf artifacts/leap15/ + mkdir -p artifacts/leap15/ + if git show -s --format=%B | grep "^Skip-build: true"; then + exit 0 + fi + make CHROOT_NAME="opensuse-leap-15.1-x86_64" -C utils/rpms chrootbuild''' + } + post { success { + sh label: "Collect artifacts", + script: '''(cd /var/lib/mock/opensuse-leap-15.1-x86_64/result/ && + cp -r . $OLDPWD/artifacts/leap15/) + createrepo artifacts/leap15/''' + publishToRepository product: 'cart', + format: 'yum', + maturity: 'stable', + tech: 'leap-15', + repo_dir: 'artifacts/leap15/' stepResult name: env.STAGE_NAME, context: "build", result: "SUCCESS" } @@ -294,6 +449,127 @@ pipeline { stepResult name: env.STAGE_NAME, context: "build", result: "FAILURE" } + unsuccessful { + sh label: "Collect artifacts", + script: '''mockroot=/var/lib/mock/opensuse-leap-15.1-x86_64 + cat $mockroot/result/{root,build}.log + artdir=$PWD/artifacts/leap15 + if srpms=$(ls _topdir/SRPMS/*); then + cp -af $srpms $artdir + fi + (if cd $mockroot/result/; then + cp -r . $artdir + fi) + cat $mockroot/result/{root,build}.log \ + 2>/dev/null || true''' + } + cleanup { + archiveArtifacts artifacts: 'artifacts/leap15/**' + } + } + } + stage('Build DEB on Ubuntu 18.04') { + when { + expression { false } + } + agent { + dockerfile { + filename 'Dockerfile.ubuntu.18.04' + dir 'utils/rpms/packaging' + label 'docker_runner' + additionalBuildArgs '--build-arg UID=$(id -u) ' + + ' --build-arg JENKINS_URL=' + env.JENKINS_URL + + ' --build-arg CACHEBUST=' + + currentBuild.startTimeInMillis + } + } + steps { + githubNotify credentialsId: 'daos-jenkins-commit-status', + description: env.STAGE_NAME, + context: "build" + "/" + env.STAGE_NAME, + status: "PENDING" + checkoutScm withSubmodules: true + sh label: env.STAGE_NAME, + script: '''rm -rf artifacts/ubuntu18.04/ + mkdir -p artifacts/ubuntu18.04/ + : "${DEBEMAIL:="$env.DAOS_EMAIL"}" + : "${DEBFULLNAME:="$env.DAOS_FULLNAME"}" + export DEBEMAIL + export DEBFULLNAME + make -C utils/rpms debs''' + } + post { + success { + sh '''ln -v \ + _topdir/BUILD/*{.build,.changes,.deb,.dsc,.gz,.xz} \ + artifacts/ubuntu18.04/ + pushd artifacts/ubuntu18.04/ + dpkg-scanpackages . /dev/null | \ + gzip -9c > Packages.gz + popd''' + archiveArtifacts artifacts: 'artifacts/ubuntu18.04/**' + stepResult name: env.STAGE_NAME, context: "build", + result: "SUCCESS" + } + unsuccessful { + sh script: "cat _topdir/BUILD/*.build", + returnStatus: true + archiveArtifacts artifacts: 'artifacts/ubuntu18.04/**' + stepResult name: env.STAGE_NAME, context: "build", + result: "UNSTABLE" + } + } + } + stage('Build DEB on Ubuntu 18.10') { + when { + expression { false } + } + agent { + dockerfile { + filename 'Dockerfile.ubuntu.18.10' + dir 'utils/rpms/packaging' + label 'docker_runner' + additionalBuildArgs '--build-arg UID=$(id -u) ' + + ' --build-arg JENKINS_URL=' + env.JENKINS_URL + + ' --build-arg CACHEBUST=' + + currentBuild.startTimeInMillis + } + } + steps { + githubNotify credentialsId: 'daos-jenkins-commit-status', + description: env.STAGE_NAME, + context: "build" + "/" + env.STAGE_NAME, + status: "PENDING" + checkoutScm withSubmodules: true + sh label: env.STAGE_NAME, + script: '''rm -rf artifacts/ubuntu18.10/ + mkdir -p artifacts/ubuntu18.10/ + : "${DEBEMAIL:="$env.DAOS_EMAIL"}" + : "${DEBFULLNAME:="$env.DAOS_FULLNAME"}" + export DEBEMAIL + export DEBFULLNAME + make -C utils/rpms debs''' + } + post { + success { + sh '''ln -v \ + _topdir/BUILD/*{.build,.changes,.deb,.dsc,.gz,.xz} \ + artifacts/ubuntu18.10/ + pushd artifacts/ubuntu18.10/ + dpkg-scanpackages . /dev/null | \ + gzip -9c > Packages.gz + popd''' + archiveArtifacts artifacts: 'artifacts/ubuntu18.10/**' + stepResult name: env.STAGE_NAME, context: "build", + result: "SUCCESS" + } + unsuccessful { + sh script: "cat _topdir/BUILD/*.build", + returnStatus: true + archiveArtifacts artifacts: 'artifacts/ubuntu18.10/**' + stepResult name: env.STAGE_NAME, context: "build", + result: "UNSTABLE" + } } } stage('Build master CentOS 7') { @@ -333,11 +609,7 @@ pipeline { build/Linux/src/utest/utest.log, build/Linux/src/utest/test_output''' } - unstable { - sh "mv config${arch}.log config.log-master" - archiveArtifacts artifacts: 'config.log-master' - } - failure { + unsuccessful { sh "mv config${arch}.log config.log-master" archiveArtifacts artifacts: 'config.log-master' } @@ -349,7 +621,8 @@ pipeline { filename 'Dockerfile.centos.7' dir 'utils/docker' label 'docker_runner' - additionalBuildArgs "-t ${sanitized_JOB_NAME}-centos7 " + '$BUILDARGS' + additionalBuildArgs "-t ${sanitized_JOB_NAME}-centos7 " + + '$BUILDARGS' } } steps { @@ -391,9 +664,12 @@ pipeline { status: 'SUCCESS' } */ - unstable { - sh "mv config${arch}.log config.log-centos7-gcc" - archiveArtifacts artifacts: 'config.log-centos7-gcc' + unsuccessful { + sh """if [ -f config${arch}.log ]; then + mv config${arch}.log config.log-centos7-gcc + fi""" + archiveArtifacts artifacts: 'config.log-centos7-gcc', + allowEmptyArchive: true /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, @@ -401,16 +677,6 @@ pipeline { status: 'FAILURE' */ } - failure { - sh "mv config${arch}.log config.log-centos7-gcc" - archiveArtifacts artifacts: 'config.log-centos7-gcc' - /* temporarily moved into stepResult due to JENKINS-39203 - githubNotify credentialsId: 'daos-jenkins-commit-status', - description: env.STAGE_NAME, - context: 'build/' + env.STAGE_NAME, - status: 'ERROR' - */ - } } } stage('Build on CentOS 7 with Clang') { @@ -445,7 +711,7 @@ pipeline { */ } success { - /* temporarily moved into stepResult due to JENKINS-39203 + /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, context: 'build/' + env.STAGE_NAME, @@ -453,9 +719,12 @@ pipeline { */ sh "rm -rf _build.external${arch}" } - unstable { - sh "mv config${arch}.log config.log-centos7-clang" - archiveArtifacts artifacts: 'config.log-centos7-clang' + unsuccessful { + sh """if [ -f config${arch}.log ]; then + mv config${arch}.log config.log-centos7-clang + fi""" + archiveArtifacts artifacts: 'config.log-centos7-clang', + allowEmptyArchive: true /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, @@ -463,21 +732,13 @@ pipeline { status: 'FAILURE' */ } - failure { - sh "mv config${arch}.log config.log-centos7-clang" - archiveArtifacts artifacts: 'config.log-centos7-clang' - /* temporarily moved into stepResult due to JENKINS-39203 - githubNotify credentialsId: 'daos-jenkins-commit-status', - description: env.STAGE_NAME, - context: 'build/' + env.STAGE_NAME, - status: 'ERROR' - */ - } } } stage('Build on Ubuntu 18.04') { - when { beforeAgent true - branch 'master' } + when { + beforeAgent true + branch 'master' + } agent { dockerfile { filename 'Dockerfile.ubuntu.18.04' @@ -504,10 +765,10 @@ pipeline { stepResult name: env.STAGE_NAME, context: 'build/' + env.STAGE_NAME, result: ${currentBuild.currentResult} - */ + */ } success { - /* temporarily moved into stepResult due to JENKINS-39203 + /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, context: 'build/' + env.STAGE_NAME, @@ -515,9 +776,12 @@ pipeline { */ sh "rm -rf _build.external${arch}" } - unstable { - sh "mv config${arch}.log config.log-ubuntu18.04-gcc" - archiveArtifacts artifacts: 'config.log-ubuntu18.04-gcc' + unsuccessful { + sh """if [ -f config${arch}.log ]; then + mv config${arch}.log config.log-ubuntu18.04-gcc + fi""" + archiveArtifacts artifacts: 'config.log-ubuntu18.04-gcc', + allowEmptyArchive: true /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, @@ -525,19 +789,16 @@ pipeline { status: 'FAILURE' */ } - failure { - sh "mv config${arch}.log config.log-ubuntu18.04-gcc" - archiveArtifacts artifacts: 'config.log-ubuntu18.04-gcc' - /* temporarily moved into stepResult due to JENKINS-39203 - githubNotify credentialsId: 'daos-jenkins-commit-status', - description: env.STAGE_NAME, - context: 'build/' + env.STAGE_NAME, - status: 'ERROR' - */ - } } } stage('Build on Ubuntu 18.04 with Clang') { + when { + beforeAgent true + allOf { + not { branch 'weekly-testing' } + expression { env.CHANGE_TARGET != 'weekly-testing' } + } + } agent { dockerfile { filename 'Dockerfile.ubuntu.18.04' @@ -564,7 +825,7 @@ pipeline { stepResult name: env.STAGE_NAME, context: 'build/' + env.STAGE_NAME, result: ${currentBuild.currentResult} - */ + */ } success { /* temporarily moved into stepResult due to JENKINS-39203 @@ -575,9 +836,12 @@ pipeline { */ sh "rm -rf _build.external${arch}" } - unstable { - sh "mv config${arch}.log config.log-ubuntu18.04-clang" - archiveArtifacts artifacts: 'config.log-ubuntu18.04-clang' + unsuccessful { + sh """if [ -f config${arch}.log ]; then + mv config${arch}.log config.log-ubuntu18.04-clang + fi""" + archiveArtifacts artifacts: 'config.log-ubuntu18.04-clang', + allowEmptyArchive: true /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, @@ -585,21 +849,17 @@ pipeline { status: 'FAILURE' */ } - failure { - sh "mv config${arch}.log config.log-ubuntu18.04-clang" - archiveArtifacts artifacts: 'config.log-ubuntu18.04-clang' - /* temporarily moved into stepResult due to JENKINS-39203 - githubNotify credentialsId: 'daos-jenkins-commit-status', - description: env.STAGE_NAME, - context: 'build/' + env.STAGE_NAME, - status: 'ERROR' - */ - } } } stage('Build on SLES 12.3') { - when { beforeAgent true - environment name: 'SLES12_3_DOCKER', value: 'true' } + when { + beforeAgent true + allOf { + environment name: 'SLES12_3_DOCKER', value: 'true' + not { branch 'weekly-testing' } + expression { env.CHANGE_TARGET != 'weekly-testing' } + } + } agent { dockerfile { filename 'Dockerfile.sles.12.3' @@ -639,9 +899,12 @@ pipeline { */ sh "rm -rf _build.external${arch}" } - unstable { - sh "mv config${arch}.log config.log-sles12sp3-gcc" - archiveArtifacts artifacts: 'config.log-sles12sp3-gcc' + unsuccessful { + sh """if [ -f config${arch}.log ]; then + mv config${arch}.log config.log-sles12.3-gcc + fi""" + archiveArtifacts artifacts: 'config.log-sles12.3-gcc', + allowEmptyArchive: true /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, @@ -649,21 +912,17 @@ pipeline { status: 'FAILURE' */ } - failure { - sh "mv config${arch}.log config.log-sles12sp3-gcc" - archiveArtifacts artifacts: 'config.log-sles12sp3-gcc' - /* temporarily moved into stepResult due to JENKINS-39203 - githubNotify credentialsId: 'daos-jenkins-commit-status', - description: env.STAGE_NAME, - context: 'build/' + env.STAGE_NAME, - status: 'ERROR' - */ - } } } - stage('Build on LEAP 42.3') { - when { beforeAgent true - environment name: 'LEAP42_3_DOCKER', value: 'true' } + stage('Build on Leap 42.3') { + when { + beforeAgent true + allOf { + environment name: 'LEAP42_3_DOCKER', value: 'true' + not { branch 'weekly-testing' } + expression { env.CHANGE_TARGET != 'weekly-testing' } + } + } agent { dockerfile { filename 'Dockerfile.leap.42.3' @@ -703,9 +962,12 @@ pipeline { */ sh "rm -rf _build.external${arch}" } - unstable { - sh "mv config${arch}.log config.log-leap42sp3-gcc" - archiveArtifacts artifacts: 'config.log-leap42sp3-gcc' + unsuccessful { + sh """if [ -f config${arch}.log ]; then + mv config${arch}.log config.log-leap42.3-gcc + fi""" + archiveArtifacts artifacts: 'config.log-leap42.3-gcc', + allowEmptyArchive: true /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, @@ -713,21 +975,13 @@ pipeline { status: 'FAILURE' */ } - failure { - sh "mv config${arch}.log config.log-leap42sp3-gcc" - archiveArtifacts artifacts: 'config.log-leap42sp3-gcc' - /* temporarily moved into stepResult due to JENKINS-39203 - githubNotify credentialsId: 'daos-jenkins-commit-status', - description: env.STAGE_NAME, - context: 'build/' + env.STAGE_NAME, - status: 'ERROR' - */ - } } } stage('Build on Leap 15') { - when { beforeAgent true - branch 'master' } + when { + beforeAgent true + branch 'master' + } agent { dockerfile { filename 'Dockerfile.leap.15' @@ -765,9 +1019,12 @@ pipeline { */ sh "rm -rf _build.external${arch}" } - unstable { - sh "mv config${arch}.log config.log-leap15-gcc" - archiveArtifacts artifacts: 'config.log-leap15-gcc' + unsuccessful { + sh """if [ -f config${arch}.log ]; then + mv config${arch}.log config.log-leap15-gcc + fi""" + archiveArtifacts artifacts: 'config.log-leap15-gcc', + allowEmptyArchive: true /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, @@ -775,21 +1032,13 @@ pipeline { status: 'FAILURE' */ } - failure { - sh "mv config${arch}.log config.log-leap15-gcc" - archiveArtifacts artifacts: 'config.log-leap15-gcc' - /* temporarily moved into stepResult due to JENKINS-39203 - githubNotify credentialsId: 'daos-jenkins-commit-status', - description: env.STAGE_NAME, - context: 'build/' + env.STAGE_NAME, - status: 'ERROR' - */ - } } } stage('Build on Leap 15 with Clang') { - when { beforeAgent true - branch 'master' } + when { + beforeAgent true + branch 'master' + } agent { dockerfile { filename 'Dockerfile.leap.15' @@ -827,9 +1076,12 @@ pipeline { */ sh "rm -rf _build.external${arch}" } - unstable { - sh "mv config${arch}.log config.log-leap15-clang" - archiveArtifacts artifacts: 'config.log-leap15-clang' + unsuccessful { + sh """if [ -f config${arch}.log ]; then + mv config${arch}.log config.log-leap15-clang + fi""" + archiveArtifacts artifacts: 'config.log-leap15-clang', + allowEmptyArchive: true /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, @@ -837,19 +1089,16 @@ pipeline { status: 'FAILURE' */ } - failure { - sh "mv config${arch}.log config.log-leap15-clang" - archiveArtifacts artifacts: 'config.log-leap15-clang' - /* temporarily moved into stepResult due to JENKINS-39203 - githubNotify credentialsId: 'daos-jenkins-commit-status', - description: env.STAGE_NAME, - context: 'build/' + env.STAGE_NAME, - status: 'ERROR' - */ - } } } stage('Build on Leap 15 with Intel-C') { + when { + beforeAgent true + allOf { + not { branch 'weekly-testing' } + expression { env.CHANGE_TARGET != 'weekly-testing' } + } + } agent { dockerfile { filename 'Dockerfile.leap.15' @@ -880,7 +1129,7 @@ pipeline { */ } success { - /* temporarily moved into stepResult due to JENKINS-39203 + /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, context: 'build/' + env.STAGE_NAME, @@ -888,9 +1137,12 @@ pipeline { */ sh "rm -rf _build.external${arch}" } - unstable { - sh "mv config${arch}.log config.log-leap15-intelc" - archiveArtifacts artifacts: 'config.log-leap15-intelc' + unsuccessful { + sh """if [ -f config${arch}.log ]; then + mv config${arch}.log config.log-leap15-intelc + fi""" + archiveArtifacts artifacts: 'config.log-leap15-intelc', + allowEmptyArchive: true /* temporarily moved into stepResult due to JENKINS-39203 githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, @@ -898,21 +1150,20 @@ pipeline { status: 'FAILURE' */ } - failure { - sh "mv config${arch}.log config.log-leap15-intelc" - archiveArtifacts artifacts: 'config.log-leap15-intelc' - /* temporarily moved into stepResult due to JENKINS-39203 - githubNotify credentialsId: 'daos-jenkins-commit-status', - description: env.STAGE_NAME, - context: 'build/' + env.STAGE_NAME, - status: 'ERROR' - */ - } } } } } stage('Test') { + when { + beforeAgent true + // expression { skipTest != true } + expression { env.NO_CI_TESTING != 'true' } + expression { + sh script: 'git show -s --format=%B | grep "^Skip-test: true"', + returnStatus: true + } + } parallel { stage('Single-node') { agent { @@ -921,7 +1172,9 @@ pipeline { steps { provisionNodes NODELIST: env.NODELIST, node_count: 1, - snapshot: true + snapshot: true, + inst_repos: component_repos, + inst_rpms: cart_rpms runTest stashes: [ 'CentOS-install', 'CentOS-build-vars' ], script: '''export PDSH_SSH_ARGS_APPEND="-i ci_key" export CART_TEST_MODE=native @@ -975,7 +1228,9 @@ pipeline { steps { provisionNodes NODELIST: env.NODELIST, node_count: 1, - snapshot: true + snapshot: true, + inst_repos: component_repos, + inst_rpms: cart_rpms runTest stashes: [ 'CentOS-install', 'CentOS-build-vars' ], script: '''export PDSH_SSH_ARGS_APPEND="-i ci_key" export CART_TEST_MODE=memcheck @@ -1043,7 +1298,9 @@ pipeline { steps { provisionNodes NODELIST: env.NODELIST, node_count: 2, - snapshot: true + snapshot: true, + inst_repos: component_repos, + inst_rpms: cart_rpms runTest stashes: [ 'CentOS-install', 'CentOS-build-vars' ], script: '''export PDSH_SSH_ARGS_APPEND="-i ci_key" export CART_TEST_MODE=none @@ -1097,7 +1354,9 @@ pipeline { steps { provisionNodes NODELIST: env.NODELIST, node_count: 3, - snapshot: true + snapshot: true, + inst_repos: component_repos, + inst_rpms: cart_rpms runTest stashes: [ 'CentOS-install', 'CentOS-build-vars' ], script: '''export PDSH_SSH_ARGS_APPEND="-i ci_key" export CART_TEST_MODE=none @@ -1151,7 +1410,9 @@ pipeline { steps { provisionNodes NODELIST: env.NODELIST, node_count: 5, - snapshot: true + snapshot: true, + inst_repos: component_repos, + inst_rpms: cart_rpms runTest stashes: [ 'CentOS-install', 'CentOS-build-vars' ], script: '''export PDSH_SSH_ARGS_APPEND="-i ci_key" export CART_TEST_MODE=none diff --git a/Makefile b/Makefile deleted file mode 100644 index 8c4bbadb7..000000000 --- a/Makefile +++ /dev/null @@ -1,233 +0,0 @@ -NAME := cart -SRC_EXT := gz -SOURCE = $(NAME)-$(VERSION).tar.$(SRC_EXT) -ID_LIKE=$(shell . /etc/os-release; echo $$ID_LIKE) -ifneq ($(ID_LIKE),debian) -PATCHES = scons_local-$(VERSION).tar.$(SRC_EXT) -endif - -%.$(SRC_EXT): % - rm -f $@ - gzip $< - -dist: $(SOURCES) - -GIT_SHORT := $(shell git rev-parse --short HEAD) -GIT_NUM_COMMITS := $(shell git rev-list HEAD --count) - -BUILD_DEFINES := --define "%relval .$(GIT_NUM_COMMITS).g$(GIT_SHORT)" -MOCK_OPTIONS := $(BUILD_DEFINES) -COMMON_RPM_ARGS := --define "%_topdir $$PWD/_topdir" $(BUILD_DEFINES) - -DIST := $(shell rpm $(COMMON_RPM_ARGS) --eval %{?dist}) -ifeq ($(DIST),) -SED_EXPR := 1p -else -SED_EXPR := 1s/$(DIST)//p -endif -SPEC := $(NAME).spec -VERSION := $(shell rpm $(COMMON_RPM_ARGS) --specfile --qf '%{version}\n' $(SPEC) | sed -n '1p') -DOT := . -DEB_VERS := $(subst rc,~rc,$(VERSION)) -DEB_RVERS := $(subst $(DOT),\$(DOT),$(DEB_VERS)) -DEB_BVERS := $(basename $(subst ~rc,$(DOT)rc,$(DEB_VERS))) -RELEASE := $(shell rpm $(COMMON_RPM_ARGS) --specfile --qf '%{release}\n' $(SPEC) | sed -n '$(SED_EXPR)') -SRPM := _topdir/SRPMS/$(NAME)-$(VERSION)-$(RELEASE)$(DIST).src.rpm -RPMS := $(addsuffix .rpm,$(addprefix _topdir/RPMS/x86_64/,$(shell rpm --specfile $(SPEC)))) -DEB_TOP := _topdir/BUILD -DEB_BUILD := $(DEB_TOP)/$(NAME)-$(DEB_VERS) -DEB_TARBASE := $(DEB_TOP)/$(NAME)_$(DEB_VERS) -DEBS := $(addsuffix _$(DEB_VERS)-1_amd64.deb,$(shell sed -n 's,^Package:[[:blank:]],$(DEB_TOP)/,p' debian/control)) -SOURCES := $(addprefix _topdir/SOURCES/,$(notdir $(SOURCE)) $(PATCHES)) -ifeq ($(ID_LIKE),debian) -#Ubuntu Containers do not set a UTF-8 environment by default. -ifndef LANG -export LANG = C.UTF-8 -endif -ifndef LC_ALL -export LC_ALL = C.UTF-8 -endif -TARGETS := $(DEBS) -else -TARGETS := $(RPMS) $(SRPM) -endif - -all: $(TARGETS) - -%/: - mkdir -p $@ - -_topdir/SOURCES/%: % | _topdir/SOURCES/ - rm -f $@ - ln $< $@ - -ifeq ($(ID_LIKE),debian) -# debian wants all the submodules in the source tarball. -$(NAME)-$(VERSION).tar: $(shell find debian -type f) Makefile | $(DEB_BUILD)/ - git archive --format tar --prefix $(NAME)-$(VERSION)/ -o $@ HEAD - p=$$(pwd) && (echo .; git submodule foreach) | \ - while read entering path; do \ - path1="$${path%\'}"; \ - path2="$${path1#\'}"; \ - [ "$$path2" = "" ] && continue; \ - (cd $$path2 && git archive \ - --prefix $(NAME)-$(VERSION)/$$path2/ HEAD > \ - $$p/$(DEB_TOP)/tmp.tar && tar --concatenate \ - --file=$$p/$@ $$p/$(DEB_TOP)/tmp.tar && \ - rm $$p/$(DEB_TOP)/tmp.tar); \ - done - rm -f $(DEB_BUILD).tar.$(SRC_EXT) - rm -f $(DEB_TARBASE).orig.tar.$(SRC_EXT) -else -scons_local-$(VERSION).tar: - cd scons_local && \ - git archive --format tar --prefix scons_local/ -o ../$@ HEAD - -$(NAME)-$(VERSION).tar: - git archive --format tar --prefix $(NAME)-$(VERSION)/ -o $@ HEAD -endif - -v$(VERSION).tar.$(SRC_EXT): - curl -f -L -O '$(SOURCE)' - -$(VERSION).tar.$(SRC_EXT): - curl -f -L -O '$(SOURCE)' - -$(DEB_TOP)/%: % | $(DEB_TOP)/ - -$(DEB_BUILD)/%: % | $(DEB_BUILD)/ - -$(DEB_BUILD).tar.$(SRC_EXT): $(notdir $(SOURCE)) | $(DEB_TOP)/ - ln -f $< $@ - -$(DEB_TARBASE).orig.tar.$(SRC_EXT) : $(DEB_BUILD).tar.$(SRC_EXT) - ln -f $< $@ - -# Unpack tarball -$(DEB_TOP)/.detar: $(notdir $(SOURCE)) $(DEB_TARBASE).orig.tar.$(SRC_EXT) - rm -rf ./$(DEB_BUILD)/* - mkdir -p $(DEB_BUILD) - tar -C $(DEB_BUILD) --strip-components=1 -xpf $< - touch $@ - -# Extract patches for Debian -$(DEB_TOP)/.patched: $(PATCHES) | $(DEB_BUILD)/debian/ - mkdir -p ${DEB_BUILD}/debian/patches - mkdir -p $(DEB_TOP)/patches - for f in $(PATCHES); do \ - rm -f $(DEB_TOP)/patches/*; \ - if git mailsplit -o$(DEB_TOP)/patches < "$$f" ;then \ - fn=$$(basename "$$f"); \ - for f1 in $(DEB_TOP)/patches/*; do \ - f1n=$$(basename "$$f1"); \ - echo "$${fn}_$${f1n}" >> $(DEB_BUILD)/debian/patches/series ; \ - mv "$$f1" $(DEB_BUILD)/debian/patches/$${fn}_$${f1n}; \ - done; \ - else \ - fb=$$(basename "$$f"); \ - cp "$$f" $(DEB_BUILD)/debian/patches/ ; \ - echo "$$fb" >> $(DEB_BUILD)/debian/patches/series ; \ - if ! grep -q "^Description:\|^Subject:" "$$f" ;then \ - sed -i '1 iSubject: Auto added patch' \ - "$(DEB_BUILD)/debian/patches/$$fb" ;fi ; \ - if ! grep -q "^Origin:\|^Author:\|^From:" "$$f" ;then \ - sed -i '1 iOrigin: other' \ - "$(DEB_BUILD)/debian/patches/$$fb" ;fi ; \ - fi ; \ - done - touch $@ - -# Move the debian files into the Debian directory. -$(DEB_TOP)/.deb_files : $(shell find debian -type f) \ - $(DEB_TOP)/.detar | \ - $(DEB_BUILD)/debian/ - find debian -maxdepth 1 -type f -exec cp '{}' '$(DEB_BUILD)/{}' ';' - if [ -e debian/source ]; then \ - cp -r debian/source $(DEB_BUILD)/debian; fi - rm -f $(DEB_BUILD)/debian/*.ex $(DEB_BUILD)/debian/*.EX - rm -f $(DEB_BUILD)/debian/*.orig - touch $@ - -# see https://stackoverflow.com/questions/2973445/ for why we subst -# the "rpm" for "%" to effectively turn this into a multiple matching -# target pattern rule -$(subst rpm,%,$(RPMS)): $(SPEC) $(SOURCES) - rpmbuild -bb $(COMMON_RPM_ARGS) $(RPM_BUILD_OPTIONS) $(SPEC) - -$(subst deb,%,$(DEBS)): $(DEB_BUILD).tar.$(SRC_EXT) check-env \ - $(DEB_TOP)/.deb_files $(DEB_TOP)/.detar $(DEB_TOP)/.patched - rm -f $(DEB_TOP)/*.deb $(DEB_TOP)/*.ddeb $(DEB_TOP)/*.dsc \ - $(DEB_TOP)/*.dsc $(DEB_TOP)/*.build* $(DEB_TOP)/*.changes \ - $(DEB_TOP)/*.debian.tar.* - rm -rf $(DEB_TOP)/*-tmp - cd $(DEB_BUILD); debuild --no-lintian -b -us -uc - cd $(DEB_BUILD); debuild -- clean - git status - rm -rf $(DEB_TOP)/$(NAME)-tmp - lfile1=$(shell echo $(DEB_TOP)/$(NAME)[0-9]*_$(DEB_VERS)-1_amd64.deb);\ - lfile=$$(ls $${lfile1}); \ - lfile2=$${lfile##*/}; lname=$${lfile2%%_*}; \ - dpkg-deb -R $${lfile} \ - $(DEB_TOP)/$(NAME)-tmp; \ - if [ -e $(DEB_TOP)/$(NAME)-tmp/DEBIAN/symbols ]; then \ - sed 's/$(DEB_RVERS)-1/$(DEB_BVERS)/' \ - $(DEB_TOP)/$(NAME)-tmp/DEBIAN/symbols \ - > $(DEB_BUILD)/debian/$${lname}.symbols; fi - cd $(DEB_BUILD); debuild -us -uc - rm $(DEB_BUILD).tar.$(SRC_EXT) - for f in $(DEB_TOP)/*.deb; do \ - echo $$f; dpkg -c $$f; done - -$(SRPM): $(SPEC) $(SOURCES) - rpmbuild -bs $(COMMON_RPM_ARGS) $(SPEC) - -srpm: $(SRPM) - -$(RPMS): Makefile - -rpms: $(RPMS) - -$(DEBS): Makefile - -debs: $(DEBS) - -ls: $(TARGETS) - ls -ld $^ - -mockbuild: $(SRPM) Makefile - mock $(MOCK_OPTIONS) $< - -rpmlint: $(SPEC) - rpmlint $< - -#Debian wants a distclean target -distclean: - @echo "distclean" - -check-env: -ifndef DEBEMAIL - $(error DEBEMAIL is undefined) -endif -ifndef DEBFULLNAME - $(error DEBFULLNAME is undefined) -endif - -show_version: - @echo $(VERSION) - -show_release: - @echo $(RELEASE) - -show_rpms: - @echo $(RPMS) - -show_source: - @echo $(SOURCE) - -show_sources: - @echo $(SOURCES) - -show_targets: - @echo $(TARGETS) - -.PHONY: srpm rpms debs ls mockbuild rpmlint FORCE show_version show_release show_rpms show_source show_sources show_targets check-env distclean diff --git a/utils/build.config b/utils/build.config index e660e21be..f91600c32 100644 --- a/utils/build.config +++ b/utils/build.config @@ -3,7 +3,7 @@ component=cart [commit_versions] OFI = 3712eb04919fb9542659da326d295734d974013d -OMPI = 373098d8ae0053af85cc1d49a58dbe933a31a50a -OPENPA = 8e1e74feb22d2e733f34a96e6c7834fed3073c52 +OMPI = v3.0.0rc4 +OPENPA = v1.0.4 MERCURY = 7b529b63e4003fb15ebdbf2dfdf29ab2a3d3c132 -PMIX = 8c2ffe7e6837a2fb76b882e4c5765032b2b84fa9 +PMIX = 8c2ffe7e6837a2fb76b882e4c5765032b2b84fa9 \ No newline at end of file diff --git a/utils/docker/Dockerfile-debbuild.ubuntu.18.04 b/utils/docker/Dockerfile-debbuild.ubuntu.18.04 deleted file mode 100644 index fad5e82c3..000000000 --- a/utils/docker/Dockerfile-debbuild.ubuntu.18.04 +++ /dev/null @@ -1,101 +0,0 @@ -# -# Copyright 2019, Intel Corporation -# -# 'recipe' for Docker to build an Debian package -# -# Pull base image -FROM ubuntu:18.04 -Maintainer John.E.Malmberg - -# Install basic tools -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - autoconf bash curl debhelper dh-make dpkg-dev doxygen gcc \ - git git-buildpackage locales make patch rpm wget - -# libfabric -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - libibverbs-dev libpsm-infinipath1-dev librdmacm-dev - -ENV UBUNTU_URL="https://launchpad.net/ubuntu/+archive/primary/+files" -RUN curl -sS -f -L -O ${UBUNTU_URL}/libpsm2-2_10.3.58-1_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/libpsm2-dev_10.3.58-1_amd64.deb; \ - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ./libpsm2-2_10.3.58-1_amd64.deb ./libpsm2-dev_10.3.58-1_amd64.deb - -ARG JENKINS_URL="" -ENV JENKINS_PATH="${JENKINS_URL}/job/daos-stack/job" -ENV JENKINS_ART="lastSuccessfulBuild/artifact/artifacts" - -# Uncomment this CACHEBUST line if testing PRs for dependent components. -# It should be commented out before the merge to master -#ARG CACHEBUST=1 - -ARG OFIBRANCH="master" -ENV OFI_ART=\ -"${JENKINS_PATH}/libfabric/job/${OFIBRANCH}/${JENKINS_ART}/ubuntu18.04" - -# Mercury -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - cmake libboost-dev libevent-dev pkg-config - -RUN curl -sS -f -L -O ${OFI_ART}/libfabric1_1.8.0-1_amd64.deb; \ - curl -sS -f -L -O ${OFI_ART}/libfabric-dev_1.8.0-1_amd64.deb; \ - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ./libfabric1_1.8.0-1_amd64.deb ./libfabric-dev_1.8.0-1_amd64.deb - -# CaRT - -ARG MERBRANCH="master" -ENV MER_ART=\ -"${JENKINS_PATH}/mercury/job/${MERBRANCH}/${JENKINS_ART}/ubuntu18.04" - -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - dh-python libcmocka-dev \ - libssl-dev libyaml-dev scons uuid-dev - -RUN curl -sS -f -L -O ${UBUNTU_URL}/libopenmpi-dev_3.1.2-6_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/libopenmpi3_3.1.2-6_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/openmpi-common_3.1.2-6_all.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/openmpi-bin_3.1.2-6_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/libc6_2.28-0ubuntu1_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/libc6-dev_2.28-0ubuntu1_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/libc-dev-bin_2.28-0ubuntu1_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/libc-bin_2.28-0ubuntu1_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/libhwloc5_1.11.10-3_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/libhwloc-dev_1.11.10-3_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/libhwloc-plugins_1.11.10-3_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/libpmix2_3.0.1-2_amd64.deb; \ - curl -sS -f -L -O ${UBUNTU_URL}/libpmix-dev_3.0.1-2_amd64.deb; \ - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ./libpmix2_3.0.1-2_amd64.deb ./libpmix-dev_3.0.1-2_amd64.deb \ - ./libhwloc5_1.11.10-3_amd64.deb ./libhwloc-dev_1.11.10-3_amd64.deb \ - ./libhwloc-plugins_1.11.10-3_amd64.deb \ - ./libc6_2.28-0ubuntu1_amd64.deb ./libc6-dev_2.28-0ubuntu1_amd64.deb \ - ./libc-dev-bin_2.28-0ubuntu1_amd64.deb \ - ./libc-bin_2.28-0ubuntu1_amd64.deb \ - ./libopenmpi-dev_3.1.2-6_amd64.deb ./libopenmpi3_3.1.2-6_amd64.deb \ - ./openmpi-common_3.1.2-6_all.deb ./openmpi-bin_3.1.2-6_amd64.deb; \ - find /usr -name 'libpmix.so*'; \ - rm -f /usr/lib/x86_64-linux-gnu/pmix/lib/libpmix.so; \ - ln -s /usr/lib/x86_64-linux-gnu/pmix/lib/libpmix.so.2 \ - /usr/lib/x86_64-linux-gnu/pmix/lib/libpmix.so - -RUN curl -sS -f -L -O ${MER_ART}/libmercury1_1.0.1-9_amd64.deb; \ - curl -sS -f -L -O ${MER_ART}/libmercury-dev_1.0.1-9_amd64.deb; \ - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ./libmercury*_amd64.deb - -# Temporarily needed until cart dependencies fixed - -ARG OPABRANCH="master" -ENV OPA_ART=\ -"${JENKINS_PATH}/openpa/job/${OPABRANCH}/${JENKINS_ART}/ubuntu18.04" -RUN curl -sS -f -L -O ${OPA_ART}/libopa1_1.0.4-1_amd64.deb; \ - curl -sS -f -L -O ${OPA_ART}/libopa-dev_1.0.4-1_amd64.deb; \ - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ./libopa*_amd64.deb - -# force an upgrade to get any newly built packages -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y; \ - apt-get autoremove -y - diff --git a/utils/docker/Dockerfile-debbuild.ubuntu.18.10 b/utils/docker/Dockerfile-debbuild.ubuntu.18.10 deleted file mode 100644 index d319a0f06..000000000 --- a/utils/docker/Dockerfile-debbuild.ubuntu.18.10 +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright 2019, Intel Corporation -# -# 'recipe' for Docker to build an Debian package -# -# Pull base image -FROM ubuntu:18.10 -Maintainer John.E.Malmberg - -# Install basic tools -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - autoconf bash curl debhelper dh-make dpkg-dev doxygen gcc \ - git git-buildpackage locales make patch rpm wget - -# libfabric -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - libibverbs-dev libpsm-infinipath1-dev librdmacm-dev \ - libpsm2-dev - -# Uncomment this CACHEBUST line if testing PRs for dependent components. -# It should be commented out before the merge to master -#ARG CACHEBUST=1 - -ARG JENKINS_URL="" -ENV JENKINS_PATH="${JENKINS_URL}/job/daos-stack/job" -ENV JENKINS_ART="lastSuccessfulBuild/artifact/artifacts" - -ARG OFIBRANCH="master" -ENV OFI_ART=\ -"${JENKINS_PATH}/libfabric/job/${OFIBRANCH}/${JENKINS_ART}/ubuntu18.10" - -# Mercury -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - cmake libboost-dev libevent-dev pkg-config - -RUN curl -sS -f -L -O ${OFI_ART}/libfabric1_1.8.0-1_amd64.deb; \ - curl -sS -f -L -O ${OFI_ART}/libfabric-dev_1.8.0-1_amd64.deb; \ - apt-get install -y ./libfabric*_amd64.deb - -# CaRT - -ARG MERBRANCH="master" -ENV MER_ART=\ -"${JENKINS_PATH}/mercury/job/${MERBRANCH}/${JENKINS_ART}/ubuntu18.10" - -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - dh-python libcmocka-dev libhwloc-dev libopenmpi-dev libpmix-dev \ - libssl-dev libyaml-dev scons uuid-dev openmpi-bin; \ - find /usr -name 'libpmix.so*'; \ - rm /usr/lib/x86_64-linux-gnu/pmix/lib/libpmix.so; \ - ln -s /usr/lib/x86_64-linux-gnu/pmix/lib/libpmix.so.2 \ - /usr/lib/x86_64-linux-gnu/pmix/lib/libpmix.so - - -RUN curl -sS -f -L -O ${MER_ART}/libmercury1_1.0.1-9_amd64.deb; \ - curl -sS -f -L -O ${MER_ART}/libmercury-dev_1.0.1-9_amd64.deb; \ - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ./libmercury*_amd64.deb - -# Temporarily needed until cart dependencies fixed - -ARG OPABRANCH="master" -ENV OPA_ART=\ -"${JENKINS_PATH}/openpa/job/${OPABRANCH}/${JENKINS_ART}/ubuntu18.04" - -RUN curl -sS -f -L -O ${OPA_ART}/libopa1_1.0.4-1_amd64.deb; \ - curl -sS -f -L -O ${OPA_ART}/libopa-dev_1.0.4-1_amd64.deb; \ - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - ./libopa*_amd64.deb - - -# force an upgrade to get any newly built packages -ARG CACHEBUST=1 -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y; \ - apt-get autoremove -y diff --git a/utils/docker/Dockerfile-mockbuild.centos.7 b/utils/docker/Dockerfile-mockbuild.centos.7 deleted file mode 100644 index a54ec886e..000000000 --- a/utils/docker/Dockerfile-mockbuild.centos.7 +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright 2018-2019, Intel Corporation -# -# 'recipe' for Docker to build an RPM -# - -# Pull base image -FROM centos:7 -MAINTAINER Brian J. Murrell - -# use same UID as host and default value of 1000 if not specified -ARG UID=1000 - -# Update distribution -#Nothing to do for CentOS - -# Install basic tools -RUN yum -y install epel-release -RUN yum -y install mock make rpm-build curl createrepo rpmlint git - -# Add build user (to keep rpmbuild happy) -ENV USER build -ENV PASSWD build -RUN useradd -u $UID -ms /bin/bash $USER -RUN echo "$USER:$PASSWD" | chpasswd -# add the user to the mock group so it can run mock -RUN usermod -a -G mock $USER - -# mock in Docker needs to use the old-chroot option -RUN echo "config_opts['use_nspawn'] = False" >> /etc/mock/site-defaults.cfg - -ARG JENKINS_URL="" - -RUN echo -e "config_opts['yum.conf'] += \"\"\"\n" >> /etc/mock/default.cfg; \ - for repo in openpa libfabric pmix ompi mercury; do \ - if [[ $repo = *@* ]]; then \ - branch="${repo#*@}"; \ - repo="${repo%@*}"; \ - else \ - branch="master"; \ - fi; \ - echo -e "[$repo:$branch:lastSuccessful]\n\ -name=$repo:$branch:lastSuccessful\n\ -baseurl=${JENKINS_URL}job/daos-stack/job/$repo/job/$branch/lastSuccessfulBuild/artifact/artifacts/centos7/\n\ -enabled=1\n\ -gpgcheck = False\n" >> /etc/mock/default.cfg; \ - done; \ - echo "\"\"\"" >> /etc/mock/default.cfg - -RUN yum -y install redhat-lsb-core diff --git a/utils/docker/Dockerfile-rpmbuild.leap.42.3 b/utils/docker/Dockerfile-rpmbuild.leap.42.3 deleted file mode 100644 index 9a1284619..000000000 --- a/utils/docker/Dockerfile-rpmbuild.leap.42.3 +++ /dev/null @@ -1,72 +0,0 @@ -# -# Copyright 2019, Intel Corporation -# -# 'recipe' for Docker to build an RPM -# - -# Pull base image -FROM opensuse/leap:42.3 -MAINTAINER Brian J. Murrell - -# use same UID as host and default value of 1000 if not specified -ARG UID=1000 - -# Add build user (to keep rpmbuild happy) -ENV USER build -ENV PASSWD build -RUN useradd -u $UID -ms /bin/bash $USER -RUN groupadd -g $UID $USER -RUN echo "$USER:$PASSWD" | chpasswd - -# Install basic tools -RUN zypper --non-interactive update -# basic building -RUN zypper --non-interactive install make rpm-build curl createrepo git \ - lsb-release autoconf automake libtool \ - ca-certificates-mozilla -# libfabric -RUN zypper --non-interactive install rdma-core-devel libnl3-devel \ - infinipath-psm-devel valgrind-devel -# mercury -ARG JENKINS_URL="" -RUN zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/openpa/job/master/lastSuccessfulBuild/artifact/artifacts/leap42.3/ openpa; \ - zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/libfabric/job/master/lastSuccessfulBuild/artifact/artifacts/leap42.3/ libfabric; \ - zypper --non-interactive ref openpa libfabric -# our libfabric conflicts with libfabric1 -# TODO: consider if we should rename ours or replace libfabric1, etc. -RUN if rpm -q libfabric1; then zypper --non-interactive remove libfabric1; fi -RUN zypper --non-interactive install gcc-c++ -RUN zypper --non-interactive --no-gpg-check install openpa-devel \ - libfabric-devel \ - cmake boost-devel -# pmix -RUN zypper --non-interactive install libevent-devel - -# ompi -RUN zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/pmix/job/master/lastSuccessfulBuild/artifact/artifacts/leap42.3/ pmix; \ - zypper --non-interactive ref pmix -RUN zypper --non-interactive install hwloc-devel pmix-devel flex - -# scons -RUN zypper --non-interactive install fdupes - -# cart -RUN zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/mercury/job/master/lastSuccessfulBuild/artifact/artifacts/leap42.3/ mercury; \ - zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/ompi/job/master/lastSuccessfulBuild/artifact/artifacts/leap42.3/ ompi; \ - zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/scons/job/master/lastSuccessfulBuild/artifact/artifacts/leap42.3/ scons; \ - zypper --non-interactive --gpg-auto-import-keys ref mercury ompi scons -RUN zypper --non-interactive install scons libyaml-devel mercury-devel \ - ompi-devel openssl-devel -RUN zypper --non-interactive ar https://download.opensuse.org/repositories/devel:libraries:c_c++/openSUSE_Leap_42.3/devel:libraries:c_c++.repo; \ - zypper --non-interactive --gpg-auto-import-keys ref 'A project for basic libraries shared among multiple projects (openSUSE_Leap_42.3)' -RUN zypper --non-interactive install libcmocka-devel - -# force an upgrade to get any newly built RPMs -ARG CACHEBUST=1 -RUN zypper --non-interactive up diff --git a/utils/docker/Dockerfile-rpmbuild.sles.12.3 b/utils/docker/Dockerfile-rpmbuild.sles.12.3 deleted file mode 100644 index e5172480a..000000000 --- a/utils/docker/Dockerfile-rpmbuild.sles.12.3 +++ /dev/null @@ -1,74 +0,0 @@ -# -# Copyright 2019, Intel Corporation -# -# 'recipe' for Docker to build an RPM -# - -# Pull base image -FROM suse/sles:12.3 -MAINTAINER Brian J. Murrell - -# use same UID as host and default value of 1000 if not specified -ARG UID=1000 - -# Add build user (to keep rpmbuild happy) -ENV USER build -ENV PASSWD build -RUN useradd -u $UID -ms /bin/bash $USER -RUN groupadd -g $UID $USER -RUN echo "$USER:$PASSWD" | chpasswd - -# Install basic tools -RUN zypper --non-interactive update -# basic building -RUN zypper --non-interactive install make rpm-build curl createrepo git \ - lsb-release autoconf automake libtool \ - ca-certificates-mozilla -# libfabric -RUN zypper --non-interactive install rdma-core-devel libnl3-devel \ - infinipath-psm-devel valgrind-devel -# mercury -ARG JENKINS_URL="" -RUN zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/openpa/job/master/lastSuccessfulBuild/artifact/artifacts/sles12.3/ openpa; \ - zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/libfabric/job/master/lastSuccessfulBuild/artifact/artifacts/sles12.3/ libfabric; \ - zypper --non-interactive ref openpa libfabric -# our libfabric conflicts with libfabric1 -# TODO: consider if we should rename ours or replace libfabric1, etc. -RUN if rpm -q libfabric1; then zypper --non-interactive remove libfabric1; fi -RUN zypper --non-interactive install gcc-c++ -RUN zypper --non-interactive --no-gpg-check install openpa-devel \ - libfabric-devel \ - cmake boost-devel -# pmix -RUN zypper --non-interactive install libevent-devel - -# ompi -RUN zypper --non-interactive ar -f https://download.opensuse.org/repositories/science:/HPC:/SLE12SP3_Missing/SLE_12_SP3/ hwloc; \ - zypper --non-interactive --gpg-auto-import-keys ref hwloc; \ - zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/pmix/job/master/lastSuccessfulBuild/artifact/artifacts/sles12.3/ pmix; \ - zypper --non-interactive ref pmix -RUN zypper --non-interactive install hwloc-devel pmix-devel flex - -# scons -RUN zypper --non-interactive install fdupes - -# cart -RUN zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/mercury/job/master/lastSuccessfulBuild/artifact/artifacts/sles12.3/ mercury; \ - zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/ompi/job/master/lastSuccessfulBuild/artifact/artifacts/sles12.3/ ompi; \ - zypper --non-interactive ar --gpgcheck-allow-unsigned -f \ - ${JENKINS_URL}job/daos-stack/job/scons/job/master/lastSuccessfulBuild/artifact/artifacts/sles12.3/ scons; \ - zypper --non-interactive --gpg-auto-import-keys ref mercury ompi scons -RUN zypper --non-interactive install scons libyaml-devel mercury-devel \ - ompi-devel openssl-devel -RUN zypper --non-interactive ar https://download.opensuse.org/repositories/devel:libraries:c_c++/SLE_12_SP3/devel:libraries:c_c++.repo; \ - zypper --non-interactive --gpg-auto-import-keys ref 'A project for basic libraries shared among multiple projects (SLE_12_SP3)' -RUN zypper --non-interactive install libcmocka-devel - -# force an upgrade to get any newly built RPMs -ARG CACHEBUST=1 -RUN zypper --non-interactive up diff --git a/utils/rpms/Makefile b/utils/rpms/Makefile new file mode 100644 index 000000000..e038983e2 --- /dev/null +++ b/utils/rpms/Makefile @@ -0,0 +1,40 @@ +NAME := cart +SRC_EXT := gz +SOURCE = $(NAME)-$(VERSION).tar.$(SRC_EXT) +PATCHES = scons_local-$(VERSION).tar.$(SRC_EXT) + +SLES_12_PR_REPOS := scons +LEAP_42_PR_REPOS := scons +LEAP_42_REPOS := https://download.opensuse.org/repositories/science:/HPC/openSUSE_Leap_42.3 +SLES_12_REPOS := https://download.opensuse.org/repositories/science:/HPC/openSUSE_Leap_42.3 \ + https://download.opensuse.org/repositories/science:/HPC:/SLE12SP3_Missing/SLE_12_SP3/ \ + https://download.opensuse.org/repositories/devel:libraries:c_c++/SLE_12_SP3/ + +GIT_SHA1 := $(shell git rev-parse HEAD) +GIT_SHORT := $(shell git rev-parse --short HEAD) +GIT_NUM_COMMITS := $(shell git rev-list HEAD --count) + +BUILD_DEFINES := --define "%relval .$(GIT_NUM_COMMITS).g$(GIT_SHORT)" --define "%sha1 $(GIT_SHA1)" +RPM_BUILD_OPTIONS := $(BUILD_DEFINES) + +dist: $(SOURCES) + +include packaging/Makefile_packaging.mk + +PACKAGING_CHECK_DIR ?= ../../../rpm/packaging + +scons_local-$(VERSION).tar.gz: + cd ../../scons_local && \ + git archive --format tar --prefix scons_local/ \ + -o $$OLDPWD/$(basename $@) HEAD ./ + rm -f $@ + gzip $(basename $@) + +$(NAME)-$(VERSION).tar.gz: + echo $@ + echo $(basename $@) + cd ../../ && \ + git archive --format tar --prefix $(NAME)-$(VERSION)/ \ + -o $$OLDPWD/$(basename $@) HEAD ./ + rm -f $@ + gzip $(basename $@) diff --git a/cart.spec b/utils/rpms/cart.spec similarity index 79% rename from cart.spec rename to utils/rpms/cart.spec index 3997389c9..b9957f274 100644 --- a/cart.spec +++ b/utils/rpms/cart.spec @@ -2,15 +2,15 @@ Name: cart Version: 1.6.0 -Release: 1%{?relval}%{?dist} +Release: 2%{?relval}%{?dist} Summary: CaRT License: Apache -URL: https//github.com/daos-stack/cart +URL: https://github.com/daos-stack/cart Source0: %{name}-%{version}.tar.gz Source1: scons_local-%{version}.tar.gz -BuildRequires: scons +BuildRequires: scons >= 2.4 BuildRequires: libfabric-devel BuildRequires: pmix-devel BuildRequires: openpa-devel @@ -23,23 +23,17 @@ BuildRequires: hwloc-devel BuildRequires: openssl-devel BuildRequires: libcmocka-devel BuildRequires: libyaml-devel -Requires: libfabric -Requires: pmix -Requires: openpa -Requires: mercury >= 1.0.1-19 -Requires: ompi -Requires: libevent -%if (0%{?rhel} >= 7) -Requires:libuuid -Requires: libyaml -%else %if (0%{?suse_version} >= 1315) -Requires: libuuid1 -Requires: libyaml-0-2 +# these are needed to prefer packages that both provide the same requirement +# prefer over libpsm2-compat +BuildRequires: libpsm_infinipath1 +# prefer over libcurl4-mini +BuildRequires: libcurl4 %endif +BuildRequires: gcc-c++ +%if %{defined sha1} +Provides: %{name}-%{sha1} %endif -Requires: hwloc -Requires: openssl %description Collective and RPC Transport (CaRT) @@ -55,10 +49,18 @@ Summary: CaRT devel # since the so is unversioned, it only exists in the main package # at this time Requires: %{name} = %{version}-%{release} - Requires: libuuid-devel Requires: libyaml-devel Requires: boost-devel +Requires: mercury-devel +Requires: openpa-devel +Requires: libfabric-devel +Requires: ompi-devel +Requires: pmix-devel +Requires: hwloc-devel +%if %{defined sha1} +Provides: %{name}-devel-%{sha1} +%endif %description devel CaRT devel @@ -67,12 +69,14 @@ CaRT devel Summary: CaRT tests Requires: %{name} = %{version}-%{release} +%if %{defined sha1} +Provides: %{name}-tests-%{sha1} +%endif %description tests CaRT tests %prep -%setup -q %setup -q -a 1 @@ -103,11 +107,21 @@ cp -al multi-node-test.sh utils %{?buildroot}%{carthome}/ mv %{?buildroot}%{_prefix}/{TESTING,lib/cart/} ln %{?buildroot}%{carthome}/{TESTING/.build_vars,.build_vars-Linux}.sh +#%if 0%{?suse_version} >= 01315 +#%post -n %{suse_libname} -p /sbin/ldconfig +#%postun -n %{suse_libname} -p /sbin/ldconfig +#%else +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig +#%endif + %files %defattr(-, root, root, -) %{_bindir}/* %{_libdir}/*.so.* +%dir %{carthome} %{carthome}/utils +%dir %{_prefix}%{_sysconfdir} %{_prefix}%{_sysconfdir}/* %doc @@ -122,6 +136,12 @@ ln %{?buildroot}%{carthome}/{TESTING/.build_vars,.build_vars-Linux}.sh %{carthome}/.build_vars-Linux.sh %changelog +* Thu Oct 24 2019 Brian J. Murrell - 1.6.0-2 +- Add BRs to prefer packages that have choices +- Add BR for scons >= 2.4 and gcc-c++ +- Add some dirs to %files so they are owned by a package +- Don't unpack the cart tarball twice + * Wed Oct 23 2019 Alexander Oganezov - Libcart version 1.6.0 diff --git a/debian/cart-docs.docs b/utils/rpms/debian/cart-docs.docs similarity index 100% rename from debian/cart-docs.docs rename to utils/rpms/debian/cart-docs.docs diff --git a/debian/cart-tests.dirs b/utils/rpms/debian/cart-tests.dirs similarity index 100% rename from debian/cart-tests.dirs rename to utils/rpms/debian/cart-tests.dirs diff --git a/debian/cart-tests.install b/utils/rpms/debian/cart-tests.install similarity index 100% rename from debian/cart-tests.install rename to utils/rpms/debian/cart-tests.install diff --git a/debian/cart.dirs b/utils/rpms/debian/cart.dirs similarity index 100% rename from debian/cart.dirs rename to utils/rpms/debian/cart.dirs diff --git a/debian/cart.install b/utils/rpms/debian/cart.install similarity index 100% rename from debian/cart.install rename to utils/rpms/debian/cart.install diff --git a/debian/changelog b/utils/rpms/debian/changelog similarity index 88% rename from debian/changelog rename to utils/rpms/debian/changelog index 8e1563eed..2b7cecac4 100644 --- a/debian/changelog +++ b/utils/rpms/debian/changelog @@ -1,3 +1,9 @@ +cart (1.6.0-2) unstable; urgency=medium + [ Brian J. Murrell ] + * NOOP (RPM build updates) + + -- Brian J. Murrell Thu, 24 Oct 2019 10:28:27 -0400 + cart (1.6.0-1) unstable; urgency=medium [ Alexander Oganezov ] diff --git a/debian/compat b/utils/rpms/debian/compat similarity index 100% rename from debian/compat rename to utils/rpms/debian/compat diff --git a/debian/control b/utils/rpms/debian/control similarity index 100% rename from debian/control rename to utils/rpms/debian/control diff --git a/debian/copyright b/utils/rpms/debian/copyright similarity index 100% rename from debian/copyright rename to utils/rpms/debian/copyright diff --git a/debian/libcart-dev.dirs b/utils/rpms/debian/libcart-dev.dirs similarity index 100% rename from debian/libcart-dev.dirs rename to utils/rpms/debian/libcart-dev.dirs diff --git a/debian/libcart-dev.install b/utils/rpms/debian/libcart-dev.install similarity index 100% rename from debian/libcart-dev.install rename to utils/rpms/debian/libcart-dev.install diff --git a/debian/libcart1.dirs b/utils/rpms/debian/libcart1.dirs similarity index 100% rename from debian/libcart1.dirs rename to utils/rpms/debian/libcart1.dirs diff --git a/debian/libcart1.install b/utils/rpms/debian/libcart1.install similarity index 100% rename from debian/libcart1.install rename to utils/rpms/debian/libcart1.install diff --git a/debian/rules b/utils/rpms/debian/rules similarity index 100% rename from debian/rules rename to utils/rpms/debian/rules diff --git a/debian/source/format b/utils/rpms/debian/source/format similarity index 100% rename from debian/source/format rename to utils/rpms/debian/source/format diff --git a/utils/rpms/packaging/Dockerfile.mockbuild b/utils/rpms/packaging/Dockerfile.mockbuild new file mode 100644 index 000000000..aa660b503 --- /dev/null +++ b/utils/rpms/packaging/Dockerfile.mockbuild @@ -0,0 +1,30 @@ +# +# Copyright 2018-2019, Intel Corporation +# +# 'recipe' for Docker to build an RPM +# + +# Pull base image +FROM fedora:latest +MAINTAINER daos-stack + +# use same UID as host and default value of 1000 if not specified +ARG UID=1000 + +# Install basic tools +RUN yum install -y mock make rpm-build curl createrepo rpmlint redhat-lsb-core \ + git python-srpm-macros + +# Add build user (to keep rpmbuild happy) +ENV USER build +ENV PASSWD build +RUN useradd -u $UID -ms /bin/bash $USER +RUN echo "$USER:$PASSWD" | chpasswd +# add the user to the mock group so it can run mock +RUN usermod -a -G mock $USER + +# mock in Docker needs to use the old-chroot option +RUN grep use_nspawn || \ + echo "config_opts['use_nspawn'] = False" >> /etc/mock/site-defaults.cfg + +RUN chmod g+w /etc/mock/* \ No newline at end of file diff --git a/utils/rpms/packaging/Dockerfile.ubuntu.18.04 b/utils/rpms/packaging/Dockerfile.ubuntu.18.04 new file mode 100644 index 000000000..8518651fb --- /dev/null +++ b/utils/rpms/packaging/Dockerfile.ubuntu.18.04 @@ -0,0 +1,28 @@ +# +# Copyright 2019, Intel Corporation +# +# 'recipe' for Docker to build an Debian package +# +# Pull base image +FROM ubuntu:18.04 +Maintainer John.E.Malmberg + +# Install basic tools +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + autoconf bash curl debhelper dh-make dpkg-dev doxygen gcc \ + git git-buildpackage locales make patch rpm wget + +# libfabric +RUN apt-get install -y \ + libibverbs-dev libpsm-infinipath1-dev librdmacm-dev + +ENV UBUNTU_URL="https://launchpad.net/ubuntu/+archive/primary/+files" +RUN curl -sS -f -L -O ${UBUNTU_URL}/libpsm2-2_10.3.58-1_amd64.deb ; \ + curl -sS -f -L -O ${UBUNTU_URL}/libpsm2-dev_10.3.58-1_amd64.deb ; \ + apt-get install -y \ + ./libpsm2-2_10.3.58-1_amd64.deb ./libpsm2-dev_10.3.58-1_amd64.deb + +# force an upgrade to get any newly built packages +ARG CACHEBUST=1 +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y; \ + apt-get autoremove -y diff --git a/utils/rpms/packaging/Dockerfile.ubuntu.18.10 b/utils/rpms/packaging/Dockerfile.ubuntu.18.10 new file mode 100644 index 000000000..5a3c766f9 --- /dev/null +++ b/utils/rpms/packaging/Dockerfile.ubuntu.18.10 @@ -0,0 +1,24 @@ +# +# Copyright 2019, Intel Corporation +# +# 'recipe' for Docker to build an Debian package +# +# Pull base image +FROM ubuntu:18.10 +Maintainer John.E.Malmberg + +# Install basic tools +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + autoconf bash curl debhelper dh-make dpkg-dev doxygen gcc \ + git git-buildpackage locales make patch rpm wget + +# libfabric +RUN apt-get install -y \ + libibverbs-dev libpsm-infinipath1-dev librdmacm-dev \ + libpsm2-dev + +# force an upgrade to get any newly built packages +ARG CACHEBUST=1 +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y; \ + apt-get autoremove -y + diff --git a/utils/rpms/packaging/Makefile_packaging.mk b/utils/rpms/packaging/Makefile_packaging.mk new file mode 100644 index 000000000..8f0f66392 --- /dev/null +++ b/utils/rpms/packaging/Makefile_packaging.mk @@ -0,0 +1,480 @@ +# Common Makefile for including +# Needs the following variables set at a minium: +# NAME := +# SRC_EXT := +# SOURCE = + +# Put site overrides (i.e. REPOSITORY_URL, DAOS_STACK_*_LOCAL_REPO) in here +-include Makefile.local + +ifeq ($(DEB_NAME),) +DEB_NAME := $(NAME) +endif + +CALLING_MAKEFILE := $(word 1, $(MAKEFILE_LIST)) + +DOT := . +RPM_BUILD_OPTIONS += $(EXTERNAL_RPM_BUILD_OPTIONS) +# Find out what we are +ID_LIKE := $(shell . /etc/os-release; echo $$ID_LIKE) +# Of course that does not work for SLES-12 +ID := $(shell . /etc/os-release; echo $$ID) +VERSION_ID := $(shell . /etc/os-release; echo $$VERSION_ID) +ifeq ($(ID_LIKE),debian) +UBUNTU_VERS := $(shell . /etc/os-release; echo $$VERSION) +ifeq ($(VERSION_ID),19.04) +# Bug - distribution is set to "devel" +DISTRO_ID_OPT = --distribution disco +endif +DISTRO_ID := ubuntu$(VERSION_ID) +DISTRO_BASE = $(basename UBUNTU_$(VERSION_ID)) +VERSION_ID_STR := $(subst $(DOT),_,$(VERSION_ID)) +endif +ifeq ($(ID),fedora) +# a Fedora-based mock builder +# derive the the values of: +# VERSION_ID (i.e. 7) +# DISTRO_ID (i.e. el7) +# DISTRO_BASE (i.e. EL_7) +# from the CHROOT_NAME +ifeq ($(CHROOT_NAME),epel-7-x86_64) +VERSION_ID := 7 +DISTRO_ID := el7 +DISTRO_BASE := EL_7 +endif +ifeq ($(CHROOT_NAME),opensuse-leap-15.1-x86_64) +VERSION_ID := 15.1 +DISTRO_ID := sl15.1 +DISTRO_BASE := LEAP_15 +endif +ifeq ($(CHROOT_NAME),leap-42.3-x86_64) +# TBD if support is ever resurrected +endif +ifeq ($(CHROOT_NAME),sles-12.3-x86_64) +# TBD if support is ever resurrected +endif +endif +ifeq ($(ID),centos) +DISTRO_ID := el$(VERSION_ID) +DISTRO_BASE := $(basename EL_$(VERSION_ID)) +define install_repo + if yum-config-manager --add-repo=$(1); then \ + repo_file=$$(ls -tar /etc/yum.repos.d/*.repo | tail -1); \ + sed -i -e 1d -e '$$s/^/gpgcheck=False/' $$repo_file; \ + else \ + exit 1; \ + fi +endef +endif +ifeq ($(findstring opensuse,$(ID)),opensuse) +ID_LIKE := suse +DISTRO_ID := sl$(VERSION_ID) +DISTRO_BASE := $(basename LEAP_$(VERSION_ID)) +endif +ifeq ($(ID),sles) +# SLES-12 or 15 detected. +ID_LIKE := suse +DISTRO_ID := sle$(VERSION_ID) +DISTRO_BASE := $(basename SLES_$(VERSION_ID)) +endif +ifeq ($(ID_LIKE),suse) +define install_repo + zypper --non-interactive ar $(1) +endef +endif + +BUILD_OS ?= leap.15 +CHROOT_NAME ?= opensuse-leap-15.1-x86_64 +PACKAGING_CHECK_DIR ?= ../packaging +COMMON_RPM_ARGS := --define "%_topdir $$PWD/_topdir" $(BUILD_DEFINES) +DIST := $(shell rpm $(COMMON_RPM_ARGS) --eval %{?dist}) +ifeq ($(DIST),) +SED_EXPR := 1p +else +SED_EXPR := 1s/$(DIST)//p +endif +SPEC := $(NAME).spec +VERSION := $(shell rpm $(COMMON_RPM_ARGS) --specfile --qf '%{version}\n' $(SPEC) | sed -n '1p') +DEB_VERS := $(subst rc,~rc,$(VERSION)) +DEB_RVERS := $(subst $(DOT),\$(DOT),$(DEB_VERS)) +DEB_BVERS := $(basename $(subst ~rc,$(DOT)rc,$(DEB_VERS))) +RELEASE := $(shell rpm $(COMMON_RPM_ARGS) --specfile --qf '%{release}\n' $(SPEC) | sed -n '$(SED_EXPR)') +SRPM := _topdir/SRPMS/$(NAME)-$(VERSION)-$(RELEASE)$(DIST).src.rpm +RPMS := $(addsuffix .rpm,$(addprefix _topdir/RPMS/x86_64/,$(shell rpm --specfile $(SPEC)))) +DEB_TOP := _topdir/BUILD +DEB_BUILD := $(DEB_TOP)/$(NAME)-$(DEB_VERS) +DEB_TARBASE := $(DEB_TOP)/$(DEB_NAME)_$(DEB_VERS) +SOURCES := $(addprefix _topdir/SOURCES/,$(notdir $(SOURCE)) $(PATCHES)) +ifeq ($(ID_LIKE),debian) +DEBS := $(addsuffix _$(DEB_VERS)-1_amd64.deb,$(shell sed -n '/-udeb/b; s,^Package:[[:blank:]],$(DEB_TOP)/,p' debian/control)) +DEB_PREV_RELEASE := $(shell dpkg-parsechangelog -S version) +DEB_DSC := $(DEB_NAME)_$(DEB_PREV_RELEASE)$(GIT_INFO).dsc +#Ubuntu Containers do not set a UTF-8 environment by default. +ifndef LANG +export LANG = C.UTF-8 +endif +ifndef LC_ALL +export LC_ALL = C.UTF-8 +endif +TARGETS := $(DEBS) +else +# CentOS/Suse packages that want a locale set need this. +ifndef LANG +export LANG = en_US.utf8 +endif +ifndef LC_ALL +export LC_ALL = en_US.utf8 +endif +TARGETS := $(RPMS) $(SRPM) +endif + +define install_repos + for repo in $($(DISTRO_BASE)_PR_REPOS) \ + $(PR_REPOS) $(1); do \ + branch="master"; \ + build_number="lastSuccessfulBuild"; \ + if [[ $$repo = *@* ]]; then \ + branch="$${repo#*@}"; \ + repo="$${repo%@*}"; \ + if [[ $$branch = *:* ]]; then \ + build_number="$${branch#*:}"; \ + branch="$${branch%:*}"; \ + fi; \ + fi; \ + case $(DISTRO_ID) in \ + el7) distro="centos7"; \ + ;; \ + sle12.3) distro="sles12.3"; \ + ;; \ + sl42.3) distro="leap42.3"; \ + ;; \ + sl15.1) distro="leap15.1"; \ + ;; \ + esac; \ + baseurl=$${JENKINS_URL:-https://build.hpdd.intel.com/}job/daos-stack/job/$$repo/job/$$branch/; \ + baseurl+=$$build_number/artifact/artifacts/$$distro/; \ + $(call install_repo,$$baseurl); \ + done +endef + +all: $(TARGETS) + +%/: + mkdir -p $@ + +%.gz: % + rm -f $@ + gzip $< + +%.bz2: % + rm -f $@ + bzip2 $< + +%.xz: % + rm -f $@ + xz -z $< + +_topdir/SOURCES/%: % | _topdir/SOURCES/ + rm -f $@ + ln $< $@ + +# At least one spec file, SLURM (sles), has a different version for the +# download file than the version in the spec file. +ifeq ($(DL_VERSION),) +DL_VERSION = $(VERSION) +endif + +$(NAME)-$(DL_VERSION).tar.$(SRC_EXT).asc: $(SPEC) $(CALLING_MAKEFILE) + rm -f ./$(NAME)-*.tar.{gz,bz*,xz}.asc + curl -f -L -O '$(SOURCE).asc' + +$(NAME)-$(DL_VERSION).tar.$(SRC_EXT): $(SPEC) $(CALLING_MAKEFILE) + rm -f ./$(NAME)-*.tar.{gz,bz*,xz} + curl -f -L -O '$(SOURCE)' + +v$(DL_VERSION).tar.$(SRC_EXT): $(SPEC) $(CALLING_MAKEFILE) + rm -f ./v*.tar.{gz,bz*,xz} + curl -f -L -O '$(SOURCE)' + +$(DL_VERSION).tar.$(SRC_EXT): $(SPEC) $(CALLING_MAKEFILE) + rm -f ./*.tar.{gz,bz*,xz} + curl -f -L -O '$(SOURCE)' + +$(DEB_TOP)/%: % | $(DEB_TOP)/ + +$(DEB_BUILD)/%: % | $(DEB_BUILD)/ + +$(DEB_BUILD).tar.$(SRC_EXT): $(notdir $(SOURCE)) | $(DEB_TOP)/ + ln -f $< $@ + +$(DEB_TARBASE).orig.tar.$(SRC_EXT) : $(DEB_BUILD).tar.$(SRC_EXT) + rm -f $(DEB_TOP)/*.orig.tar.* + ln -f $< $@ + +deb_detar: $(notdir $(SOURCE)) $(DEB_TARBASE).orig.tar.$(SRC_EXT) + # Unpack tarball + rm -rf ./$(DEB_TOP)/.patched ./$(DEB_TOP)/.detar + rm -rf ./$(DEB_BUILD)/* ./$(DEB_BUILD)/.pc ./$(DEB_BUILD)/.libs + mkdir -p $(DEB_BUILD) + tar -C $(DEB_BUILD) --strip-components=1 -xpf $< + +# Extract patches for Debian +$(DEB_TOP)/.patched: $(PATCHES) check-env deb_detar | \ + $(DEB_BUILD)/debian/ + mkdir -p ${DEB_BUILD}/debian/patches + mkdir -p $(DEB_TOP)/patches + for f in $(PATCHES); do \ + rm -f $(DEB_TOP)/patches/*; \ + if git mailsplit -o$(DEB_TOP)/patches < "$$f" ;then \ + fn=$$(basename "$$f"); \ + for f1 in $(DEB_TOP)/patches/*;do \ + [ -e "$$f1" ] || continue; \ + f1n=$$(basename "$$f1"); \ + echo "$${fn}_$${f1n}" >> $(DEB_BUILD)/debian/patches/series ; \ + mv "$$f1" $(DEB_BUILD)/debian/patches/$${fn}_$${f1n}; \ + done; \ + else \ + fb=$$(basename "$$f"); \ + cp "$$f" $(DEB_BUILD)/debian/patches/ ; \ + echo "$$fb" >> $(DEB_BUILD)/debian/patches/series ; \ + if ! grep -q "^Description:\|^Subject:" "$$f" ;then \ + sed -i '1 iSubject: Auto added patch' \ + "$(DEB_BUILD)/debian/patches/$$fb" ;fi ; \ + if ! grep -q "^Origin:\|^Author:\|^From:" "$$f" ;then \ + sed -i '1 iOrigin: other' \ + "$(DEB_BUILD)/debian/patches/$$fb" ;fi ; \ + fi ; \ + done + touch $@ + + +# Move the debian files into the Debian directory. +ifeq ($(ID_LIKE),debian) +$(DEB_TOP)/.deb_files : $(shell find debian -type f) deb_detar | \ + $(DEB_BUILD)/debian/ + find debian -maxdepth 1 -type f -exec cp '{}' '$(DEB_BUILD)/{}' ';' + if [ -e debian/source ]; then \ + cp -r debian/source $(DEB_BUILD)/debian; fi + if [ -e debian/local ]; then \ + cp -r debian/local $(DEB_BUILD)/debian; fi + if [ -e debian/examples ]; then \ + cp -r debian/examples $(DEB_BUILD)/debian; fi + if [ -e debian/upstream ]; then \ + cp -r debian/upstream $(DEB_BUILD)/debian; fi + if [ -e debian/tests ]; then \ + cp -r debian/tests $(DEB_BUILD)/debian; fi + rm -f $(DEB_BUILD)/debian/*.ex $(DEB_BUILD)/debian/*.EX + rm -f $(DEB_BUILD)/debian/*.orig +ifneq ($(GIT_INFO),) + cd $(DEB_BUILD); dch --distribution unstable \ + --newversion $(DEB_PREV_RELEASE)$(GIT_INFO) \ + "Git commit information" +endif + touch $@ +endif + +# see https://stackoverflow.com/questions/2973445/ for why we subst +# the "rpm" for "%" to effectively turn this into a multiple matching +# target pattern rule +$(subst rpm,%,$(RPMS)): $(SPEC) $(SOURCES) + rpmbuild -bb $(COMMON_RPM_ARGS) $(RPM_BUILD_OPTIONS) $(SPEC) + +$(subst deb,%,$(DEBS)): $(DEB_BUILD).tar.$(SRC_EXT) \ + deb_detar $(DEB_TOP)/.deb_files $(DEB_TOP)/.patched + rm -f $(DEB_TOP)/*.deb $(DEB_TOP)/*.ddeb $(DEB_TOP)/*.dsc \ + $(DEB_TOP)/*.dsc $(DEB_TOP)/*.build* $(DEB_TOP)/*.changes \ + $(DEB_TOP)/*.debian.tar.* + rm -rf $(DEB_TOP)/*-tmp + cd $(DEB_BUILD); debuild --no-lintian -b -us -uc + cd $(DEB_BUILD); debuild -- clean + git status + rm -rf $(DEB_TOP)/$(NAME)-tmp + lfile1=$(shell echo $(DEB_TOP)/$(NAME)[0-9]*_$(DEB_VERS)-1_amd64.deb);\ + lfile=$$(ls $${lfile1}); \ + lfile2=$${lfile##*/}; lname=$${lfile2%%_*}; \ + dpkg-deb -R $${lfile} \ + $(DEB_TOP)/$(NAME)-tmp; \ + if [ -e $(DEB_TOP)/$(NAME)-tmp/DEBIAN/symbols ]; then \ + sed 's/$(DEB_RVERS)-1/$(DEB_BVERS)/' \ + $(DEB_TOP)/$(NAME)-tmp/DEBIAN/symbols \ + > $(DEB_BUILD)/debian/$${lname}.symbols; fi + cd $(DEB_BUILD); debuild -us -uc + rm $(DEB_BUILD).tar.$(SRC_EXT) + for f in $(DEB_TOP)/*.deb; do \ + echo $$f; dpkg -c $$f; done + +$(DEB_TOP)/$(DEB_DSC): $(CALLING_MAKEFILE) $(DEB_BUILD).tar.$(SRC_EXT) \ + deb_detar $(DEB_TOP)/.deb_files $(DEB_TOP)/.patched + rm -f $(DEB_TOP)/*.deb $(DEB_TOP)/*.ddeb $(DEB_TOP)/*.dsc \ + $(DEB_TOP)/*.dsc $(DEB_TOP)/*.build* $(DEB_TOP)/*.changes \ + $(DEB_TOP)/*.debian.tar.* + rm -rf $(DEB_TOP)/*-tmp + cd $(DEB_BUILD); dpkg-buildpackage -S --no-sign --no-check-builddeps + +$(SRPM): $(SPEC) $(SOURCES) + rpmbuild -bs $(COMMON_RPM_ARGS) $(RPM_BUILD_OPTIONS) $(SPEC) + +srpm: $(SRPM) + +$(RPMS): $(SRPM) $(CALLING_MAKEFILE) + +rpms: $(RPMS) + +$(DEBS): $(CALLING_MAKEFILE) + +debs: $(DEBS) + +ls: $(TARGETS) + ls -ld $^ + +# *_LOCAL_* repos are locally built packages. +# *_GROUP_* repos are a local mirror of a group of upstream repos. +# *_GROUP_* repos may not supply a repomd.xml.key. +ifneq ($(REPOSITORY_URL),) +ifneq ($(DAOS_STACK_$(DISTRO_BASE)_LOCAL_REPO),) +$(DISTRO_BASE)_LOCAL_REPOS := $(REPOSITORY_URL)$(DAOS_STACK_$(DISTRO_BASE)_LOCAL_REPO)/ +endif +ifneq ($(DAOS_STACK_$(DISTRO_BASE)_GROUP_REPO),) +$(DISTRO_BASE)_LOCAL_REPOS += $(REPOSITORY_URL)$(DAOS_STACK_$(DISTRO_BASE)_GROUP_REPO)/ +endif +endif + +ifeq ($(ID_LIKE),debian) +ifneq ($(DAOS_STACK_REPO_SUPPORT),) +TEST_STR := $(DAOS_STACK_REPO_UBUNTU_$(VERSION_ID_STR)_LIST) +ifneq ($(TEST_STR),) +UBUNTU_REPOS := $(shell curl $(DAOS_STACK_REPO_SUPPORT)$(TEST_STR)) +# Additional repos can be added but must be separated by a | character. +UBUNTU_ADD_REPOS = --othermirror "$(UBUNTU_REPOS)" +else +ifneq ($(DAOS_STACK_REPO_UBUNTU_ROLLING_LIST),) +UBUNTU_REPOS := $(shell curl $(DAOS_STACK_REPO_SUPPORT)$(DAOS_STACK_REPO_UBUNTU_ROLLING_LIST)) +# Additional repos can be added but must be separated by a | character. +UBUNTU_ADD_REPOS = --othermirror "$(UBUNTU_REPOS)" +endif +endif +# Need to figure out how to support multiple keys, such as for IPMCTL +ifneq ($(DAOS_STACK_REPO_PUB_KEY),) +HAVE_DAOS_STACK_KEY := TRUE + +$(DAOS_STACK_REPO_PUB_KEY): + curl -f -L -O '$(DAOS_STACK_REPO_SUPPORT)$(DAOS_STACK_REPO_PUB_KEY)' +endif +endif + +chrootbuild: $(DEB_TOP)/$(DEB_DSC) $(DAOS_STACK_REPO_PUB_KEY) + sudo pbuilder create \ + --extrapackages "gnupg ca-certificates" $(DISTRO_ID_OPT) +ifneq ($(HAVE_DAOS_STACK_KEY),) + printf "apt-key add - <> /etc/mock/$(CHROOT_NAME).cfg; \ + for repo in $($(DISTRO_BASE)_PR_REPOS) $(PR_REPOS); do \ + branch="master"; \ + build_number="lastSuccessfulBuild"; \ + if [[ $$repo = *@* ]]; then \ + branch="$${repo#*@}"; \ + repo="$${repo%@*}"; \ + if [[ $$branch = *:* ]]; then \ + build_number="$${branch#*:}"; \ + branch="$${branch%:*}"; \ + fi; \ + fi; \ + echo -e "[$$repo:$$branch:$$build_number]\n\ +name=$$repo:$$branch:$$build_number\n\ +baseurl=$${JENKINS_URL:-https://build.hpdd.intel.com/}job/daos-stack/job/$$repo/job/$$branch/$$build_number/artifact/artifacts/centos7/\n\ +enabled=1\n\ +gpgcheck=False\n" >> /etc/mock/$(CHROOT_NAME).cfg; \ + done; \ + for repo in $($(DISTRO_BASE)_LOCAL_REPOS) $($(DISTRO_BASE)_REPOS); do \ + repo_name=$${repo##*://}; \ + repo_name=$${repo_name//\//_}; \ + echo -e "[$$repo_name]\n\ +name=$${repo_name}\n\ +baseurl=$${repo}\n\ +enabled=1\n" >> /etc/mock/$(CHROOT_NAME).cfg; \ + done; \ + echo "\"\"\"" >> /etc/mock/$(CHROOT_NAME).cfg; \ + else \ + echo "Unable to update /etc/mock/$(CHROOT_NAME).cfg."; \ + echo "You need to make sure it has the needed repos in it yourself."; \ + fi + mock -r $(CHROOT_NAME) $(MOCK_OPTIONS) $(RPM_BUILD_OPTIONS) $< +endif + +docker_chrootbuild: + docker build --build-arg UID=$$(id -u) -t $(BUILD_OS)-chrootbuild \ + -f packaging/Dockerfile.$(BUILD_OS) . + docker run --privileged=true -w $$PWD/../.. -v=$$PWD/../..:$$PWD/../.. \ + -it $(BUILD_OS)-chrootbuild bash -c "make -C utils/rpms chrootbuild" + +rpmlint: $(SPEC) + rpmlint $< + +packaging_check: + if grep -e --repo $(CALLING_MAKEFILE); then \ + echo "SUSE repos in $(CALLING_MAKEFILE) don't need a \"--repo\" any more"; \ + exit 2; \ + fi + if ! diff --exclude \*.sw? \ + --exclude debian \ + --exclude .git \ + --exclude Jenkinsfile \ + --exclude libfabric.spec \ + --exclude Makefile \ + --exclude README.md \ + --exclude _topdir \ + --exclude \*.tar.\* \ + --exclude \*.code-workspace \ + --exclude install \ + -bur $(PACKAGING_CHECK_DIR)/ packaging/; then \ + exit 1; \ + fi + +check-env: +ifndef DEBEMAIL + $(error DEBEMAIL is undefined) +endif +ifndef DEBFULLNAME + $(error DEBFULLNAME is undefined) +endif + +test: + @echo "No test defined for this module" + +show_version: + @echo $(VERSION) + +show_release: + @echo $(RELEASE) + +show_rpms: + @echo $(RPMS) + +show_source: + @echo $(SOURCE) + +show_sources: + @echo $(SOURCES) + +show_targets: + @echo $(TARGETS) + +show_makefiles: + @echo $(MAKEFILE_LIST) + +show_calling_makefile: + @echo $(CALLING_MAKEFILE) + +show_git_metadata: + @echo $(GIT_SHA1):$(GIT_SHORT):$(GIT_NUM_COMMITS) + +.PHONY: srpm rpms debs deb_detar ls chrootbuild rpmlint FORCE \ + show_version show_release show_rpms show_source show_sources \ + show_targets check-env show_git_metadata \ No newline at end of file