From 89c198036b7eb1c210bd47543cecd9de59b40072 Mon Sep 17 00:00:00 2001 From: Gokhan Gulbiz Date: Wed, 25 Oct 2023 15:37:40 +0300 Subject: [PATCH 1/6] Initial commit for CircleCI to Github migration --- .github/workflows/cleanup.yml | 37 +++++++++++++++++++++++++++ .github/workflows/extension.yml | 39 +++++++++++++++++++++++++++++ .github/workflows/jdbc-tests.yml | 22 ++++++++++++++++ .github/workflows/pgbench-tests.yml | 39 +++++++++++++++++++++++++++++ .github/workflows/scale-tests.yml | 39 +++++++++++++++++++++++++++++ .github/workflows/tpch-tests.yml | 39 +++++++++++++++++++++++++++++ azure/citus-bot.sh | 5 ---- 7 files changed, 215 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/cleanup.yml create mode 100644 .github/workflows/extension.yml create mode 100644 .github/workflows/jdbc-tests.yml create mode 100644 .github/workflows/pgbench-tests.yml create mode 100644 .github/workflows/scale-tests.yml create mode 100644 .github/workflows/tpch-tests.yml diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml new file mode 100644 index 00000000..56b7eeca --- /dev/null +++ b/.github/workflows/cleanup.yml @@ -0,0 +1,37 @@ +name: Cleanup Resource Group +on: + push: + branches: + - delete_resource_group/* +jobs: + delete_resource_group: + runs-on: ubuntu-latest + container: + image: buildpack-deps:bullseye + options: --user root + steps: + - uses: actions/checkout@v3.5.0 + - name: Fix ownership issues + run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Install Dependencies + run: |- + apt-get update && apt-get install -y cmake zip jq + apt-get install -y ca-certificates curl apt-transport-https lsb-release gnupg + curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null + AZ_REPO=$(lsb_release -cs) + echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | tee /etc/apt/sources.list.d/azure-cli.list + apt-get update + apt-get install -y azure-cli + - name: Login to Azure + run: |- + az login --service-principal \ + -u ${{ fromJson(secrets.AZURE_CREDENTIALS)['clientId']}} \ + -p ${{ fromJson(secrets.AZURE_CREDENTIALS)['clientSecret']}} \ + --tenant ${{ fromJson(secrets.AZURE_CREDENTIALS)['tenantId']}} + - name: Delete resource group + run: |- + mkdir ~/.ssh + cd ./azure + ./delete-resource-group-job.sh + shell: bash + diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml new file mode 100644 index 00000000..e5288d05 --- /dev/null +++ b/.github/workflows/extension.yml @@ -0,0 +1,39 @@ +name: Compatibility - Extension Tests +on: + push: + branches: + - extension/* +env: + RESULT_REPO_ACCESS_TOKEN: ${{ secrets.TEST_RESULTS_REPO_TOKEN }} +jobs: + extension: + runs-on: ubuntu-latest + container: + image: buildpack-deps:bullseye + options: --user root + steps: + - uses: actions/checkout@v3.5.0 + - name: Fix ownership issues + run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Install Dependencies + run: |- + apt-get update && apt-get install -y cmake zip jq + apt-get install -y ca-certificates curl apt-transport-https lsb-release gnupg + curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null + AZ_REPO=$(lsb_release -cs) + echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | tee /etc/apt/sources.list.d/azure-cli.list + apt-get update + apt-get install -y azure-cli + - name: Login to Azure + run: |- + az login --service-principal \ + -u ${{ fromJson(secrets.AZURE_CREDENTIALS)['clientId']}} \ + -p ${{ fromJson(secrets.AZURE_CREDENTIALS)['clientSecret']}} \ + --tenant ${{ fromJson(secrets.AZURE_CREDENTIALS)['tenantId']}} + - name: Run extension tests + run: |- + mkdir ~/.ssh + cd ./azure + export EXTENSION_TEST=1 + ./citus-bot.sh citusbot_extension_test_resource_group + shell: bash \ No newline at end of file diff --git a/.github/workflows/jdbc-tests.yml b/.github/workflows/jdbc-tests.yml new file mode 100644 index 00000000..7db24c79 --- /dev/null +++ b/.github/workflows/jdbc-tests.yml @@ -0,0 +1,22 @@ +name: Compatibility Tests - JDBC +on: + push: + branches: + - jdbc/* +env: + RESULT_REPO_ACCESS_TOKEN: ${{ secrets.TEST_RESULTS_REPO_TOKEN }} +jobs: + jdbc: + runs-on: ubuntu-latest + container: + image: buildpack-deps:focal + options: --user root + steps: + - uses: actions/checkout@v3.5.0 + - name: Fix ownership issues + run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Run JDBC compatibility tests + run: |- + cd ./jdbc + ./run_jdbc_tests.sh + shell: bash \ No newline at end of file diff --git a/.github/workflows/pgbench-tests.yml b/.github/workflows/pgbench-tests.yml new file mode 100644 index 00000000..b8f0d0ec --- /dev/null +++ b/.github/workflows/pgbench-tests.yml @@ -0,0 +1,39 @@ +name: Performance Tests - PgBench +on: + push: + branches: + - pgbench/* + - all_performance_test/* +env: + RESULT_REPO_ACCESS_TOKEN: ${{ secrets.TEST_RESULTS_REPO_TOKEN }} +jobs: + tpch: + runs-on: ubuntu-latest + container: + image: buildpack-deps:bullseye + options: --user root + steps: + - uses: actions/checkout@v3.5.0 + - name: Fix ownership issues + run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Install Dependencies + run: |- + apt-get update && apt-get install -y cmake zip jq + apt-get install -y ca-certificates curl apt-transport-https lsb-release gnupg + curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null + AZ_REPO=$(lsb_release -cs) + echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | tee /etc/apt/sources.list.d/azure-cli.list + apt-get update + apt-get install -y azure-cli + - name: Login to Azure + run: |- + az login --service-principal \ + -u ${{ fromJson(secrets.AZURE_CREDENTIALS)['clientId']}} \ + -p ${{ fromJson(secrets.AZURE_CREDENTIALS)['clientSecret']}} \ + --tenant ${{ fromJson(secrets.AZURE_CREDENTIALS)['tenantId']}} + - name: Run pgbench tests + run: |- + mkdir ~/.ssh + cd ./azure + ./citus-bot.sh citusbot_pgbench_test_resource_group + shell: bash \ No newline at end of file diff --git a/.github/workflows/scale-tests.yml b/.github/workflows/scale-tests.yml new file mode 100644 index 00000000..c8c47530 --- /dev/null +++ b/.github/workflows/scale-tests.yml @@ -0,0 +1,39 @@ +name: Performance Tests - Scale +on: + push: + branches: + - scale/* + - all_performance_test/* +env: + RESULT_REPO_ACCESS_TOKEN: ${{ secrets.TEST_RESULTS_REPO_TOKEN }} +jobs: + tpch: + runs-on: ubuntu-latest + container: + image: buildpack-deps:bullseye + options: --user root + steps: + - uses: actions/checkout@v3.5.0 + - name: Fix ownership issues + run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Install Dependencies + run: |- + apt-get update && apt-get install -y cmake zip jq + apt-get install -y ca-certificates curl apt-transport-https lsb-release gnupg + curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null + AZ_REPO=$(lsb_release -cs) + echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | tee /etc/apt/sources.list.d/azure-cli.list + apt-get update + apt-get install -y azure-cli + - name: Login to Azure + run: |- + az login --service-principal \ + -u ${{ fromJson(secrets.AZURE_CREDENTIALS)['clientId']}} \ + -p ${{ fromJson(secrets.AZURE_CREDENTIALS)['clientSecret']}} \ + --tenant ${{ fromJson(secrets.AZURE_CREDENTIALS)['tenantId']}} + - name: Run scale tests + run: |- + mkdir ~/.ssh + cd ./azure + ./citus-bot.sh citusbot_scale_test_resource_group + shell: bash diff --git a/.github/workflows/tpch-tests.yml b/.github/workflows/tpch-tests.yml new file mode 100644 index 00000000..6a576210 --- /dev/null +++ b/.github/workflows/tpch-tests.yml @@ -0,0 +1,39 @@ +name: Performance Tests - TPCH +on: + push: + branches: + - tpch/* + - all_performance_test/* +env: + RESULT_REPO_ACCESS_TOKEN: ${{ secrets.TEST_RESULTS_REPO_TOKEN }} +jobs: + tpch: + runs-on: ubuntu-latest + container: + image: buildpack-deps:bullseye + options: --user root + steps: + - uses: actions/checkout@v3.5.0 + - name: Fix ownership issues + run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Install Dependencies + run: |- + apt-get update && apt-get install -y cmake zip jq + apt-get install -y ca-certificates curl apt-transport-https lsb-release gnupg + curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null + AZ_REPO=$(lsb_release -cs) + echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | tee /etc/apt/sources.list.d/azure-cli.list + apt-get update + apt-get install -y azure-cli + - name: Login to Azure + run: |- + az login --service-principal \ + -u ${{ fromJson(secrets.AZURE_CREDENTIALS)['clientId']}} \ + -p ${{ fromJson(secrets.AZURE_CREDENTIALS)['clientSecret']}} \ + --tenant ${{ fromJson(secrets.AZURE_CREDENTIALS)['tenantId']}} + - name: Run tpch tests + run: |- + mkdir ~/.ssh + cd ./azure + ./citus-bot.sh citusbot_tpch_test_resource_group + shell: bash diff --git a/azure/citus-bot.sh b/azure/citus-bot.sh index fce4567d..0cb5de9d 100755 --- a/azure/citus-bot.sh +++ b/azure/citus-bot.sh @@ -16,11 +16,6 @@ eval `ssh-agent -s` # add key for azure VM ssh-add ~/.ssh/vm-key -# add the the default key in order to forward it with -# ssh agent forwarding to allow the Azure VM-s to pull the -# test automation repo -ssh-add - function cleanup { sh ./delete-resource-group.sh } From 4d1d7832e197d502a26c9313406a37797bd7ef14 Mon Sep 17 00:00:00 2001 From: Gokhan Gulbiz Date: Wed, 25 Oct 2023 15:37:53 +0300 Subject: [PATCH 2/6] Disable CircleCI --- .circleci/config.yml | 147 ------------------------------------------- 1 file changed, 147 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index be217633..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,147 +0,0 @@ -version: 2.1 -jobs: - pgbench: - docker: - - image: buildpack-deps:bullseye - working_directory: /home/circleci/project - steps: - - azure-cli/install - - azure-cli/login-with-service-principal - - checkout - - run: - command: | - cd ./azure - ./citus-bot.sh citusbot_pgbench_test_resource_group - name: install dependencies and run pgbench tests - no_output_timeout: 10m - - scale: - docker: - - image: buildpack-deps:bullseye - working_directory: /home/circleci/project - steps: - - azure-cli/install - - azure-cli/login-with-service-principal - - checkout - - add_ssh_keys: - fingerprints: - - "55:5b:db:88:e2:e4:00:87:bc:55:c2:11:52:67:d9:0d" - - run: - command: | - cd ./azure - ./citus-bot.sh citusbot_scale_test_resource_group - name: install dependencies and run scale tests - no_output_timeout: 10m - - tpch: - docker: - - image: buildpack-deps:bullseye - working_directory: /home/circleci/project - steps: - - azure-cli/install - - azure-cli/login-with-service-principal - - checkout - - add_ssh_keys: - fingerprints: - - "55:5b:db:88:e2:e4:00:87:bc:55:c2:11:52:67:d9:0d" - - run: - command: | - cd ./azure - ./citus-bot.sh citusbot_tpch_test_resource_group - name: install dependencies and run tpch tests - no_output_timeout: 10m - - jdbc: - docker: - - image: buildpack-deps:focal - working_directory: /home/circleci/project - steps: - - checkout - - run: - command: | - cd ./jdbc - ./run_jdbc_tests.sh - name: install dependencies and run jdbc compatibility tests - no_output_timeout: 10m - - extension: - docker: - - image: buildpack-deps:bullseye - working_directory: /home/circleci/project - steps: - - azure-cli/install - - azure-cli/login-with-service-principal - - checkout - - add_ssh_keys: - fingerprints: - - "55:5b:db:88:e2:e4:00:87:bc:55:c2:11:52:67:d9:0d" - - run: - command: | - cd ./azure - export EXTENSION_TEST=1 - ./citus-bot.sh citusbot_extension_test_resource_group - name: install dependencies and run extension tests - no_output_timeout: 10m - - delete_resource_group: - docker: - - image: buildpack-deps:bullseye - working_directory: /home/circleci/project - steps: - - azure-cli/install - - azure-cli/login-with-service-principal - - checkout - - run: - command: | - cd ./azure - ./delete-resource-group-job.sh - name: delete the given resource group - no_output_timeout: 10m - -orbs: - azure-cli: circleci/azure-cli@1.0.0 - -workflows: - version: 2 - - cleanup: - jobs: - - delete_resource_group: - filters: - branches: - only: - - /delete_resource_group\/.*/ # match with delete_resource_group/ prefix - - performance-tests: - jobs: - - pgbench: - filters: - branches: - only: - - /pgbench\/.*/ # match with pgbench/ prefix - - /all_performance_test\/.*/ # match with all_performance_test/ prefix - - scale: - filters: - branches: - only: - - /scale\/.*/ # match with scale/ prefix - - /all_performance_test\/.*/ # match with all_performance_test/ prefix - - tpch: - filters: - branches: - only: - - /tpch\/.*/ # match with tpch/ prefix - - /all_performance_test\/.*/ # match with all_performance_test/ prefix - - compatibility-tests: - jobs: - - jdbc: - filters: - branches: - only: - - /jdbc\/.*/ # match with jdbc prefix - - extension: - filters: - branches: - only: - - /extension\/.*/ # match with extension prefix From 7d18ea00682c2d3b5826561ca8c0a7192708f8d2 Mon Sep 17 00:00:00 2001 From: Gokhan Gulbiz Date: Wed, 8 Nov 2023 11:24:30 +0300 Subject: [PATCH 3/6] Adjust new lines at the end of file --- .github/workflows/cleanup.yml | 2 +- .github/workflows/extension.yml | 3 ++- .github/workflows/jdbc-tests.yml | 3 ++- .github/workflows/pgbench-tests.yml | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index 56b7eeca..dff8b519 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -34,4 +34,4 @@ jobs: cd ./azure ./delete-resource-group-job.sh shell: bash - + \ No newline at end of file diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index e5288d05..6ab64b2c 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -36,4 +36,5 @@ jobs: cd ./azure export EXTENSION_TEST=1 ./citus-bot.sh citusbot_extension_test_resource_group - shell: bash \ No newline at end of file + shell: bash + \ No newline at end of file diff --git a/.github/workflows/jdbc-tests.yml b/.github/workflows/jdbc-tests.yml index 7db24c79..98823367 100644 --- a/.github/workflows/jdbc-tests.yml +++ b/.github/workflows/jdbc-tests.yml @@ -19,4 +19,5 @@ jobs: run: |- cd ./jdbc ./run_jdbc_tests.sh - shell: bash \ No newline at end of file + shell: bash + \ No newline at end of file diff --git a/.github/workflows/pgbench-tests.yml b/.github/workflows/pgbench-tests.yml index b8f0d0ec..1a60c1a2 100644 --- a/.github/workflows/pgbench-tests.yml +++ b/.github/workflows/pgbench-tests.yml @@ -36,4 +36,5 @@ jobs: mkdir ~/.ssh cd ./azure ./citus-bot.sh citusbot_pgbench_test_resource_group - shell: bash \ No newline at end of file + shell: bash + \ No newline at end of file From e7eabd9f70874eda634b68030939d204523be5ff Mon Sep 17 00:00:00 2001 From: Gokhan Gulbiz Date: Tue, 14 Nov 2023 11:37:41 +0300 Subject: [PATCH 4/6] Minor naming & new line refactorings. --- .github/workflows/cleanup.yml | 1 - .github/workflows/extension.yml | 2 +- .github/workflows/pgbench-tests.yml | 2 +- .github/workflows/scale-tests.yml | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index dff8b519..443ed5e4 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -34,4 +34,3 @@ jobs: cd ./azure ./delete-resource-group-job.sh shell: bash - \ No newline at end of file diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index 6ab64b2c..d4ad726e 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -1,4 +1,4 @@ -name: Compatibility - Extension Tests +name: Compatibility Tests - Extension on: push: branches: diff --git a/.github/workflows/pgbench-tests.yml b/.github/workflows/pgbench-tests.yml index 1a60c1a2..92207f1f 100644 --- a/.github/workflows/pgbench-tests.yml +++ b/.github/workflows/pgbench-tests.yml @@ -7,7 +7,7 @@ on: env: RESULT_REPO_ACCESS_TOKEN: ${{ secrets.TEST_RESULTS_REPO_TOKEN }} jobs: - tpch: + pgbench: runs-on: ubuntu-latest container: image: buildpack-deps:bullseye diff --git a/.github/workflows/scale-tests.yml b/.github/workflows/scale-tests.yml index c8c47530..2e110057 100644 --- a/.github/workflows/scale-tests.yml +++ b/.github/workflows/scale-tests.yml @@ -7,7 +7,7 @@ on: env: RESULT_REPO_ACCESS_TOKEN: ${{ secrets.TEST_RESULTS_REPO_TOKEN }} jobs: - tpch: + scale: runs-on: ubuntu-latest container: image: buildpack-deps:bullseye From 731e4c1152d9ffaa7b2e6962a2d12f89358553aa Mon Sep 17 00:00:00 2001 From: Gokhan Gulbiz Date: Tue, 14 Nov 2023 11:53:04 +0300 Subject: [PATCH 5/6] Minor renamings. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9a42f520..18cc7931 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ If your subscriptions list doesn't contain `Azure SQL DB Project Orcas - CitusDa ssh-add ``` -5. You should setup your VPN to be able to connect to Azure VM-s if your tests are not running on CircleCI. Doing this as of latest consists of: +5. You should setup your VPN to be able to connect to Azure VM-s if your tests are not running on GHA. Doing this as of latest consists of: * Open your VPN. * Run `routes.ps1` (on Windows only, if you are developing on Mac you should probably ping smn from the team for help). The script requires `python` to be installed to run. @@ -360,7 +360,7 @@ be lifted in the future. # Running Tests ## Running Automated Tests -**Depending of the tests you trigger here, you can block at most 3 jobs slots in circleci for around 3 hours. Choose wisely the time you want to run the tests to not block development** +**Depending of the tests you trigger here, you can block at most 3 jobs slots in GHA for around 3 hours. Choose wisely the time you want to run the tests to not block development** If you want, you can run trigger a job which can run pgbench, scale, tpch and extension tests. What the job does is: @@ -377,7 +377,7 @@ There is a separate job for each test and you can run any combinations of them. * If the branch has a prefix `all_performance_test/`, then all jobs will be triggered. * If the branch has a prefix `extension/`, then extension job will be triggered. -You should push your branch to Github so that the circleci job will be triggerred. +You should push your branch to Github so that the GHA job will be triggerred. Each job uses a specific resource group name so that there will be at most 3 resource groups for these jobs. If there is already a resource group, then you should make sure that: From 01f083a5662bda381e85f5c31a8598a551982cca Mon Sep 17 00:00:00 2001 From: Gokhan Gulbiz Date: Fri, 17 Nov 2023 19:34:13 +0300 Subject: [PATCH 6/6] Fix eols --- .github/workflows/extension.yml | 1 - .github/workflows/jdbc-tests.yml | 1 - .github/workflows/pgbench-tests.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index d4ad726e..81462daa 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -37,4 +37,3 @@ jobs: export EXTENSION_TEST=1 ./citus-bot.sh citusbot_extension_test_resource_group shell: bash - \ No newline at end of file diff --git a/.github/workflows/jdbc-tests.yml b/.github/workflows/jdbc-tests.yml index 98823367..954622a7 100644 --- a/.github/workflows/jdbc-tests.yml +++ b/.github/workflows/jdbc-tests.yml @@ -20,4 +20,3 @@ jobs: cd ./jdbc ./run_jdbc_tests.sh shell: bash - \ No newline at end of file diff --git a/.github/workflows/pgbench-tests.yml b/.github/workflows/pgbench-tests.yml index 92207f1f..90bace91 100644 --- a/.github/workflows/pgbench-tests.yml +++ b/.github/workflows/pgbench-tests.yml @@ -37,4 +37,3 @@ jobs: cd ./azure ./citus-bot.sh citusbot_pgbench_test_resource_group shell: bash - \ No newline at end of file