diff options
Diffstat (limited to 'coin/provisioning/common/macos')
-rwxr-xr-x | coin/provisioning/common/macos/homebrew.sh | 13 | ||||
-rwxr-xr-x | coin/provisioning/common/macos/increase_limits.sh | 70 | ||||
-rwxr-xr-x | coin/provisioning/common/macos/install-commandlinetools.sh | 2 | ||||
-rwxr-xr-x | coin/provisioning/common/macos/install_openssl_111a.sh | 78 | ||||
-rw-r--r-- | coin/provisioning/common/macos/libiodbc.rb | 23 | ||||
-rwxr-xr-x | coin/provisioning/common/macos/libiodbc.sh | 3 | ||||
-rw-r--r-- | coin/provisioning/common/macos/limit.maxfiles.plist | 20 | ||||
-rw-r--r-- | coin/provisioning/common/macos/limit.maxproc.plist | 20 | ||||
-rw-r--r-- | coin/provisioning/common/macos/telegraf-coin.conf | 51 |
9 files changed, 197 insertions, 83 deletions
diff --git a/coin/provisioning/common/macos/homebrew.sh b/coin/provisioning/common/macos/homebrew.sh index a6efe123..715477c0 100755 --- a/coin/provisioning/common/macos/homebrew.sh +++ b/coin/provisioning/common/macos/homebrew.sh @@ -1,3 +1,12 @@ #!/usr/bin/env bash -# Will install homebrew package manager for macOS -/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" </dev/null + + +# Will install homebrew package manager for macOS. +# WARNING: Requires commandlinetools + +# TODO audit and cache this file locally, see QTQAINFRA-3134 +curl -L -o /tmp/homebrew_install https://raw.githubusercontent.com/Homebrew/install/master/install + +/usr/bin/ruby /tmp/homebrew_install </dev/null + +brew update diff --git a/coin/provisioning/common/macos/increase_limits.sh b/coin/provisioning/common/macos/increase_limits.sh new file mode 100755 index 00000000..040c55e8 --- /dev/null +++ b/coin/provisioning/common/macos/increase_limits.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +############################################################################# +## +## Copyright (C) 2019 The Qt Company Ltd. +## Contact: http://www.qt.io/licensing/ +## +## This file is part of the provisioning scripts of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL21$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see http://www.qt.io/terms-conditions. For further +## information use the contact form at http://www.qt.io/contact-us. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## As a special exception, The Qt Company gives you certain additional +## rights. These rights are described in The Qt Company LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## $QT_END_LICENSE$ +## +############################################################################# + + +# Increase the soft and hard RLIMIT_NOFILE and RLIMIT_NPROC limits. +# By default they are 256/unlimited and 709/1064 +# and they sometimes create problems to the build process and telegraf. + + +set -e + +PROVISIONING_DIR="$(dirname "$0")/../../" +. "$PROVISIONING_DIR"/common/unix/common.sourced.sh + + +echo "Current limits are:" +ulimit -a +launchctl limit + +$CMD_INSTALL -m 644 -o root -g wheel \ + $PROVISIONING_DIR/common/macos/limit.maxfiles.plist \ + $PROVISIONING_DIR/common/macos/limit.maxproc.plist \ + /Library/LaunchDaemons/ + +# Activate the new limits immediately (not for the current session though) +sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist +sudo launchctl load -w /Library/LaunchDaemons/limit.maxproc.plist + +echo "After adjusting, limits are:" +ulimit -a +launchctl limit + + +# NOTE: If the limits are not increased enough, it might be because of +# restrictions set by the kernel. They can be temporarily altered with: + +# sudo sysctl -w kern.maxproc=xxxx +# sudo sysctl -w kern.maxprocperuid=xxx diff --git a/coin/provisioning/common/macos/install-commandlinetools.sh b/coin/provisioning/common/macos/install-commandlinetools.sh index 7b0ead98..cd7838b6 100755 --- a/coin/provisioning/common/macos/install-commandlinetools.sh +++ b/coin/provisioning/common/macos/install-commandlinetools.sh @@ -50,7 +50,7 @@ function InstallCommandLineTools { hdiutil attach "/tmp/$packageName" cd "/Volumes/Command Line Developer Tools" echo "Installing" - sudo installer -verbose -pkg ./*.pkg -target / + sudo installer -pkg ./*.pkg -target / -allowUntrusted cd / # Let's fait for 5 second before unmounting. Sometimes resource is busy and cant be unmounted sleep 3 diff --git a/coin/provisioning/common/macos/install_openssl_111a.sh b/coin/provisioning/common/macos/install_openssl_111a.sh deleted file mode 100755 index cd6cd9e8..00000000 --- a/coin/provisioning/common/macos/install_openssl_111a.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2019 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# - -# This script install OpenSSL - -set -ex - -# shellcheck source=../unix/InstallFromCompressedFileFromURL.sh -source "${BASH_SOURCE%/*}/../unix/InstallFromCompressedFileFromURL.sh" -# shellcheck source=../unix/SetEnvVar.sh -source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" - -opensslVersion="1.1.1a" -opensslFile="openssl-$opensslVersion.tar.gz" -opensslDlUrl="http://ci-files01-hki.intra.qt.io/input/openssl/$opensslFile" -opensslAltDlUrl="https://www.openssl.org/source/$opensslFile" -opensslSha1="8fae27b4f34445a5500c9dc50ae66b4d6472ce29" - -# Below target location has been hard coded into Coin. -# QTQAINFRA-1195 -openssl_install_dir=/usr/local/openssl-$opensslVersion -opensslTargetLocation="/usr/local/opt/openssl" - -InstallFromCompressedFileFromURL "$opensslDlUrl" "$opensslAltDlUrl" "$opensslSha1" "/tmp/openssl-$opensslVersion" "openssl-$opensslVersion" -cd "/tmp/openssl-$opensslVersion" -sudo ./Configure --prefix=$openssl_install_dir shared no-ssl3-method enable-ec_nistp_64_gcc_128 darwin64-x86_64-cc "-Wa,--noexecstack" - -sudo make install_sw install_ssldirs - -path=$(echo "$opensslTargetLocation" | sed -E 's/(.*)\/.*$/\1/') -sudo mkdir -p "$path" -sudo ln -s $openssl_install_dir $opensslTargetLocation - -SetEnvVar "PATH" "\"$opensslTargetLocation/bin:\$PATH\"" -SetEnvVar "MANPATH" "\"$opensslTargetLocation/share/man:\$MANPATH\"" - -SetEnvVar "OPENSSL_DIR" "\"$openssl_install_dir\"" -SetEnvVar "OPENSSL_INCLUDE" "\"$openssl_install_dir/include\"" -SetEnvVar "OPENSSL_LIB" "\"$openssl_install_dir/lib\"" - -security find-certificate -a -p /Library/Keychains/System.keychain | sudo tee -a $opensslTargetLocation/ssl/cert.pem > /dev/null -security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain | sudo tee -a $opensslTargetLocation/ssl/cert.pem > /dev/null - -sudo rm -rf /tmp/openssl-$opensslVersion - -echo "OpenSSL = $opensslVersion" >> ~/versions.txt diff --git a/coin/provisioning/common/macos/libiodbc.rb b/coin/provisioning/common/macos/libiodbc.rb new file mode 100644 index 00000000..ed669e69 --- /dev/null +++ b/coin/provisioning/common/macos/libiodbc.rb @@ -0,0 +1,23 @@ +class Libiodbc < Formula + desc "Database connectivity layer based on ODBC. (alternative to unixodbc)" + homepage "http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/" + url "https://github.com/openlink/iODBC/archive/v3.52.12.tar.gz" + sha256 "b2cab4f8fbd5388344d7ee0deb1a32310795b1e631c3505a5b515d90186e2516" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + + conflicts_with "unixodbc", :because => "both install 'odbcinst.h' header" + + def install + system "./autogen.sh" + system "./configure", "--prefix=#{prefix}" + system "make", "install" + end + + test do + system bin/"iodbc-config", "--version" + end +end + diff --git a/coin/provisioning/common/macos/libiodbc.sh b/coin/provisioning/common/macos/libiodbc.sh index 79fa86c2..d620c71d 100755 --- a/coin/provisioning/common/macos/libiodbc.sh +++ b/coin/provisioning/common/macos/libiodbc.sh @@ -40,8 +40,7 @@ set -ex # shellcheck source=../unix/SetEnvVar.sh source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" -brew update -brew install libiodbc +brew install ${BASH_SOURCE%/*}/libiodbc.rb # CPLUS_INCLUDE_PATH is set so clang and configure can find libiodbc diff --git a/coin/provisioning/common/macos/limit.maxfiles.plist b/coin/provisioning/common/macos/limit.maxfiles.plist new file mode 100644 index 00000000..1bf85214 --- /dev/null +++ b/coin/provisioning/common/macos/limit.maxfiles.plist @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>Label</key> + <string>limit.maxfiles</string> + <key>ProgramArguments</key> + <array> + <string>launchctl</string> + <string>limit</string> + <string>maxfiles</string> + <string>65536</string> + <string>524288</string> + </array> + <key>RunAtLoad</key> + <true/> + <key>ServiceIPC</key> + <false/> + </dict> +</plist> diff --git a/coin/provisioning/common/macos/limit.maxproc.plist b/coin/provisioning/common/macos/limit.maxproc.plist new file mode 100644 index 00000000..0c2cc0e9 --- /dev/null +++ b/coin/provisioning/common/macos/limit.maxproc.plist @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>Label</key> + <string>limit.maxproc</string> + <key>ProgramArguments</key> + <array> + <string>launchctl</string> + <string>limit</string> + <string>maxproc</string> + <string>8192</string> + <string>32768</string> + </array> + <key>RunAtLoad</key> + <true/> + <key>ServiceIPC</key> + <false/> + </dict> +</plist> diff --git a/coin/provisioning/common/macos/telegraf-coin.conf b/coin/provisioning/common/macos/telegraf-coin.conf new file mode 100644 index 00000000..24440a05 --- /dev/null +++ b/coin/provisioning/common/macos/telegraf-coin.conf @@ -0,0 +1,51 @@ +[global_tags] +[agent] + interval = "10s" + round_interval = true + metric_batch_size = 100 + metric_buffer_limit = 10000 + collection_jitter = "0s" + flush_interval = "10s" + flush_jitter = "5s" + precision = "" + logfile = "/var/log/telegraf-coin.log" + hostname = "$COIN_UNIQUE_JOB_ID" + omit_hostname = false +[[outputs.influxdb]] + urls= ["https://qtinfluxdb01.intra.qt.io:8086"] + insecure_skip_verify = true + database = "coin_vms" + skip_database_creation = true + username = "coin_vms_writer" + password = "COIN_VMS_WRITER_PASS" +#[[inputs.cpu]] # linux-only +# percpu = true +# totalcpu = true +# collect_cpu_time = false +# report_active = false +[[inputs.disk]] + ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"] +#[[inputs.diskio]] # linux-only +[[inputs.kernel]] +[[inputs.mem]] +[[inputs.processes]] +[[inputs.swap]] +[[inputs.system]] +#[[inputs.kernel_vmstat]] # linux-only +[[inputs.netstat]] + + +# Monitor Coin process +[[inputs.procstat]] + exe = "coin-" + # Buggy on macOS if using the "native" pid_finder, see: + # https://github.com/influxdata/telegraf/issues/6265 + # Tested 1.12.1 version that "native" pid_finder has been fixed, + # but it is slow and times out frequently + pid_finder = "pgrep" + + +# Monitor I/O latency +[[inputs.exec]] + data_format = "influx" + commands = [ "/usr/bin/telegraf-ioping.sh /" ] |