|
| 1 | +# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows" |
| 2 | + |
| 3 | +name: Cluster (backup_pitr_xtrabackup) mysql57 |
| 4 | +on: [push, pull_request] |
| 5 | +concurrency: |
| 6 | + group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (backup_pitr_xtrabackup) mysql57') |
| 7 | + cancel-in-progress: true |
| 8 | + |
| 9 | +permissions: read-all |
| 10 | + |
| 11 | +env: |
| 12 | + LAUNCHABLE_ORGANIZATION: "vitess" |
| 13 | + LAUNCHABLE_WORKSPACE: "vitess-app" |
| 14 | + GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}" |
| 15 | + |
| 16 | + # This is used if we need to pin the xtrabackup version used in tests. |
| 17 | + # If this is NOT set then the latest version available will be used. |
| 18 | + #XTRABACKUP_VERSION: "2.4.24-1" |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + name: Run endtoend tests on Cluster (backup_pitr_xtrabackup) mysql57 |
| 23 | + runs-on: ubuntu-22.04 |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Skip CI |
| 27 | + run: | |
| 28 | + if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then |
| 29 | + echo "skipping CI due to the 'Skip CI' label" |
| 30 | + exit 1 |
| 31 | + fi |
| 32 | +
|
| 33 | + - name: Check if workflow needs to be skipped |
| 34 | + id: skip-workflow |
| 35 | + run: | |
| 36 | + skip='false' |
| 37 | + if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then |
| 38 | + skip='true' |
| 39 | + fi |
| 40 | + echo Skip ${skip} |
| 41 | + echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT |
| 42 | +
|
| 43 | + - name: Check out code |
| 44 | + if: steps.skip-workflow.outputs.skip-workflow == 'false' |
| 45 | + uses: actions/checkout@v3 |
| 46 | + |
| 47 | + - name: Check for changes in relevant files |
| 48 | + if: steps.skip-workflow.outputs.skip-workflow == 'false' |
| 49 | + uses: frouioui/paths-filter@main |
| 50 | + id: changes |
| 51 | + with: |
| 52 | + token: '' |
| 53 | + filters: | |
| 54 | + end_to_end: |
| 55 | + - 'go/**/*.go' |
| 56 | + - 'test.go' |
| 57 | + - 'Makefile' |
| 58 | + - 'build.env' |
| 59 | + - 'go.sum' |
| 60 | + - 'go.mod' |
| 61 | + - 'proto/*.proto' |
| 62 | + - 'tools/**' |
| 63 | + - 'config/**' |
| 64 | + - 'bootstrap.sh' |
| 65 | + - '.github/workflows/cluster_endtoend_backup_pitr_xtrabackup_mysql57.yml' |
| 66 | +
|
| 67 | + - name: Set up Go |
| 68 | + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' |
| 69 | + uses: actions/setup-go@v4 |
| 70 | + with: |
| 71 | + go-version: 1.20.5 |
| 72 | + |
| 73 | + - name: Set up python |
| 74 | + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' |
| 75 | + uses: actions/setup-python@v4 |
| 76 | + |
| 77 | + - name: Tune the OS |
| 78 | + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' |
| 79 | + run: | |
| 80 | + sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535" |
| 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 | + - name: Get dependencies |
| 86 | + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' |
| 87 | + run: | |
| 88 | + sudo apt-get update |
| 89 | +
|
| 90 | + # Uninstall any previously installed MySQL first |
| 91 | + sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ |
| 92 | + sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld |
| 93 | +
|
| 94 | + sudo systemctl stop apparmor |
| 95 | + sudo DEBIAN_FRONTEND="noninteractive" apt-get remove -y --purge mysql-server mysql-client mysql-common |
| 96 | + sudo apt-get -y autoremove |
| 97 | + sudo apt-get -y autoclean |
| 98 | + sudo deluser mysql |
| 99 | + sudo rm -rf /var/lib/mysql |
| 100 | + sudo rm -rf /etc/mysql |
| 101 | +
|
| 102 | + # Get key to latest MySQL repo |
| 103 | + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 |
| 104 | +
|
| 105 | + wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.24-1_all.deb |
| 106 | + # Bionic packages are still compatible for Jammy since there's no MySQL 5.7 |
| 107 | + # packages for Jammy. |
| 108 | + echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections |
| 109 | + echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections |
| 110 | + sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* |
| 111 | + sudo apt-get update |
| 112 | + sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5 |
| 113 | +
|
| 114 | + sudo apt-get install -y make unzip g++ etcd curl git wget eatmydata |
| 115 | + sudo service mysql stop |
| 116 | + sudo service etcd stop |
| 117 | +
|
| 118 | + # install JUnit report formatter |
| 119 | + go install github.com/vitessio/go-junit-report@HEAD |
| 120 | +
|
| 121 | + wget "https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb" |
| 122 | + sudo apt-get install -y gnupg2 |
| 123 | + sudo dpkg -i "percona-release_latest.$(lsb_release -sc)_all.deb" |
| 124 | + sudo apt-get update |
| 125 | + if [[ -n $XTRABACKUP_VERSION ]]; then |
| 126 | + debfile="percona-xtrabackup-24_$XTRABACKUP_VERSION.$(lsb_release -sc)_amd64.deb" |
| 127 | + wget "https://repo.percona.com/pxb-24/apt/pool/main/p/percona-xtrabackup-24/$debfile" |
| 128 | + sudo apt install -y "./$debfile" |
| 129 | + else |
| 130 | + sudo apt-get install -y percona-xtrabackup-24 |
| 131 | + fi |
| 132 | +
|
| 133 | + - name: Setup launchable dependencies |
| 134 | + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' |
| 135 | + run: | |
| 136 | + # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up |
| 137 | + pip3 install --user launchable~=1.0 > /dev/null |
| 138 | +
|
| 139 | + # verify that launchable setup is all correct. |
| 140 | + launchable verify || true |
| 141 | +
|
| 142 | + # Tell Launchable about the build you are producing and testing |
| 143 | + launchable record build --name "$GITHUB_RUN_ID" --source . |
| 144 | +
|
| 145 | + - name: Run cluster endtoend test |
| 146 | + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' |
| 147 | + timeout-minutes: 45 |
| 148 | + run: | |
| 149 | + # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file |
| 150 | + # which musn't be more than 107 characters long. |
| 151 | + export VTDATAROOT="/tmp/" |
| 152 | + source build.env |
| 153 | +
|
| 154 | + set -x |
| 155 | +
|
| 156 | + # run the tests however you normally do, then produce a JUnit XML file |
| 157 | + eatmydata -- go run test.go -docker=false -follow -shard backup_pitr_xtrabackup | tee -a output.txt | go-junit-report -set-exit-code > report.xml |
| 158 | +
|
| 159 | + - name: Print test output and Record test result in launchable |
| 160 | + if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always() |
| 161 | + run: | |
| 162 | + # send recorded tests to launchable |
| 163 | + launchable record tests --build "$GITHUB_RUN_ID" go-test . || true |
| 164 | +
|
| 165 | + # print test output |
| 166 | + cat output.txt |
0 commit comments