aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/macos
diff options
context:
space:
mode:
Diffstat (limited to 'coin/provisioning/common/macos')
-rwxr-xr-xcoin/provisioning/common/macos/InstallPKGFromURL.sh14
-rwxr-xr-xcoin/provisioning/common/macos/disable-notifications_and_warnings.sh7
-rwxr-xr-xcoin/provisioning/common/macos/homebrew.sh24
-rwxr-xr-xcoin/provisioning/common/macos/increase_limits.sh70
-rwxr-xr-xcoin/provisioning/common/macos/install-commandlinetools.sh2
-rwxr-xr-xcoin/provisioning/common/macos/install_openssl_111a.sh78
-rw-r--r--coin/provisioning/common/macos/libiodbc.rb23
-rwxr-xr-xcoin/provisioning/common/macos/libiodbc.sh3
-rwxr-xr-xcoin/provisioning/common/macos/libusb.sh43
-rw-r--r--coin/provisioning/common/macos/limit.maxfiles.plist20
-rw-r--r--coin/provisioning/common/macos/limit.maxproc.plist20
-rwxr-xr-xcoin/provisioning/common/macos/pkgconfig.sh43
-rw-r--r--coin/provisioning/common/macos/telegraf-coin.conf57
-rwxr-xr-xcoin/provisioning/common/macos/version.sh6
14 files changed, 321 insertions, 89 deletions
diff --git a/coin/provisioning/common/macos/InstallPKGFromURL.sh b/coin/provisioning/common/macos/InstallPKGFromURL.sh
index 77ef128a..d9b55d3b 100755
--- a/coin/provisioning/common/macos/InstallPKGFromURL.sh
+++ b/coin/provisioning/common/macos/InstallPKGFromURL.sh
@@ -42,7 +42,9 @@ function InstallPKGFromURL {
targetDirectory=$4
echo "Creating temporary file"
- targetFile=$(mktemp "$TMPDIR$(uuidgen).pkg")
+ package_basename=$(echo "$url" | sed 's|^.*/||')
+ tmpdir=$(mktemp -d)
+ targetFile="$tmpdir/$package_basename"
echo "Downloading PKG from primary URL '$url'"
curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url" || (
echo "Failed to download '$url' multiple times"
@@ -50,10 +52,12 @@ function InstallPKGFromURL {
curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url_alt"
)
echo "Checking SHA1 on PKG '$targetFile'"
- echo "$expectedSha1 *$targetFile" > "$targetFile.sha1"
- /usr/bin/shasum --check "$targetFile.sha1"
+ echo "$expectedSha1 *$targetFile" > "$targetFile".sha1
+ /usr/bin/shasum --check "$targetFile".sha1
echo "Run installer on PKG"
sudo installer -package "$targetFile" -target "$targetDirectory"
- echo "Removing file '$targetFile'"
- rm "$targetFile"
+
+ rm -f "$targetFile".sha1
+ rm -f "$targetFile"
+ rmdir "$tmpdir"
}
diff --git a/coin/provisioning/common/macos/disable-notifications_and_warnings.sh b/coin/provisioning/common/macos/disable-notifications_and_warnings.sh
new file mode 100755
index 00000000..c40a4f65
--- /dev/null
+++ b/coin/provisioning/common/macos/disable-notifications_and_warnings.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+echo "Unload notificationcenterui.plist"
+launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
+
+echo "Remove 32-bit warnings"
+rm ~/Library/Preferences/com.apple.coreservices.uiagent.plist
diff --git a/coin/provisioning/common/macos/homebrew.sh b/coin/provisioning/common/macos/homebrew.sh
index a6efe123..66463c44 100755
--- a/coin/provisioning/common/macos/homebrew.sh
+++ b/coin/provisioning/common/macos/homebrew.sh
@@ -1,3 +1,21 @@
-#!/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
+#!/bin/sh
+
+
+# Will install homebrew package manager for macOS.
+# WARNING: Requires commandlinetools
+
+
+set -e
+
+. "$(dirname "$0")"/../../common/unix/DownloadURL.sh
+
+
+DownloadURL \
+ http://ci-files01-hki.intra.qt.io/input/mac/homebrew-install.c744a716f9845988d01e6e238eee7117b8c366c9.rb \
+ https://raw.githubusercontent.com/Homebrew/install/c744a716f9845988d01e6e238eee7117b8c366c9/install \
+ b9782cc0b550229de77b429b56ffce04157e60486ab9df00461ccf3dad565b0a \
+ /tmp/homebrew_install
+/usr/bin/ruby /tmp/homebrew_install </dev/null
+
+# No need to manually do `brew update`, the homebrew installer script does it.
+### 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/libusb.sh b/coin/provisioning/common/macos/libusb.sh
new file mode 100755
index 00000000..cf9e7150
--- /dev/null
+++ b/coin/provisioning/common/macos/libusb.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+
+#############################################################################
+##
+## Copyright (C) 2020 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$
+##
+#############################################################################
+
+# Install libusb
+set -ex
+
+source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
+brew install libusb
+read -r -a arr <<< $(brew list --versions libusb)
+version=${arr[1]}
+echo "libusb = $version" >> ~/versions.txt
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/pkgconfig.sh b/coin/provisioning/common/macos/pkgconfig.sh
new file mode 100755
index 00000000..9fad4912
--- /dev/null
+++ b/coin/provisioning/common/macos/pkgconfig.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+
+#############################################################################
+##
+## Copyright (C) 2020 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$
+##
+#############################################################################
+
+# Install pkgconfig
+set -ex
+
+source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
+brew install pkgconfig
+read -r -a arr <<< $(brew list --versions pkgconfig)
+version=${arr[1]}
+echo "pkgconfig = $version" >> ~/versions.txt
diff --git a/coin/provisioning/common/macos/telegraf-coin.conf b/coin/provisioning/common/macos/telegraf-coin.conf
new file mode 100644
index 00000000..006de88c
--- /dev/null
+++ b/coin/provisioning/common/macos/telegraf-coin.conf
@@ -0,0 +1,57 @@
+[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]]
+ # macOS needs two extra filesystem exceptions:
+ # + cd9660: This is a read-only filesystem, and always 100% full
+ # + msdos: Sometimes at boot a short-lived unique mount of type "msdos"
+ # is performed, at the random directory
+ # /Volumes/firmwaresyncd.XXXXXX.
+ # The uniqueness of the path bloats the cardinality of InfluxDB.
+ ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs", "cd9660", "msdos"]
+#[[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 /" ]
diff --git a/coin/provisioning/common/macos/version.sh b/coin/provisioning/common/macos/version.sh
index 3e2a7f19..e57fb60b 100755
--- a/coin/provisioning/common/macos/version.sh
+++ b/coin/provisioning/common/macos/version.sh
@@ -41,3 +41,9 @@ echo "*********************************************"
echo "***** SW VERSIONS *****"
cat ~/versions.txt
echo "*********************************************"
+echo "*************** mount ***********************"
+mount
+echo "*********************************************"
+echo "*************** df **************************"
+df -h
+echo "*********************************************"