HOWTO: combine two chunk_size listings into a single one
[fio.git] / ci / actions-install.sh
CommitLineData
ce1b5612
SW
1#!/bin/bash
2# This script expects to be invoked from the base fio directory.
3set -eu
4
5SCRIPT_DIR=$(dirname "$0")
6# shellcheck disable=SC1091
7. "${SCRIPT_DIR}/common.sh"
8
9install_ubuntu() {
10 local pkgs
11
12 cat <<DPKGCFG | sudo tee /etc/dpkg/dpkg.cfg.d/dpkg-speedup > /dev/null
13# Skip fsync
14force-unsafe-io
15# Don't install documentation
16path-exclude=/usr/share/man/*
17path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo
18path-exclude=/usr/share/doc/*
19DPKGCFG
20 # Packages available on i686 and x86_64
21 pkgs=(
22 libaio-dev
23 libcunit1-dev
24 libcurl4-openssl-dev
25 libfl-dev
26 libibverbs-dev
27 libnuma-dev
28 librdmacm-dev
29 valgrind
30 )
31 case "${CI_TARGET_ARCH}" in
32 "i686")
33 sudo dpkg --add-architecture i386
1420399f 34 opts="--allow-downgrades"
ce1b5612
SW
35 pkgs=("${pkgs[@]/%/:i386}")
36 pkgs+=(
37 gcc-multilib
38 pkg-config:i386
39 zlib1g-dev:i386
1420399f 40 libpcre2-8-0=10.34-7
ce1b5612
SW
41 )
42 ;;
43 "x86_64")
1420399f 44 opts=""
ce1b5612
SW
45 pkgs+=(
46 libglusterfs-dev
47 libgoogle-perftools-dev
48 libiscsi-dev
49 libnbd-dev
50 libpmem-dev
51 libpmemblk-dev
52 librbd-dev
53 libtcmalloc-minimal4
54 nvidia-cuda-dev
55 )
56 ;;
57 esac
58
59 # Architecture-independent packages and packages for which we don't
60 # care about the architecture.
61 pkgs+=(
62 python3-scipy
63 )
64
65 echo "Updating APT..."
66 sudo apt-get -qq update
67 echo "Installing packages..."
1420399f 68 sudo apt-get install "$opts" -o APT::Immediate-Configure=false --no-install-recommends -qq -y "${pkgs[@]}"
ce1b5612
SW
69}
70
71install_linux() {
72 install_ubuntu
73}
74
75install_macos() {
76 # Assumes homebrew and python3 are already installed
77 #echo "Updating homebrew..."
78 #brew update >/dev/null 2>&1
79 echo "Installing packages..."
80 HOMEBREW_NO_AUTO_UPDATE=1 brew install cunit
81 pip3 install scipy six
82}
83
84main() {
85 set_ci_target_os
86
87 install_function="install_${CI_TARGET_OS}"
88 ${install_function}
89
90 echo "Python3 path: $(type -p python3 2>&1)"
91 echo "Python3 version: $(python3 -V 2>&1)"
92}
93
94main