@@ -22,11 +22,25 @@ logmust check_running_system
2222
2323logmust determine_default_git_branch
2424
25+ #
26+ # In order to ship vSDK 4.0.0 with 6.0.12.0, we need python3.8 (and the
27+ # relevant distutils release). The following line gets the deadsnakes
28+ # (https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa) repo from
29+ # which we install python3.8 in packages/virtualization/config.sh.
30+ # This line will be removed via DLPX-78481 when 6.0/stage begins
31+ # tracking 6.0.13.0.
32+ #
33+ function install_python_38() {
34+ logmust sudo add-apt-repository ppa:deadsnakes/ppa -y
35+ logmust sudo apt-get update
36+ logmust install_pkgs python 3.8
37+ }
38+
2539#
2640# Update the sources.list file to point to our internal package mirror. If no
2741# mirror url is passed in, then the latest mirror snapshot is used.
2842#
29- configure_apt_sources () {
43+ function configure_apt_sources() {
3044 local package_mirror_url
3145 local primary_url=" $DELPHIX_PACKAGE_MIRROR_MAIN "
3246 local secondary_url=" $DELPHIX_PACKAGE_MIRROR_SECONDARY "
@@ -81,6 +95,26 @@ configure_apt_sources() {
8195 logmust sudo apt-key add " $TOP /resources/delphix-secondary-mirror.key"
8296}
8397
98+ #
99+ # Some packages require cause a spike in memory usage during the build, so
100+ # we add a swap file to prevent the oom-killer from terminating the build.
101+ #
102+ function add_swap() {
103+ local swapfile=" /swapfile"
104+ local size=" 4G"
105+
106+ if [[ ! -f " $swapfile " ]]; then
107+ logmust sudo fallocate -l " $size " " $swapfile "
108+ logmust sudo chmod 600 /swapfile
109+ logmust sudo mkswap /swapfile
110+ fi
111+
112+ if ! sudo swapon --show | grep -q " $swapfile " ; then
113+ logmust sudo swapon " $swapfile "
114+ fi
115+ }
116+
117+ logmust install_python_38
84118logmust configure_apt_sources
85119logmust sudo apt-get update
86120
@@ -112,6 +146,8 @@ logmust install_shfmt
112146#
113147logmust install_gcc8
114148
149+ logmust add_swap
150+
115151logmust git config --global user.email " eng@delphix.com"
116152logmust git config --global user.name " Delphix Engineering"
117153
0 commit comments