Skip to content

Commit ef11221

Browse files
ci: extract os tuning (#18824)
Signed-off-by: Arthur Schreiber <[email protected]>
1 parent dde33e3 commit ef11221

File tree

107 files changed

+337
-1211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+337
-1211
lines changed

.github/actions/tune-os/action.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Tune OS"
2+
description: "Tune the OS for better performance during CI runs"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Tune the OS
7+
shell: bash
8+
run: |
9+
# Install eatmydata and ensure it's used for every operation
10+
sudo apt-get update && sudo apt-get install -y eatmydata
11+
echo "/usr/\${LIB}/libeatmydata.so" | sudo tee -a /etc/ld.so.preload
12+
13+
# Increase the range of ephemeral ports.
14+
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
15+
16+
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
17+
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
18+
sudo sysctl -p /etc/sysctl.conf
19+
20+
# Don't waste a bunch of time processing man-db triggers
21+
echo "set man-db/auto-update false" | sudo debconf-communicate
22+
sudo dpkg-reconfigure man-db

.github/workflows/check_make_vtadmin_authz_testgen.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,16 @@ jobs:
4343
- 'go/vt/vtadmin/**'
4444
- '.github/workflows/check_make_vtadmin_authz_testgen.yml'
4545
46+
- name: Tune the OS
47+
if: steps.changes.outputs.vtadmin_changes == 'true'
48+
uses: ./.github/actions/tune-os
49+
4650
- name: Set up Go
4751
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
4852
if: steps.changes.outputs.vtadmin_changes == 'true'
4953
with:
5054
go-version-file: go.mod
5155

52-
- name: Tune the OS
53-
if: steps.changes.outputs.vtadmin_changes == 'true'
54-
run: |
55-
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
56-
57-
# Don't waste a bunch of time processing man-db triggers
58-
echo "set man-db/auto-update false" | sudo debconf-communicate
59-
sudo dpkg-reconfigure man-db
60-
6156
- name: Get dependencies
6257
if: steps.changes.outputs.vtadmin_changes == 'true'
6358
run: |

.github/workflows/check_make_vtadmin_web_proto.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
with:
2828
persist-credentials: 'false'
2929

30+
- name: Tune the OS
31+
uses: ./.github/actions/tune-os
32+
3033
- name: Check for changes in relevant files
3134
uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3.0.1
3235
id: changes

.github/workflows/cluster_endtoend_12.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,7 @@ jobs:
7373

7474
- name: Tune the OS
7575
if: steps.changes.outputs.end_to_end == 'true'
76-
run: |
77-
# Limit local port range to not use ports that overlap with server side
78-
# ports that we listen on.
79-
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
80-
81-
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
82-
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
83-
sudo sysctl -p /etc/sysctl.conf
84-
85-
# Don't waste a bunch of time processing man-db triggers
86-
echo "set man-db/auto-update false" | sudo debconf-communicate
87-
sudo dpkg-reconfigure man-db
76+
uses: ./.github/actions/tune-os
8877

8978
- name: Get dependencies
9079
if: steps.changes.outputs.end_to_end == 'true'
@@ -108,7 +97,7 @@ jobs:
10897
sudo dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb
10998
11099
# Install everything else we need, and configure
111-
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget eatmydata xz-utils libncurses6
100+
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget xz-utils libncurses6
112101
113102
sudo service mysql stop
114103
sudo service etcd stop
@@ -145,7 +134,7 @@ jobs:
145134
# Some of these tests require specific locales to be installed.
146135
# See https://github.com/cncf/automation/commit/49f2ad7a791a62ff7d038002bbb2b1f074eed5d5
147136
# run the tests however you normally do, then produce a JUnit XML file
148-
eatmydata -- go run test.go -docker=false -follow -shard 12 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
137+
go run test.go -docker=false -follow -shard 12 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
149138
150139
- name: Record test results in launchable if PR is not a draft
151140
if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' && !cancelled()

.github/workflows/cluster_endtoend_13.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,7 @@ jobs:
7373

7474
- name: Tune the OS
7575
if: steps.changes.outputs.end_to_end == 'true'
76-
run: |
77-
# Limit local port range to not use ports that overlap with server side
78-
# ports that we listen on.
79-
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
80-
81-
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
82-
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
83-
sudo sysctl -p /etc/sysctl.conf
84-
85-
# Don't waste a bunch of time processing man-db triggers
86-
echo "set man-db/auto-update false" | sudo debconf-communicate
87-
sudo dpkg-reconfigure man-db
76+
uses: ./.github/actions/tune-os
8877

8978
- name: Get dependencies
9079
if: steps.changes.outputs.end_to_end == 'true'
@@ -108,7 +97,7 @@ jobs:
10897
sudo dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb
10998
11099
# Install everything else we need, and configure
111-
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget eatmydata xz-utils libncurses6
100+
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget xz-utils libncurses6
112101
113102
sudo service mysql stop
114103
sudo service etcd stop
@@ -145,7 +134,7 @@ jobs:
145134
# Some of these tests require specific locales to be installed.
146135
# See https://github.com/cncf/automation/commit/49f2ad7a791a62ff7d038002bbb2b1f074eed5d5
147136
# run the tests however you normally do, then produce a JUnit XML file
148-
eatmydata -- go run test.go -docker=false -follow -shard 13 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
137+
go run test.go -docker=false -follow -shard 13 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
149138
150139
- name: Record test results in launchable if PR is not a draft
151140
if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' && !cancelled()

.github/workflows/cluster_endtoend_15.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,7 @@ jobs:
7373

7474
- name: Tune the OS
7575
if: steps.changes.outputs.end_to_end == 'true'
76-
run: |
77-
# Limit local port range to not use ports that overlap with server side
78-
# ports that we listen on.
79-
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
80-
81-
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
82-
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
83-
sudo sysctl -p /etc/sysctl.conf
84-
85-
# Don't waste a bunch of time processing man-db triggers
86-
echo "set man-db/auto-update false" | sudo debconf-communicate
87-
sudo dpkg-reconfigure man-db
76+
uses: ./.github/actions/tune-os
8877

8978
- name: Get dependencies
9079
if: steps.changes.outputs.end_to_end == 'true'
@@ -108,7 +97,7 @@ jobs:
10897
sudo dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb
10998
11099
# Install everything else we need, and configure
111-
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget eatmydata xz-utils libncurses6
100+
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget xz-utils libncurses6
112101
113102
sudo service mysql stop
114103
sudo service etcd stop
@@ -145,7 +134,7 @@ jobs:
145134
# Some of these tests require specific locales to be installed.
146135
# See https://github.com/cncf/automation/commit/49f2ad7a791a62ff7d038002bbb2b1f074eed5d5
147136
# run the tests however you normally do, then produce a JUnit XML file
148-
eatmydata -- go run test.go -docker=false -follow -shard 15 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
137+
go run test.go -docker=false -follow -shard 15 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
149138
150139
- name: Record test results in launchable if PR is not a draft
151140
if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' && !cancelled()

.github/workflows/cluster_endtoend_18.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,7 @@ jobs:
7373

7474
- name: Tune the OS
7575
if: steps.changes.outputs.end_to_end == 'true'
76-
run: |
77-
# Limit local port range to not use ports that overlap with server side
78-
# ports that we listen on.
79-
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
80-
81-
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
82-
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
83-
sudo sysctl -p /etc/sysctl.conf
84-
85-
# Don't waste a bunch of time processing man-db triggers
86-
echo "set man-db/auto-update false" | sudo debconf-communicate
87-
sudo dpkg-reconfigure man-db
76+
uses: ./.github/actions/tune-os
8877

8978
- name: Get dependencies
9079
if: steps.changes.outputs.end_to_end == 'true'
@@ -108,7 +97,7 @@ jobs:
10897
sudo dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb
10998
11099
# Install everything else we need, and configure
111-
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget eatmydata xz-utils libncurses6
100+
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget xz-utils libncurses6
112101
113102
sudo service mysql stop
114103
sudo service etcd stop
@@ -150,7 +139,7 @@ jobs:
150139
# Some of these tests require specific locales to be installed.
151140
# See https://github.com/cncf/automation/commit/49f2ad7a791a62ff7d038002bbb2b1f074eed5d5
152141
# run the tests however you normally do, then produce a JUnit XML file
153-
eatmydata -- go run test.go -docker=false -follow -shard 18 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
142+
go run test.go -docker=false -follow -shard 18 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
154143
155144
- name: Record test results in launchable if PR is not a draft
156145
if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' && !cancelled()

.github/workflows/cluster_endtoend_21.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,7 @@ jobs:
7373

7474
- name: Tune the OS
7575
if: steps.changes.outputs.end_to_end == 'true'
76-
run: |
77-
# Limit local port range to not use ports that overlap with server side
78-
# ports that we listen on.
79-
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
80-
81-
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
82-
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
83-
sudo sysctl -p /etc/sysctl.conf
84-
85-
# Don't waste a bunch of time processing man-db triggers
86-
echo "set man-db/auto-update false" | sudo debconf-communicate
87-
sudo dpkg-reconfigure man-db
76+
uses: ./.github/actions/tune-os
8877

8978
- name: Get dependencies
9079
if: steps.changes.outputs.end_to_end == 'true'
@@ -108,7 +97,7 @@ jobs:
10897
sudo dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb
10998
11099
# Install everything else we need, and configure
111-
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget eatmydata xz-utils libncurses6
100+
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget xz-utils libncurses6
112101
113102
sudo service mysql stop
114103
sudo service etcd stop
@@ -151,7 +140,7 @@ jobs:
151140
# Some of these tests require specific locales to be installed.
152141
# See https://github.com/cncf/automation/commit/49f2ad7a791a62ff7d038002bbb2b1f074eed5d5
153142
# run the tests however you normally do, then produce a JUnit XML file
154-
eatmydata -- go run test.go -docker=false -follow -shard 21 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
143+
go run test.go -docker=false -follow -shard 21 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
155144
156145
- name: Record test results in launchable if PR is not a draft
157146
if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' && !cancelled()

.github/workflows/cluster_endtoend_backup_pitr.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,7 @@ jobs:
7373

7474
- name: Tune the OS
7575
if: steps.changes.outputs.end_to_end == 'true'
76-
run: |
77-
# Limit local port range to not use ports that overlap with server side
78-
# ports that we listen on.
79-
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
80-
81-
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
82-
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
83-
sudo sysctl -p /etc/sysctl.conf
84-
85-
# Don't waste a bunch of time processing man-db triggers
86-
echo "set man-db/auto-update false" | sudo debconf-communicate
87-
sudo dpkg-reconfigure man-db
76+
uses: ./.github/actions/tune-os
8877

8978
- name: Get dependencies
9079
if: steps.changes.outputs.end_to_end == 'true'
@@ -108,7 +97,7 @@ jobs:
10897
sudo dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb
10998
11099
# Install everything else we need, and configure
111-
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget eatmydata xz-utils libncurses6
100+
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget xz-utils libncurses6
112101
113102
sudo service mysql stop
114103
sudo service etcd stop
@@ -145,7 +134,7 @@ jobs:
145134
# Some of these tests require specific locales to be installed.
146135
# See https://github.com/cncf/automation/commit/49f2ad7a791a62ff7d038002bbb2b1f074eed5d5
147136
# run the tests however you normally do, then produce a JUnit XML file
148-
eatmydata -- go run test.go -docker=false -follow -shard backup_pitr | tee -a output.txt | go-junit-report -set-exit-code > report.xml
137+
go run test.go -docker=false -follow -shard backup_pitr | tee -a output.txt | go-junit-report -set-exit-code > report.xml
149138
150139
- name: Record test results in launchable if PR is not a draft
151140
if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' && !cancelled()

.github/workflows/cluster_endtoend_backup_pitr_mysqlshell.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,7 @@ jobs:
7373

7474
- name: Tune the OS
7575
if: steps.changes.outputs.end_to_end == 'true'
76-
run: |
77-
# Limit local port range to not use ports that overlap with server side
78-
# ports that we listen on.
79-
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
80-
81-
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
82-
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
83-
sudo sysctl -p /etc/sysctl.conf
84-
85-
# Don't waste a bunch of time processing man-db triggers
86-
echo "set man-db/auto-update false" | sudo debconf-communicate
87-
sudo dpkg-reconfigure man-db
76+
uses: ./.github/actions/tune-os
8877

8978
- name: Get dependencies
9079
if: steps.changes.outputs.end_to_end == 'true'
@@ -108,7 +97,7 @@ jobs:
10897
sudo dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb
10998
11099
# Install everything else we need, and configure
111-
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget eatmydata xz-utils libncurses6
100+
sudo apt-get -qq install -y mysql-server mysql-shell mysql-client make unzip g++ etcd-client etcd-server curl git wget xz-utils libncurses6
112101
113102
sudo service mysql stop
114103
sudo service etcd stop
@@ -145,7 +134,7 @@ jobs:
145134
# Some of these tests require specific locales to be installed.
146135
# See https://github.com/cncf/automation/commit/49f2ad7a791a62ff7d038002bbb2b1f074eed5d5
147136
# run the tests however you normally do, then produce a JUnit XML file
148-
eatmydata -- go run test.go -docker=false -follow -shard backup_pitr_mysqlshell | tee -a output.txt | go-junit-report -set-exit-code > report.xml
137+
go run test.go -docker=false -follow -shard backup_pitr_mysqlshell | tee -a output.txt | go-junit-report -set-exit-code > report.xml
149138
150139
- name: Record test results in launchable if PR is not a draft
151140
if: github.event_name == 'pull_request' && github.event.pull_request.draft == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' && !cancelled()

0 commit comments

Comments
 (0)