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/libiodbc.sh | 1 | ||||
-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 |
7 files changed, 173 insertions, 4 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..b9f81534 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 / 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/libiodbc.sh b/coin/provisioning/common/macos/libiodbc.sh index 4ba0bbc3..d620c71d 100755 --- a/coin/provisioning/common/macos/libiodbc.sh +++ b/coin/provisioning/common/macos/libiodbc.sh @@ -40,7 +40,6 @@ set -ex # shellcheck source=../unix/SetEnvVar.sh source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" -brew update 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 /" ] |