diff --git a/build_scripts/build-fsal/bootstrap.sh b/build_scripts/build-fsal/bootstrap.sh new file mode 100644 index 00000000..8a66d43e --- /dev/null +++ b/build_scripts/build-fsal/bootstrap.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +echo "Hello from bootstrap.sh" + +TEST_SCRIPT=${TEST_SCRIPT} + +SERVER_IP=$(cat $WORKSPACE/hosts | sed -n '1p') + +server_env="export CENTOS_VERSION='${CENTOS_VERSION}'" +server_env+=" CENTOS_ARCH='${CENTOS_ARCH}'" +server_env+=" GERRIT_HOST='${GERRIT_HOST}'" +server_env+=" GERRIT_PROJECT='${GERRIT_PROJECT}'" +server_env+=" GERRIT_REFSPEC='${GERRIT_REFSPEC}'" + +echo $server_env > $WORKSPACE/SERVER_ENV.txt + +scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$WORKSPACE/SERVER_ENV.txt" "root@${SERVER_IP}:./SERVER_ENV.txt" + +ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${SERVER_IP} "tee -a ~/.bashrc < ./SERVER_ENV.txt" + +scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$TEST_SCRIPT" root@${SERVER_IP}:./build.sh + +ssh -tt -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${SERVER_IP} 'bash build.sh' diff --git a/build_scripts/build-fsal/build-fsal_cephfs.sh b/build_scripts/build-fsal/build-fsal_cephfs.sh index 05514974..66dd47be 100644 --- a/build_scripts/build-fsal/build-fsal_cephfs.sh +++ b/build_scripts/build-fsal/build-fsal_cephfs.sh @@ -13,29 +13,20 @@ GIT_REPO="https://${GERRIT_HOST}/${GERRIT_PROJECT}" # enable the Storage SIG Gluster and Ceph repositories yum -y install centos-release-ceph +BUILDREQUIRES="git bison cmake dbus-devel flex gcc-c++ krb5-devel libacl-devel libblkid-devel libcap-devel redhat-rpm-config rpm-build xfsprogs-devel python2-devel" + +BUILDREQUIRES_EXTRA="libnsl2-devel libnfsidmap-devel libwbclient-devel libcephfs-devel userspace-rcu-devel" + # basic packages to install -xargs yum -y install <<< " -git -bison -cmake -dbus-devel -flex -gcc-c++ -git -krb5-devel -libacl-devel -libblkid-devel -libcap-devel -libnfsidmap-devel -libwbclient-devel -redhat-rpm-config -rpm-build -libcephfs-devel -librgw-devel -xfsprogs-devel -python2-devel -userspace-rcu-devel -" +case "${CENTOS_VERSION}" in + 7) + yum install -y ${BUILDREQUIRES} ${BUILDREQUIRES_EXTRA} + ;; + 8s) + yum install -y ${BUILDREQUIRES} + yum install --enablerepo=powertools -y ${BUILDREQUIRES_EXTRA} + ;; +esac git clone --depth=1 ${GIT_REPO} cd $(basename "${GERRIT_PROJECT}") diff --git a/build_scripts/build-fsal/build-fsal_gluster.sh b/build_scripts/build-fsal/build-fsal_gluster.sh index b9a5dd82..16b10be6 100644 --- a/build_scripts/build-fsal/build-fsal_gluster.sh +++ b/build_scripts/build-fsal/build-fsal_gluster.sh @@ -13,28 +13,20 @@ GIT_REPO="https://${GERRIT_HOST}/${GERRIT_PROJECT}" # enable the Storage SIG Gluster and Ceph repositories yum -y install centos-release-gluster +BUILDREQUIRES="git bison cmake dbus-devel flex gcc-c++ krb5-devel libacl-devel libblkid-devel libcap-devel redhat-rpm-config rpm-build libgfapi-devel xfsprogs-devel python2-devel" + +BUILDREQUIRES_EXTRA="libnsl2-devel libnfsidmap-devel libwbclient-devel libcephfs-devel userspace-rcu-devel" + # basic packages to install -xargs yum -y install <<< " -git -bison -cmake -dbus-devel -flex -gcc-c++ -git -krb5-devel -libacl-devel -libblkid-devel -libcap-devel -libnfsidmap-devel -libwbclient-devel -redhat-rpm-config -rpm-build -libgfapi-devel -xfsprogs-devel -python2-devel -userspace-rcu-devel -" +case "${CENTOS_VERSION}" in + 7) + yum install -y ${BUILDREQUIRES} ${BUILDREQUIRES_EXTRA} + ;; + 8s) + yum install -y ${BUILDREQUIRES} + yum install --enablerepo=powertools -y ${BUILDREQUIRES_EXTRA} + ;; +esac git clone --depth=1 ${GIT_REPO} cd $(basename "${GERRIT_PROJECT}") diff --git a/build_scripts/build-fsal/build-fsal_rgw.sh b/build_scripts/build-fsal/build-fsal_rgw.sh index d48d67cd..48bd8aa5 100644 --- a/build_scripts/build-fsal/build-fsal_rgw.sh +++ b/build_scripts/build-fsal/build-fsal_rgw.sh @@ -13,29 +13,26 @@ GIT_REPO="https://${GERRIT_HOST}/${GERRIT_PROJECT}" # enable the Storage SIG Gluster and Ceph repositories yum -y install centos-release-ceph +BUILDREQUIRES="git bison cmake dbus-devel flex gcc-c++ krb5-devel libacl-devel libblkid-devel libcap-devel redhat-rpm-config rpm-build xfsprogs-devel python2-devel" + +BUILDREQUIRES_EXTRA="libnsl2-devel libnfsidmap-devel libwbclient-devel libcephfs-devel userspace-rcu-devel librgw-devel" + # basic packages to install -xargs yum -y install <<< " -git -bison -cmake -dbus-devel -flex -gcc-c++ -git -krb5-devel -libacl-devel -libblkid-devel -libcap-devel -libnfsidmap-devel -libwbclient-devel -redhat-rpm-config -rpm-build -libcephfs-devel -librgw-devel -xfsprogs-devel -python2-devel -userspace-rcu-devel -" +case "${CENTOS_VERSION}" in + 7) + yum install -y ${BUILDREQUIRES} ${BUILDREQUIRES_EXTRA} + ;; + 8s) + yum install -y ${BUILDREQUIRES} + yum install --enablerepo=powertools -y ${BUILDREQUIRES_EXTRA} + ;; + *) + ENABLE_REPOS="--enablerepo=powertools" + BUILDREQUIRES="${BUILDREQUIRES} python3-devel rpcgen libtirpc-devel liburing-devel rsync " + yum -y update --skip-broken --nobest + yum -y install epel-release + ;; +esac git clone --depth=1 ${GIT_REPO} cd $(basename "${GERRIT_PROJECT}") diff --git a/jobs/scripts/code_compilation/basic-gluster-duffy.sh b/build_scripts/code-compilation/basic-gluster-duffy.sh similarity index 100% rename from jobs/scripts/code_compilation/basic-gluster-duffy.sh rename to build_scripts/code-compilation/basic-gluster-duffy.sh diff --git a/jobs/code_compilation.yml b/jobs/code_compilation.yml index 3ab4f2d3..ac789832 100644 --- a/jobs/code_compilation.yml +++ b/jobs/code_compilation.yml @@ -1,5 +1,5 @@ - job: - name: nfs_ganesha_code_compilation + name: code-compilation node: cico-workspace description: 'Run code compilation for nfs-ganesha against the latest build of Ganesha with FSAL_GLUSTER.' project-type: freestyle diff --git a/jobs/nfs-ganesha_trigger-fsal_template.yml b/jobs/fsal_template.yml similarity index 80% rename from jobs/nfs-ganesha_trigger-fsal_template.yml rename to jobs/fsal_template.yml index 99aa3d2b..88778991 100644 --- a/jobs/nfs-ganesha_trigger-fsal_template.yml +++ b/jobs/fsal_template.yml @@ -1,15 +1,15 @@ - project: - name: 'nfs-ganesha_trigger-fsal' + name: 'fsal' product: - cephfs - gluster - rgw jobs: - - '{name}_{product}' + - '{name}-{product}' - job-template: - name: '{name}_{product}' + name: '{name}-{product}' node: cico-workspace project-type: freestyle concurrent: false @@ -31,6 +31,11 @@ - centos_variables builders: + + - shell: !include-raw-escape: scripts/fsal-build.sh + + builders: + - shell: !include-raw-escape: scripts/common/get-node.sh - shell: !include-raw-escape: scripts/fsal-build.sh triggers: diff --git a/jobs/scripts/common.sh b/jobs/scripts/common.sh index 5284602d..faed1491 100644 --- a/jobs/scripts/common.sh +++ b/jobs/scripts/common.sh @@ -9,8 +9,8 @@ export BUILD_NUMBER=${BUILD_NUMBER} if [ "$JOB_NAME" == "nfs_ganesha_dbench" ]; then bash $WORKSPACE/ci-tests/jobs/scripts/dbench/basic-gluster-duffy.sh RET=$? -elif [ "$JOB_NAME" == "nfs_ganesha_code_compilation" ]; then - bash $WORKSPACE/ci-tests/jobs/scripts/code_compilation/basic-gluster-duffy.sh +elif [ "$JOB_NAME" == "code-compilation" ]; then + bash $WORKSPACE/ci-tests/build_scripts/code-compilation/basic-gluster-duffy.sh RET=$? fi diff --git a/jobs/scripts/common/get-node.sh b/jobs/scripts/common/get-node.sh index f1131cd3..cfa5b5f9 100644 --- a/jobs/scripts/common/get-node.sh +++ b/jobs/scripts/common/get-node.sh @@ -22,7 +22,7 @@ do fi done -if [ "$JOB_NAME" == "nfs-ganesha_trigger-fsal_cephfs" ] || [ "$JOB_NAME" == "nfs-ganesha_trigger-fsal_gluster" ] || [ "$JOB_NAME" == "nfs-ganesha_trigger-fsal_rgw" ]; then +if [[ $JOB_NAME =~ fsal-* ]]; then node_count=1 else node_count=2 diff --git a/jobs/scripts/fsal-build.sh b/jobs/scripts/fsal-build.sh index 0fd746df..de5a3480 100644 --- a/jobs/scripts/fsal-build.sh +++ b/jobs/scripts/fsal-build.sh @@ -5,7 +5,7 @@ set +x set +e # run the bootstrap script -python $WORKSPACE/ci-tests/build_scripts/common/bootstrap.py +bash $WORKSPACE/ci-tests/build_scripts/build-fsal/bootstrap.sh RET=$? # we accept different return values