From f9be961d1301808519b9b31064ee176adb940f5f Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Mon, 2 Jul 2018 12:34:07 +0300 Subject: [PATCH 1/6] set proper access rights for binary repo directory --- BUILD/mdbci/copy_repos.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BUILD/mdbci/copy_repos.sh b/BUILD/mdbci/copy_repos.sh index ef5eca33b..ab48ad49d 100755 --- a/BUILD/mdbci/copy_repos.sh +++ b/BUILD/mdbci/copy_repos.sh @@ -9,7 +9,8 @@ if [ "$box_type" == "RPM" ] ; then rm -rf $path_prefix/$platform/$platform_version/$arch/ mkdir -p $path_prefix/$platform/$platform_version/$arch/ - cp -r ${unsorted_repo_dir}/$repo_name/$box/* $path_prefix/$platform/$platform_version/$arch/ + chmod 775 $path_prefix/$platform/$platform_version/$arch + rsync -avz --progress --delete ${unsorted_repo_dir}/$repo_name/$box/* $path_prefix/$platform/$platform_version/$arch/ env > $build_info_path cd $path_prefix/$platform ln -s $platform_version "$platform_version"server @@ -27,7 +28,8 @@ else rm -rf $path_prefix/$platform_family/dists/$platform_version/main/binary-"$arch" rm -rf $path_prefix/$platform_family/dists/$platform_version/main/binary-i386 mkdir -p $path_prefix/$platform_family/ - cp -r ${unsorted_repo_dir}/$repo_name/$box/* $path_prefix/$platform_family/ + chmod 775 $path_prefix/$platform_family + rsync -avz --progress --delete ${unsorted_repo_dir}/$repo_name/$box/* $path_prefix/$platform_family/ env > $build_info_path eval "cat < Date: Wed, 16 May 2018 10:03:10 +0300 Subject: [PATCH 2/6] Update 2.1 version number. --- VERSION21.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION21.cmake b/VERSION21.cmake index 0df03b735..581050975 100644 --- a/VERSION21.cmake +++ b/VERSION21.cmake @@ -5,7 +5,7 @@ set(MAXSCALE_VERSION_MAJOR "2" CACHE STRING "Major version") set(MAXSCALE_VERSION_MINOR "1" CACHE STRING "Minor version") -set(MAXSCALE_VERSION_PATCH "17" CACHE STRING "Patch version") +set(MAXSCALE_VERSION_PATCH "18" CACHE STRING "Patch version") # This should only be incremented if a package is rebuilt set(MAXSCALE_BUILD_NUMBER 1 CACHE STRING "Release number") From b2f52590a33e96bf60ea7d72a56bb3eb1d3e957e Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Wed, 4 Jul 2018 09:10:55 +0300 Subject: [PATCH 3/6] fix typo in chmod for all binary repository dirs and files --- BUILD/mdbci/copy_repos.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/BUILD/mdbci/copy_repos.sh b/BUILD/mdbci/copy_repos.sh index ab48ad49d..cef601b46 100755 --- a/BUILD/mdbci/copy_repos.sh +++ b/BUILD/mdbci/copy_repos.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyies repo from ${unsorted_repo_dir}/$target/$box to +# Copies repo from ${unsorted_repo_dir}/$target/$box to proper place in the public repo dir dir=`pwd` if [ "$box_type" == "RPM" ] ; then @@ -9,9 +9,10 @@ if [ "$box_type" == "RPM" ] ; then rm -rf $path_prefix/$platform/$platform_version/$arch/ mkdir -p $path_prefix/$platform/$platform_version/$arch/ - chmod 775 $path_prefix/$platform/$platform_version/$arch rsync -avz --progress --delete ${unsorted_repo_dir}/$repo_name/$box/* $path_prefix/$platform/$platform_version/$arch/ env > $build_info_path + find $path_prefix/.. -type d -exec chmod 755 {} \; + find $path_prefix/.. -type f -exec chmod 644 {} \; cd $path_prefix/$platform ln -s $platform_version "$platform_version"server ln -s $platform_version "$platform_version"Server @@ -28,9 +29,10 @@ else rm -rf $path_prefix/$platform_family/dists/$platform_version/main/binary-"$arch" rm -rf $path_prefix/$platform_family/dists/$platform_version/main/binary-i386 mkdir -p $path_prefix/$platform_family/ - chmod 775 $path_prefix/$platform_family rsync -avz --progress --delete ${unsorted_repo_dir}/$repo_name/$box/* $path_prefix/$platform_family/ env > $build_info_path + find $path_prefix/.. -type d -exec chmod 755 {} \; + find $path_prefix/.. -type f -exec chmod 644 {} \; eval "cat < /dev/null > ${path_prefix}/${platform}_${platform_version}.json From 1ebdadcc2b051ac3feff98333fce4602069e0e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 4 Jul 2018 15:17:21 +0300 Subject: [PATCH 4/6] Do rsync without --delete rsync with the --delete flag will destroy artifacts generated by other jobs. This broke the build_all job. --- BUILD/mdbci/copy_repos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD/mdbci/copy_repos.sh b/BUILD/mdbci/copy_repos.sh index cef601b46..4d84c5e3c 100755 --- a/BUILD/mdbci/copy_repos.sh +++ b/BUILD/mdbci/copy_repos.sh @@ -9,7 +9,7 @@ if [ "$box_type" == "RPM" ] ; then rm -rf $path_prefix/$platform/$platform_version/$arch/ mkdir -p $path_prefix/$platform/$platform_version/$arch/ - rsync -avz --progress --delete ${unsorted_repo_dir}/$repo_name/$box/* $path_prefix/$platform/$platform_version/$arch/ + rsync -avz --progress ${unsorted_repo_dir}/$repo_name/$box/* $path_prefix/$platform/$platform_version/$arch/ env > $build_info_path find $path_prefix/.. -type d -exec chmod 755 {} \; find $path_prefix/.. -type f -exec chmod 644 {} \; @@ -29,7 +29,7 @@ else rm -rf $path_prefix/$platform_family/dists/$platform_version/main/binary-"$arch" rm -rf $path_prefix/$platform_family/dists/$platform_version/main/binary-i386 mkdir -p $path_prefix/$platform_family/ - rsync -avz --progress --delete ${unsorted_repo_dir}/$repo_name/$box/* $path_prefix/$platform_family/ + rsync -avz --progress ${unsorted_repo_dir}/$repo_name/$box/* $path_prefix/$platform_family/ env > $build_info_path find $path_prefix/.. -type d -exec chmod 755 {} \; find $path_prefix/.. -type f -exec chmod 644 {} \; From 646c22e3841c6531071df3bd5bea0b1336f57347 Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Wed, 8 Aug 2018 11:39:03 +0300 Subject: [PATCH 5/6] remove repo.d generation from build and test scripts --- BUILD/mdbci/copy_repos.sh | 2 ++ BUILD/mdbci/templates/install.json.template | 4 ++- BUILD/mdbci/upgrade_test.sh | 31 +++++++++---------- maxscale-system-test/mdbci/create_config.sh | 20 ++++++------ .../mdbci/run_test_snapshot.sh | 16 ++++------ .../mdbci/templates/big.json.template | 3 +- .../mdbci/templates/big15.json.template | 3 +- .../mdbci/templates/default.json.template | 3 +- .../mdbci/templates/nogalera.json.template | 3 +- .../mdbci/templates/performance.json.template | 3 +- 10 files changed, 46 insertions(+), 42 deletions(-) diff --git a/BUILD/mdbci/copy_repos.sh b/BUILD/mdbci/copy_repos.sh index 4d84c5e3c..26fb51ab6 100755 --- a/BUILD/mdbci/copy_repos.sh +++ b/BUILD/mdbci/copy_repos.sh @@ -38,3 +38,5 @@ $(<${script_dir}/templates/repository-config/deb.json.template) " 2> /dev/null > ${path_prefix}/${platform}_${platform_version}.json fi cd $dir + +${mdbci_dir}/mdbci generate-product-repositories --product maxscale_ci --product-version $target diff --git a/BUILD/mdbci/templates/install.json.template b/BUILD/mdbci/templates/install.json.template index 81db5a9de..aa9715d71 100644 --- a/BUILD/mdbci/templates/install.json.template +++ b/BUILD/mdbci/templates/install.json.template @@ -3,8 +3,10 @@ { "hostname" : "maxscale", "box" : "$box", + "memory_size" : "4096", "product" : { - "name": "maxscale" + "name" : "maxscale", + "version" : "${old_target}" } } diff --git a/BUILD/mdbci/upgrade_test.sh b/BUILD/mdbci/upgrade_test.sh index c30069dcb..fbac44d70 100755 --- a/BUILD/mdbci/upgrade_test.sh +++ b/BUILD/mdbci/upgrade_test.sh @@ -33,11 +33,8 @@ if [ -d "install_$box" ]; then ${mdbci_dir}/mdbci destroy $name fi -${mdbci_dir}/repository-config/generate_all.sh repo.d -${mdbci_dir}/repository-config/maxscale-release.sh $old_target repo.d - # starting VM for build -${mdbci_dir}/mdbci --override --template $MDBCI_VM_PATH/$name.json --repo-dir $dir/repo.d generate $name +${mdbci_dir}/mdbci --override --template $MDBCI_VM_PATH/$name.json generate $name ${mdbci_dir}/mdbci up $name --attempts=1 if [ $? != 0 ] ; then if [ $? != 0 ] ; then @@ -61,12 +58,8 @@ export sshopt="$scpopt $sshuser@$IP" old_version=`ssh $sshopt "maxscale --version" ` -rm -rf repo.d -${mdbci_dir}/repository-config/generate_all.sh repo.d -${mdbci_dir}/repository-config/maxscale-ci.sh $target repo.d - -${mdbci_dir}/mdbci setup_repo --product maxscale --repo-dir $dir/repo.d $name/maxscale -${mdbci_dir}/mdbci install_product --product maxscale $name/maxscale +${mdbci_dir}/mdbci setup_repo --product maxscale_ci --product-version ${target} $name/maxscale +${mdbci_dir}/mdbci install_product --product maxscale_ci $name/maxscale res=$? @@ -84,7 +77,7 @@ scp $scpopt ${script_dir}/cnf/$cnf_file $sshuser@$IP:~/ . ${script_dir}/configure_log_dir.sh -${mdbci_dir}/mdbci ssh --command 'service --help' $name/maxscale +${mdbci_dir}/mdbci ssh --command 'sudo service --help' $name/maxscale if [ $? == 0 ] ; then maxscale_start_cmd="sudo service maxscale start" else @@ -92,19 +85,25 @@ else maxscale_start_cmd="sudo ./maxscale_start.sh 2> /dev/null &" fi - - ssh $sshopt "sudo cp $cnf_file /etc/maxscale.cnf" ssh $sshopt "$maxscale_start_cmd" & pid_to_kill=$! -sleep 10 +for i in {1..10} +do + sleep 5 + ssh $sshopt $maxadmin_command + maxadm_exit=$? + if [ $maxadm_exit == 0 ] ; then + break + fi +done -ssh $sshopt $maxadmin_command -if [ $? != 0 ] ; then +if [ $maxadm_exit != 0 ] ; then echo "Maxadmin executing error" res=1 fi + maxadmin_out=`ssh $sshopt $maxadmin_command` echo $maxadmin_out | grep "CLI" if [ $? != 0 ] ; then diff --git a/maxscale-system-test/mdbci/create_config.sh b/maxscale-system-test/mdbci/create_config.sh index 12f899323..1e2795486 100755 --- a/maxscale-system-test/mdbci/create_config.sh +++ b/maxscale-system-test/mdbci/create_config.sh @@ -7,12 +7,6 @@ export script_dir="$(dirname $(readlink -f $0))" . ${script_dir}/set_run_test_variables.sh -${mdbci_dir}/repository-config/generate_all.sh repo.d -${mdbci_dir}/repository-config/maxscale-ci.sh $target repo.d - - -export repo_dir=$dir/repo.d/ - export provider=`${mdbci_dir}/mdbci show provider $box --silent 2> /dev/null` export backend_box=${backend_box:-"centos_7_"$provider} @@ -23,15 +17,21 @@ fi ${mdbci_dir}/mdbci destroy $name mkdir -p ${MDBCI_VM_PATH}/$name -mkdir ${MDBCI_VM_PATH}/$name/cnf -cp -r ${cnf_path}/* ${MDBCI_VM_PATH}/$name/cnf/ -export cnd_path="${MDBCI_VM_PATH}/$name/cnf/" +export cnf_path="${MDBCI_VM_PATH}/$name/cnf/" +if [ "$product" == "mysql" ] ; then + export cnf_path=${MDBCI_VM_PATH}/$name/cnf/mysql56/ +fi + eval "cat < /dev/null > ${MDBCI_VM_PATH}/${name}.json -${mdbci_dir}/mdbci --override --template ${MDBCI_VM_PATH}/${name}.json --repo-dir ${repo_dir} generate $name +${mdbci_dir}/mdbci --override --template ${MDBCI_VM_PATH}/${name}.json generate $name + +mkdir ${MDBCI_VM_PATH}/$name/cnf +cp -r ${script_dir}/cnf/* ${MDBCI_VM_PATH}/$name/cnf/ + while [ -f ~/vagrant_lock ] do diff --git a/maxscale-system-test/mdbci/run_test_snapshot.sh b/maxscale-system-test/mdbci/run_test_snapshot.sh index cff4ce3fe..64dd40803 100755 --- a/maxscale-system-test/mdbci/run_test_snapshot.sh +++ b/maxscale-system-test/mdbci/run_test_snapshot.sh @@ -9,7 +9,7 @@ function checkExitStatus { rm $lockFilePath echo "Snapshot lock file was deleted due to an error" exit 1 - fi + fi } set -x @@ -43,8 +43,6 @@ done touch ${snapshot_lock_file} echo $JOB_NAME-$BUILD_NUMBER >> ${snapshot_lock_file} -export repo_dir=$dir/repo.d/ - ${mdbci_dir}/mdbci snapshot revert --path-to-nodes $name --snapshot-name $snapshot_name if [ $? != 0 ]; then @@ -60,14 +58,11 @@ fi . ${script_dir}/set_env.sh "$name" -${mdbci_dir}/repository-config/maxscale-ci.sh $target repo.d - - ${mdbci_dir}/mdbci sudo --command 'yum remove maxscale -y' $name/maxscale ${mdbci_dir}/mdbci sudo --command 'yum clean all' $name/maxscale -${mdbci_dir}/mdbci setup_repo --product maxscale $name/maxscale --repo-dir $repo_dir -${mdbci_dir}/mdbci install_product --product maxscale $name/maxscale --repo-dir $repo_dir +${mdbci_dir}/mdbci setup_repo --product maxscale_ci --product-version ${target} $name/maxscale +${mdbci_dir}/mdbci install_product --product maxscale_ci $name/maxscale checkExitStatus $? "Error installing Maxscale" $snapshot_lock_file @@ -79,11 +74,12 @@ make ./check_backend --restart-galera checkExitStatus $? "Failed to check backends" $snapshot_lock_file - +ulimit -c unlimited ctest $test_set -VV -D Nightly - +cp core.* ${logs_publish_dir} ${script_dir}/copy_logs.sh + # Removing snapshot_lock rm ${snapshot_lock_file} diff --git a/maxscale-system-test/mdbci/templates/big.json.template b/maxscale-system-test/mdbci/templates/big.json.template index 56c0330ee..eb7c36901 100644 --- a/maxscale-system-test/mdbci/templates/big.json.template +++ b/maxscale-system-test/mdbci/templates/big.json.template @@ -145,7 +145,8 @@ "hostname" : "maxscale", "box" : "centos_7_aws_large", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } } diff --git a/maxscale-system-test/mdbci/templates/big15.json.template b/maxscale-system-test/mdbci/templates/big15.json.template index 1297ea96a..0fe08cf4d 100644 --- a/maxscale-system-test/mdbci/templates/big15.json.template +++ b/maxscale-system-test/mdbci/templates/big15.json.template @@ -222,7 +222,8 @@ "hostname" : "maxscale", "box" : "centos_7_aws_large", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } } diff --git a/maxscale-system-test/mdbci/templates/default.json.template b/maxscale-system-test/mdbci/templates/default.json.template index 2376e46a7..1523eb6c2 100644 --- a/maxscale-system-test/mdbci/templates/default.json.template +++ b/maxscale-system-test/mdbci/templates/default.json.template @@ -110,7 +110,8 @@ "box" : "${box}", "memory_size" : "${vm_memory}", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } } diff --git a/maxscale-system-test/mdbci/templates/nogalera.json.template b/maxscale-system-test/mdbci/templates/nogalera.json.template index 31f03af0b..14b654a61 100644 --- a/maxscale-system-test/mdbci/templates/nogalera.json.template +++ b/maxscale-system-test/mdbci/templates/nogalera.json.template @@ -58,7 +58,8 @@ "box" : "${box}", "memory_size" : "${vm_memory}", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } } diff --git a/maxscale-system-test/mdbci/templates/performance.json.template b/maxscale-system-test/mdbci/templates/performance.json.template index a767f9fc2..8d5652cbd 100644 --- a/maxscale-system-test/mdbci/templates/performance.json.template +++ b/maxscale-system-test/mdbci/templates/performance.json.template @@ -60,7 +60,8 @@ "box" : "###box###", "memory_size" : "2048", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } } From e644debdf7e4f73e76df3f2fd7774871a2c6c60c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 15 Aug 2018 13:24:06 +0300 Subject: [PATCH 6/6] Fix SLES 15 packaging SLES 15 doesn't have any sort of init functions which is why the error is converted to a status message. A dummy file that just prints an error is placed into /etc/init.d/ to make it clear to the users that they should use systemd to start MaxScale. --- cmake/init_scripts.cmake | 7 +++++-- etc/fallback/maxscale.in | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 etc/fallback/maxscale.in diff --git a/cmake/init_scripts.cmake b/cmake/init_scripts.cmake index 23ab7b8e5..83f8dd138 100644 --- a/cmake/init_scripts.cmake +++ b/cmake/init_scripts.cmake @@ -10,7 +10,7 @@ elseif(EXISTS ${SLES_FNC}) elseif(EXISTS ${DEB_FNC}) set(USE_DEB TRUE CACHE BOOL "If init.d script uses /lib/lsb/init-functions instead of /etc/rc.d/init.d/functions.") else() - message(FATAL_ERROR "Cannot find required init-functions in /lib/lsb/ or /etc/rc.d/init.d/, please confirm that your system files are OK.") + message(STATUS "Cannot find required init-functions in /lib/lsb/ or /etc/rc.d/init.d/, will not install init scripts.") endif() if(USE_DEB) @@ -18,7 +18,10 @@ if(USE_DEB) elseif(USE_RPM) configure_file(${CMAKE_SOURCE_DIR}/etc/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) elseif(USE_SLES) - configure_file(${CMAKE_SOURCE_DIR}/etc/sles11/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) + configure_file(${CMAKE_SOURCE_DIR}/etc/sles11/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) +else() + # Use a dummy file that tells the user that init scripts aren't supported on this platform + configure_file(${CMAKE_SOURCE_DIR}/etc/fallback/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) endif() configure_file(${CMAKE_SOURCE_DIR}/etc/maxscale.conf.in ${CMAKE_BINARY_DIR}/maxscale.conf @ONLY) diff --git a/etc/fallback/maxscale.in b/etc/fallback/maxscale.in new file mode 100755 index 000000000..2b368861e --- /dev/null +++ b/etc/fallback/maxscale.in @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "Init scripts are not supported on this platform, use either systemd or launch MaxScale manually" +exit 1