From a4016d4b3541a08c2e026697e3dd06e808f050d8 Mon Sep 17 00:00:00 2001 From: MyroTk <44327070+MyroTk@users.noreply.github.com> Date: Thu, 16 May 2024 00:06:56 -0700 Subject: [PATCH 1/9] Update release_branches.yml --- .github/workflows/release_branches.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release_branches.yml b/.github/workflows/release_branches.yml index ec89c8b5400a..217b3490a164 100644 --- a/.github/workflows/release_branches.yml +++ b/.github/workflows/release_branches.yml @@ -26,6 +26,8 @@ on: # yamllint disable-line rule:truthy push: branches: - 'releases/23.3**' + schedule: + - cron: "0 0 * * 6" jobs: DockerHubPushAarch64: From 26d4893dbcb118a4ef0f8e890492bfc494e3a3ed Mon Sep 17 00:00:00 2001 From: MyroTk <44327070+MyroTk@users.noreply.github.com> Date: Mon, 20 May 2024 09:49:22 -0700 Subject: [PATCH 2/9] Update release_branches.yml --- .github/workflows/release_branches.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release_branches.yml b/.github/workflows/release_branches.yml index 217b3490a164..f4b44b108ccd 100644 --- a/.github/workflows/release_branches.yml +++ b/.github/workflows/release_branches.yml @@ -43,7 +43,7 @@ jobs: cd "$GITHUB_WORKSPACE/tests/ci" python3 docker_images_check.py --suffix aarch64 - name: Upload images files to artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: changed_images_aarch64 path: ${{ runner.temp }}/docker_images_check/changed_images_aarch64.json @@ -61,7 +61,7 @@ jobs: cd "$GITHUB_WORKSPACE/tests/ci" python3 docker_images_check.py --suffix amd64 - name: Upload images files to artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: changed_images_amd64 path: ${{ runner.temp }}/docker_images_check/changed_images_amd64.json @@ -84,13 +84,13 @@ jobs: DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - name: Download changed aarch64 images - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: changed_images_aarch64 path: ${{ runner.temp }} - name: Download changed amd64 images - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: changed_images_amd64 path: ${{ runner.temp }} @@ -101,7 +101,7 @@ jobs: python3 docker_manifests_merge.py --suffix amd64 --suffix aarch64 - name: Upload images files to artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: changed_images path: ${{ runner.temp }}/changed_images.json @@ -657,9 +657,9 @@ jobs: run: | sudo rm -fr "$GITHUB_WORKSPACE" && mkdir "$GITHUB_WORKSPACE" - name: Check out repository code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Download json reports - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: path: ${{ env.REPORTS_PATH }} - name: Sign release @@ -671,7 +671,7 @@ jobs: cd "$GITHUB_WORKSPACE/tests/ci" python3 sign_release.py - name: Upload signed hashes - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: signed-hashes path: ${{ env.TEMP_PATH }}/*.gpg From df613ccb59d73ea006d2b4599eb959ded7610660 Mon Sep 17 00:00:00 2001 From: MyroTk Date: Mon, 20 May 2024 09:54:55 -0700 Subject: [PATCH 3/9] use v4 actions --- .github/workflows/regression.yml | 48 ++++++++++++++-------------- .github/workflows/reusable_build.yml | 6 ++-- .github/workflows/reusable_test.yml | 2 +- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index d8f68a513f41..f97ef2a1e295 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -147,7 +147,7 @@ jobs: timeout-minutes: ${{ inputs.timeout_minutes }} steps: - name: Checkout regression repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: Altinity/clickhouse-regression ref: ${{ inputs.commit }} @@ -158,7 +158,7 @@ jobs: SUITE=${{ matrix.SUITE }} EOF - name: Download json reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: ${{ env.REPORTS_PATH }} name: build_report_package_${{ inputs.arch }} @@ -175,7 +175,7 @@ jobs: - name: Create and upload logs if: always() run: .github/create_and_upload_logs.sh 1 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: ${{ env.SUITE }}-${{ inputs.arch }}-artifacts @@ -191,7 +191,7 @@ jobs: timeout-minutes: ${{ inputs.timeout_minutes }} steps: - name: Checkout regression repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: Altinity/clickhouse-regression ref: ${{ inputs.commit }} @@ -203,7 +203,7 @@ jobs: STORAGE=/${{ matrix.STORAGE }} EOF - name: Download json reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: ${{ env.REPORTS_PATH }} name: build_report_package_${{ inputs.arch }} @@ -228,7 +228,7 @@ jobs: - name: Create and upload logs if: always() run: .github/create_and_upload_logs.sh 1 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: benchmark-${{ matrix.STORAGE }}-${{ inputs.arch }}-artifacts @@ -240,7 +240,7 @@ jobs: timeout-minutes: ${{ inputs.timeout_minutes }} steps: - name: Checkout regression repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: Altinity/clickhouse-regression ref: ${{ inputs.commit }} @@ -252,7 +252,7 @@ jobs: STORAGE=/ssl EOF - name: Download json reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: ${{ env.REPORTS_PATH }} name: build_report_package_${{ inputs.arch }} @@ -270,7 +270,7 @@ jobs: - name: Create and upload logs if: always() run: .github/create_and_upload_logs.sh 1 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: ${{ env.SUITE }}-${{ inputs.arch }}-ssl-artifacts @@ -286,7 +286,7 @@ jobs: timeout-minutes: ${{ inputs.timeout_minutes }} steps: - name: Checkout regression repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: Altinity/clickhouse-regression ref: ${{ inputs.commit }} @@ -297,7 +297,7 @@ jobs: SUITE=ldap/${{ matrix.SUITE }} EOF - name: Download json reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: ${{ env.REPORTS_PATH }} name: build_report_package_${{ inputs.arch }} @@ -314,7 +314,7 @@ jobs: - name: Create and upload logs if: always() run: .github/create_and_upload_logs.sh 1 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: ldap-${{ matrix.SUITE }}-${{ inputs.arch }}-artifacts @@ -326,7 +326,7 @@ jobs: timeout-minutes: ${{ inputs.timeout_minutes }} steps: - name: Checkout regression repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: Altinity/clickhouse-regression ref: ${{ inputs.commit }} @@ -337,7 +337,7 @@ jobs: SUITE=parquet EOF - name: Download json reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: ${{ env.REPORTS_PATH }} name: build_report_package_${{ inputs.arch }} @@ -354,7 +354,7 @@ jobs: - name: Create and upload logs if: always() run: .github/create_and_upload_logs.sh 1 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: ${{ env.SUITE }}-${{ inputs.arch }}-artifacts @@ -370,7 +370,7 @@ jobs: timeout-minutes: ${{ inputs.timeout_minutes }} steps: - name: Checkout regression repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: Altinity/clickhouse-regression ref: ${{ inputs.commit }} @@ -382,7 +382,7 @@ jobs: STORAGE=${{ matrix.STORAGE}} EOF - name: Download json reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: ${{ env.REPORTS_PATH }} name: build_report_package_${{ inputs.arch }} @@ -404,7 +404,7 @@ jobs: - name: Create and upload logs if: always() run: .github/create_and_upload_logs.sh 1 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: ${{ env.SUITE }}-${{ env.STORAGE }}-${{ inputs.arch }}-artifacts @@ -420,7 +420,7 @@ jobs: timeout-minutes: ${{ inputs.timeout_minutes }} steps: - name: Checkout regression repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: Altinity/clickhouse-regression ref: ${{ inputs.commit }} @@ -432,7 +432,7 @@ jobs: STORAGE=/${{ matrix.STORAGE }} EOF - name: Download json reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: ${{ env.REPORTS_PATH }} name: build_report_package_${{ inputs.arch }} @@ -457,7 +457,7 @@ jobs: - name: Create and upload logs if: always() run: .github/create_and_upload_logs.sh 1 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: ${{ env.SUITE }}-${{ matrix.STORAGE }}-${{ inputs.arch }}-artifacts @@ -473,7 +473,7 @@ jobs: timeout-minutes: ${{ inputs.timeout_minutes }} steps: - name: Checkout regression repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: Altinity/clickhouse-regression - name: Set envs @@ -484,7 +484,7 @@ jobs: STORAGE=/${{ matrix.STORAGE }} EOF - name: Download json reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: ${{ env.REPORTS_PATH }} name: build_report_package_${{ inputs.arch }} @@ -508,7 +508,7 @@ jobs: - name: Create and upload logs if: always() run: .github/create_and_upload_logs.sh 1 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: ${{ env.SUITE }}-${{ matrix.STORAGE }}-${{ inputs.arch }}-artifacts diff --git a/.github/workflows/reusable_build.yml b/.github/workflows/reusable_build.yml index 01dc27577974..aeff0d678941 100644 --- a/.github/workflows/reusable_build.yml +++ b/.github/workflows/reusable_build.yml @@ -131,7 +131,7 @@ jobs: DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - name: Download changed images - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: changed_images path: ${{ env.IMAGES_PATH }} @@ -141,14 +141,14 @@ jobs: mkdir -p "$TEMP_PATH/build_check/package_release" cd .. && tar czf $TEMP_PATH/build_source.src.tar.gz ClickHouse/ cd $TEMP_PATH && tar xvzf $TEMP_PATH/build_source.src.tar.gz - + - name: Build run: | cd "$REPO_COPY/tests/ci" && python3 build_check.py "$BUILD_NAME" - name: Upload build URLs to artifacts if: ${{ success() || failure() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.BUILD_URLS }} path: ${{ env.TEMP_PATH }}/${{ env.BUILD_URLS }}.json diff --git a/.github/workflows/reusable_test.yml b/.github/workflows/reusable_test.yml index c20f32bc9f88..d2d0bcc38248 100644 --- a/.github/workflows/reusable_test.yml +++ b/.github/workflows/reusable_test.yml @@ -155,7 +155,7 @@ jobs: job_type: test - name: Download json reports - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: ${{ env.REPORTS_PATH }} From 205a7c75e07ac3324fe0673121017da485190e18 Mon Sep 17 00:00:00 2001 From: MyroTk Date: Wed, 22 May 2024 05:14:45 -0700 Subject: [PATCH 4/9] introduce smaller runners for light jobs, and artifacts cleanup --- .github/workflows/release_branches.yml | 16 +++++++++------- .github/workflows/reusable_build.yml | 8 -------- .github/workflows/reusable_test.yml | 9 +-------- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release_branches.yml b/.github/workflows/release_branches.yml index f4b44b108ccd..ee3bda324385 100644 --- a/.github/workflows/release_branches.yml +++ b/.github/workflows/release_branches.yml @@ -112,7 +112,7 @@ jobs: secrets: inherit with: test_name: Compatibility check X86 - runner_type: altinity-on-demand, altinity-type-cpx41, altinity-image-x86-app-docker-ce + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-image-x86-app-docker-ce timeout_minutes: 180 run_command: | cd "$REPO_COPY/tests/ci" @@ -125,6 +125,7 @@ jobs: with: test_name: Compatibility check Aarch64 runner_type: altinity-on-demand, altinity-type-cax41, altinity-image-arm-app-docker-ce + timeout_minutes: 180 run_command: | cd "$REPO_COPY/tests/ci" python3 compatibility_check.py --check-name "Compatibility check (aarch64)" --check-glibc @@ -259,7 +260,7 @@ jobs: secrets: inherit with: test_name: ClickHouse build check - runner_type: altinity-on-demand, altinity-type-cpx41, altinity-image-x86-app-docker-ce + runner_type: altinity-on-demand, altinity-setup-reporter, altinity-type-cax11, altinity-image-x86-app-docker-ce timeout_minutes: 180 additional_envs: | NEEDS_DATA< Date: Wed, 22 May 2024 13:12:36 -0700 Subject: [PATCH 5/9] specify docker tag, minor fixes --- .github/workflows/regression.yml | 46 ++++++++++++++++++++++++ .github/workflows/release_branches.yml | 14 ++++---- .github/workflows/reusable_build.yml | 8 +++++ .github/workflows/reusable_test.yml | 8 +++++ tests/ci/ast_fuzzer_check.py | 2 +- tests/ci/build_check.py | 6 ++-- tests/ci/docs_check.py | 2 +- tests/ci/fast_test_check.py | 2 +- tests/ci/functional_test_check.py | 2 +- tests/ci/install_check.py | 4 +-- tests/ci/performance_comparison_check.py | 2 +- tests/ci/pr_info.py | 12 +++++-- tests/ci/sqlancer_check.py | 4 +-- tests/ci/stress_check.py | 2 +- tests/ci/style_check.py | 2 +- tests/ci/unit_tests_check.py | 2 +- 16 files changed, 94 insertions(+), 24 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index f97ef2a1e295..991b11a0a845 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -181,6 +181,52 @@ jobs: name: ${{ env.SUITE }}-${{ inputs.arch }}-artifacts path: ${{ env.artifact_paths}} + Alter: + strategy: + fail-fast: false + matrix: + ONLY: [replace, attach, move] + needs: [runner_labels_setup] + runs-on: ${{ fromJson(needs.runner_labels_setup.outputs.runner_labels) }} + timeout-minutes: ${{ inputs.timeout_minutes }} + steps: + - name: Checkout regression repo + uses: actions/checkout@v4 + with: + repository: Altinity/clickhouse-regression + ref: ${{ inputs.commit }} + - name: Set envs + run: | + cat >> "$GITHUB_ENV" << 'EOF' + REPORTS_PATH=${{ runner.temp }}/reports_dir + SUITE=alter + STORAGE=/${{ matrix.ONLY }}_partition + EOF + - name: Download json reports + uses: actions/download-artifact@v4 + with: + path: ${{ env.REPORTS_PATH }} + name: build_report_package_${{ inputs.arch }} + - name: Setup + run: .github/setup.sh + - name: Get deb url + run: python3 .github/get-deb-url.py --reports-path ${{ env.REPORTS_PATH }} --github-env $GITHUB_ENV + - name: Run ${{ env.SUITE }} suite + run: python3 + -u alter/regression.py + --clickhouse-binary-path ${{ env.clickhouse_binary_path }} + --only "/alter/${{ matrix.ONLY }} partition/*" + --attr project="$GITHUB_REPOSITORY" project.id="$GITHUB_REPOSITORY_ID" package="${{ env.clickhouse_binary_path }}" version="${{ env.version }}" user.name="$GITHUB_ACTOR" repository="https://github.com/Altinity/clickhouse-regression" commit.hash="$(git rev-parse HEAD)" job.id="$GITHUB_RUN_ID" job.url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" arch="$(uname -i)" + ${{ env.args }} + - name: Create and upload logs + if: always() + run: .github/create_and_upload_logs.sh 1 + - uses: actions/upload-artifact@v4 + if: always() + with: + name: ${{ env.SUITE }}-${{ env.ONLY }}_partition-${{ inputs.arch }}-artifacts + path: ${{ env.artifact_paths}} + Benchmark: strategy: fail-fast: false diff --git a/.github/workflows/release_branches.yml b/.github/workflows/release_branches.yml index ee3bda324385..82942d682a9c 100644 --- a/.github/workflows/release_branches.yml +++ b/.github/workflows/release_branches.yml @@ -68,7 +68,7 @@ jobs: DockerHubPush: needs: [DockerHubPushAmd64, DockerHubPushAarch64] - runs-on: [self-hosted, altinity-on-demand, altinity-type-cpx41, altinity-image-x86-app-docker-ce] + runs-on: [self-hosted, altinity-on-demand, altinity-type-cpx51, altinity-image-x86-app-docker-ce] steps: - name: Check out repository code uses: Altinity/checkout@19599efdf36c4f3f30eb55d5bb388896faea69f6 @@ -260,7 +260,7 @@ jobs: secrets: inherit with: test_name: ClickHouse build check - runner_type: altinity-on-demand, altinity-setup-reporter, altinity-type-cax11, altinity-image-x86-app-docker-ce + runner_type: altinity-on-demand, altinity-setup-reporter, altinity-type-cax11, altinity-image-arm-app-docker-ce timeout_minutes: 180 additional_envs: | NEEDS_DATA< bool: args.check_name, ) - ch_helper.insert_events_into(db="default", table="checks", events=prepared_events) + ch_helper.insert_events_into(db="gh-data", table="checks", events=prepared_events) if state == FAILURE: sys.exit(1) diff --git a/tests/ci/performance_comparison_check.py b/tests/ci/performance_comparison_check.py index 83b47a16de5f..b4ce9757ea8e 100644 --- a/tests/ci/performance_comparison_check.py +++ b/tests/ci/performance_comparison_check.py @@ -121,7 +121,7 @@ def main(): .replace("/", "_") ) - docker_image = get_image_with_version(reports_path, IMAGE_NAME) + docker_image = get_image_with_version(reports_path, IMAGE_NAME, version=pr_info.docker_image_tag) result_path = temp_path / "result" result_path.mkdir(parents=True, exist_ok=True) diff --git a/tests/ci/pr_info.py b/tests/ci/pr_info.py index 7208fdc0f324..18497ab84116 100644 --- a/tests/ci/pr_info.py +++ b/tests/ci/pr_info.py @@ -13,6 +13,10 @@ GITHUB_RUN_URL, GITHUB_EVENT_PATH, ) +from version_helper import ( + Git, + get_version_from_repo, +) FORCE_TESTS_LABEL = "force tests" SKIP_MERGEABLE_CHECK_LABEL = "skip mergeable check" @@ -36,7 +40,7 @@ ".json", ] RETRY_SLEEP = 0 - +VERSION = get_version_from_repo(git=Git(True)) def get_pr_for_commit(sha, ref): if not ref: @@ -115,6 +119,7 @@ def __init__( if "pull_request" in github_event: # pull request and other similar events self.number = github_event["pull_request"]["number"] # type: int + self.docker_image_tag = str(self.number) # type: str if pr_event_from_api: try: response = get_gh_api( @@ -191,6 +196,7 @@ def __init__( if pull_request is None or pull_request["state"] == "closed": # it's merged PR to master self.number = 0 + self.docker_image_tag = str(self.number) + "-" + str(self.sha) self.labels = set() self.pr_html_url = f"{repo_prefix}/commits/{ref}" self.base_ref = ref @@ -202,6 +208,7 @@ def __init__( ) else: self.number = pull_request["number"] + self.docker_image_tag = str(self.number) self.labels = {label["name"] for label in pull_request["labels"]} self.base_ref = pull_request["base"]["ref"] @@ -247,7 +254,8 @@ def __init__( self.sha = os.getenv( "GITHUB_SHA", "0000000000000000000000000000000000000000" ) - self.number = 0 + self.number = f"{VERSION.major}.{VERSION.minor}.{VERSION.patch}" + self.docker_image_tag = str(self.number) + "-" + str(self.sha) self.labels = set() repo_prefix = f"{GITHUB_SERVER_URL}/{GITHUB_REPOSITORY}" self.task_url = GITHUB_RUN_URL diff --git a/tests/ci/sqlancer_check.py b/tests/ci/sqlancer_check.py index 1da36e7e5165..5712547355f9 100644 --- a/tests/ci/sqlancer_check.py +++ b/tests/ci/sqlancer_check.py @@ -65,7 +65,7 @@ def main(): logging.info("Check is already finished according to github status, exiting") sys.exit(0) - docker_image = get_image_with_version(reports_path, IMAGE_NAME) + docker_image = get_image_with_version(reports_path, IMAGE_NAME, version=pr_info.docker_image_tag) build_name = get_build_name_for_check(check_name) urls = read_build_urls(build_name, reports_path) @@ -160,7 +160,7 @@ def main(): report_url, check_name, ) - ch_helper.insert_events_into(db="default", table="checks", events=prepared_events) + ch_helper.insert_events_into(db="gh-data", table="checks", events=prepared_events) if __name__ == "__main__": diff --git a/tests/ci/stress_check.py b/tests/ci/stress_check.py index 23b99fecd46e..2d2863873a34 100644 --- a/tests/ci/stress_check.py +++ b/tests/ci/stress_check.py @@ -122,7 +122,7 @@ def run_stress_test(docker_image_name: str) -> None: logging.info("Check is already finished according to github status, exiting") sys.exit(0) - docker_image = get_image_with_version(reports_path, docker_image_name) + docker_image = get_image_with_version(reports_path, docker_image_name, version=pr_info.docker_image_tag) packages_path = temp_path / "packages" packages_path.mkdir(parents=True, exist_ok=True) diff --git a/tests/ci/style_check.py b/tests/ci/style_check.py index ec707bea22b9..9e40134d57a9 100644 --- a/tests/ci/style_check.py +++ b/tests/ci/style_check.py @@ -164,7 +164,7 @@ def main(): code = int(state != "success") sys.exit(code) - docker_image = get_image_with_version(reports_path, "altinityinfra/style-test") + docker_image = get_image_with_version(reports_path, "altinityinfra/style-test", version=pr_info.docker_image_tag) s3_helper = S3Helper() cmd = ( diff --git a/tests/ci/unit_tests_check.py b/tests/ci/unit_tests_check.py index 16316a917750..cb8a3e7e5af1 100644 --- a/tests/ci/unit_tests_check.py +++ b/tests/ci/unit_tests_check.py @@ -130,7 +130,7 @@ def main(): logging.info("Check is already finished according to github status, exiting") sys.exit(0) - docker_image = get_image_with_version(REPORTS_PATH, IMAGE_NAME) + docker_image = get_image_with_version(REPORTS_PATH, IMAGE_NAME, version=pr_info.docker_image_tag) download_unit_tests(check_name, REPORTS_PATH, TEMP_PATH) From 2c5051922a3654eb4bda316108a6560cc0638c0f Mon Sep 17 00:00:00 2001 From: MyroTk Date: Tue, 4 Jun 2024 12:01:21 -0700 Subject: [PATCH 6/9] test fixes --- .github/workflows/release_branches.yml | 106 +++++++++++----------- docker/test/integration/runner/Dockerfile | 95 ++++++++++--------- docker/test/stateful/Dockerfile | 2 +- docker/test/stateless/Dockerfile | 37 ++++---- 4 files changed, 118 insertions(+), 122 deletions(-) diff --git a/.github/workflows/release_branches.yml b/.github/workflows/release_branches.yml index 82942d682a9c..a8d3d9bae93f 100644 --- a/.github/workflows/release_branches.yml +++ b/.github/workflows/release_branches.yml @@ -31,7 +31,7 @@ on: # yamllint disable-line rule:truthy jobs: DockerHubPushAarch64: - runs-on: [self-hosted, altinity-on-demand, altinity-type-cax41, altinity-in-hel1, altinity-image-arm-app-docker-ce] + runs-on: [self-hosted, altinity-on-demand, altinity-type-cax41, altinity-in-hel1, altinity-image-arm-system-ubuntu-22.04] steps: - name: Check out repository code uses: Altinity/checkout@19599efdf36c4f3f30eb55d5bb388896faea69f6 @@ -49,7 +49,7 @@ jobs: path: ${{ runner.temp }}/docker_images_check/changed_images_aarch64.json DockerHubPushAmd64: - runs-on: [self-hosted, altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-app-docker-ce] + runs-on: [self-hosted, altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04] steps: - name: Check out repository code uses: Altinity/checkout@19599efdf36c4f3f30eb55d5bb388896faea69f6 @@ -68,7 +68,7 @@ jobs: DockerHubPush: needs: [DockerHubPushAmd64, DockerHubPushAarch64] - runs-on: [self-hosted, altinity-on-demand, altinity-type-cpx51, altinity-image-x86-app-docker-ce] + runs-on: [self-hosted, altinity-on-demand, altinity-type-cpx41, altinity-image-x86-system-ubuntu-22.04] steps: - name: Check out repository code uses: Altinity/checkout@19599efdf36c4f3f30eb55d5bb388896faea69f6 @@ -112,7 +112,7 @@ jobs: secrets: inherit with: test_name: Compatibility check X86 - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-image-x86-app-docker-ce + runner_type: altinity-on-demand, altinity-type-cpx41, altinity-image-x86-system-ubuntu-22.04 timeout_minutes: 180 run_command: | cd "$REPO_COPY/tests/ci" @@ -124,7 +124,7 @@ jobs: secrets: inherit with: test_name: Compatibility check Aarch64 - runner_type: altinity-on-demand, altinity-type-cax41, altinity-image-arm-app-docker-ce + runner_type: altinity-on-demand, altinity-type-cax41, altinity-image-arm-system-ubuntu-22.04 timeout_minutes: 180 run_command: | cd "$REPO_COPY/tests/ci" @@ -141,7 +141,7 @@ jobs: build_name: package_release checkout_depth: 0 timeout_minutes: 180 - runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-app-docker-ce + runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04, altinity-setup-builder additional_envs: | CLICKHOUSE_STABLE_VERSION_SUFFIX=altinitystable @@ -153,7 +153,7 @@ jobs: build_name: package_aarch64 checkout_depth: 0 timeout_minutes: 180 - runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-app-docker-ce + runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04, altinity-setup-builder additional_envs: | CLICKHOUSE_STABLE_VERSION_SUFFIX=altinitystable @@ -165,7 +165,7 @@ jobs: build_name: package_asan checkout_depth: 0 timeout_minutes: 180 - runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-app-docker-ce + runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04, altinity-setup-builder additional_envs: | CLICKHOUSE_STABLE_VERSION_SUFFIX=altinitystable @@ -177,7 +177,7 @@ jobs: build_name: package_ubsan checkout_depth: 0 timeout_minutes: 180 - runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-app-docker-ce + runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04, altinity-setup-builder additional_envs: | CLICKHOUSE_STABLE_VERSION_SUFFIX=altinitystable @@ -189,7 +189,7 @@ jobs: build_name: package_tsan checkout_depth: 0 timeout_minutes: 180 - runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-app-docker-ce + runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04, altinity-setup-builder additional_envs: | CLICKHOUSE_STABLE_VERSION_SUFFIX=altinitystable @@ -201,7 +201,7 @@ jobs: build_name: package_msan checkout_depth: 0 timeout_minutes: 180 - runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-app-docker-ce + runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04, altinity-setup-builder additional_envs: | CLICKHOUSE_STABLE_VERSION_SUFFIX=altinitystable @@ -213,7 +213,7 @@ jobs: build_name: package_debug checkout_depth: 0 timeout_minutes: 180 - runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-app-docker-ce + runner_type: altinity-on-demand, altinity-type-ccx53, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04, altinity-setup-builder additional_envs: | CLICKHOUSE_STABLE_VERSION_SUFFIX=altinitystable @@ -224,7 +224,7 @@ jobs: needs: - BuilderDebRelease - BuilderDebAarch64 - runs-on: [self-hosted, altinity-on-demand, altinity-type-cpx51, altinity-image-x86-app-docker-ce] + runs-on: [self-hosted, altinity-on-demand, altinity-type-cpx51, altinity-image-x86-system-ubuntu-22.04] timeout-minutes: 180 steps: - name: Check out repository code @@ -260,7 +260,7 @@ jobs: secrets: inherit with: test_name: ClickHouse build check - runner_type: altinity-on-demand, altinity-setup-reporter, altinity-type-cax11, altinity-image-arm-app-docker-ce + runner_type: altinity-on-demand, altinity-setup-reporter, altinity-type-cax11, altinity-image-arm-system-ubuntu-22.04 timeout_minutes: 180 additional_envs: | NEEDS_DATA< Date: Tue, 4 Jun 2024 22:33:09 -0700 Subject: [PATCH 7/9] runner config --- .github/workflows/release_branches.yml | 36 +++++++++++------------ docker/test/integration/runner/Dockerfile | 1 + docker/test/stateful/Dockerfile | 2 +- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release_branches.yml b/.github/workflows/release_branches.yml index a8d3d9bae93f..411de121625a 100644 --- a/.github/workflows/release_branches.yml +++ b/.github/workflows/release_branches.yml @@ -323,7 +323,7 @@ jobs: secrets: inherit with: test_name: Stateless tests (release) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=10800 run_command: | @@ -336,7 +336,7 @@ jobs: secrets: inherit with: test_name: Stateless tests (aarch64) - runner_type: altinity-on-demand, altinity-type-cax41, altinity-image-arm-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cax41, altinity-image-arm-snapshot-docker_ipv6_arm, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=10800 run_command: | @@ -349,63 +349,63 @@ jobs: secrets: inherit with: test_name: Stateless tests (asan) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=10800 batches: 4 run_command: | cd "$REPO_COPY/tests/ci" python3 functional_test_check.py "$CHECK_NAME" "$KILL_TIMEOUT" - + FunctionalStatelessTestTsan: needs: [BuilderDebTsan] uses: ./.github/workflows/reusable_test.yml secrets: inherit with: test_name: Stateless tests (tsan) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=10800 batches: 4 run_command: | cd "$REPO_COPY/tests/ci" python3 functional_test_check.py "$CHECK_NAME" "$KILL_TIMEOUT" - + FunctionalStatelessTestUBsan: needs: [BuilderDebUBsan] uses: ./.github/workflows/reusable_test.yml secrets: inherit with: test_name: Stateless tests (ubsan) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=10800 batches: 4 run_command: | cd "$REPO_COPY/tests/ci" python3 functional_test_check.py "$CHECK_NAME" "$KILL_TIMEOUT" - + FunctionalStatelessTestMsan: needs: [BuilderDebMsan] uses: ./.github/workflows/reusable_test.yml secrets: inherit with: test_name: Stateless tests (msan) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=10800 batches: 4 run_command: | cd "$REPO_COPY/tests/ci" python3 functional_test_check.py "$CHECK_NAME" "$KILL_TIMEOUT" - + FunctionalStatelessTestDebug: needs: [BuilderDebDebug] uses: ./.github/workflows/reusable_test.yml secrets: inherit with: test_name: Stateless tests (debug) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=10800 batches: 4 @@ -422,7 +422,7 @@ jobs: secrets: inherit with: test_name: Stateful tests (release) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=3600 run_command: | @@ -435,7 +435,7 @@ jobs: secrets: inherit with: test_name: Stateful tests (aarch64) - runner_type: altinity-on-demand, altinity-type-cax41, altinity-image-arm-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cax41, altinity-image-arm-snapshot-docker_ipv6_arm, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=3600 run_command: | @@ -448,7 +448,7 @@ jobs: secrets: inherit with: test_name: Stateful tests (asan) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=3600 run_command: | @@ -461,7 +461,7 @@ jobs: secrets: inherit with: test_name: Stateful tests (tsan) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=3600 run_command: | @@ -474,7 +474,7 @@ jobs: secrets: inherit with: test_name: Stateful tests (msan) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=3600 run_command: | @@ -487,7 +487,7 @@ jobs: secrets: inherit with: test_name: Stateful tests (ubsan) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=3600 run_command: | @@ -500,7 +500,7 @@ jobs: secrets: inherit with: test_name: Stateful tests (debug) - runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-system-ubuntu-22.04 + runner_type: altinity-on-demand, altinity-type-cpx51, altinity-in-ash, altinity-image-x86-snapshot-docker_ipv6_x86, altinity-setup-snapshot additional_envs: | KILL_TIMEOUT=3600 run_command: | diff --git a/docker/test/integration/runner/Dockerfile b/docker/test/integration/runner/Dockerfile index 79a86e3efeb0..468767067831 100644 --- a/docker/test/integration/runner/Dockerfile +++ b/docker/test/integration/runner/Dockerfile @@ -89,6 +89,7 @@ RUN python3 -m pip install --no-cache-dir \ redis~=4.6 \ tzlocal~=2.1 \ urllib3~=1.25 \ + requests~=2.31.0 \ requests-kerberos~=0.14 \ pyhdfs~=0.3 \ azure-storage-blob~=12.17 \ diff --git a/docker/test/stateful/Dockerfile b/docker/test/stateful/Dockerfile index 9ab41a7bee0e..8aefe4c87b95 100644 --- a/docker/test/stateful/Dockerfile +++ b/docker/test/stateful/Dockerfile @@ -7,7 +7,7 @@ FROM altinityinfra/stateless-test:$FROM_TAG RUN apt-get update -y \ && env DEBIAN_FRONTEND=noninteractive \ apt-get install --yes --no-install-recommends \ - python3-requests \ + python3-requests=2.22.* \ nodejs \ npm \ rpm2cpio \ From 5780d3c4dbd7cc22d73a8c34395af3ce4758ce39 Mon Sep 17 00:00:00 2001 From: MyroTk <44327070+MyroTk@users.noreply.github.com> Date: Wed, 5 Jun 2024 11:43:26 -0700 Subject: [PATCH 8/9] Update ci-runner.py --- tests/integration/ci-runner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/ci-runner.py b/tests/integration/ci-runner.py index a40117264c5c..78560de8c115 100755 --- a/tests/integration/ci-runner.py +++ b/tests/integration/ci-runner.py @@ -628,7 +628,8 @@ def run_test_group( test_cmd = " ".join([test for test in sorted(test_names)]) parallel_cmd = ( - " --parallel {} ".format(num_workers) if (num_workers > 0 or i > 0) else "" + ## NOTE(vnemkov) Second and consecutive runs non-parallel to improve stability + " --parallel {} ".format(num_workers) if (num_workers > 0 and i == 0) else "" ) # -r -- show extra test summary: # -f -- (f)ailed From d2371d2e7b9fb6761734fc5c926f90ec48aa2700 Mon Sep 17 00:00:00 2001 From: MyroTk <44327070+MyroTk@users.noreply.github.com> Date: Wed, 24 Jul 2024 08:13:38 -0700 Subject: [PATCH 9/9] Update pr_info.py --- tests/ci/pr_info.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ci/pr_info.py b/tests/ci/pr_info.py index 18497ab84116..a4e550c1c38a 100644 --- a/tests/ci/pr_info.py +++ b/tests/ci/pr_info.py @@ -40,7 +40,6 @@ ".json", ] RETRY_SLEEP = 0 -VERSION = get_version_from_repo(git=Git(True)) def get_pr_for_commit(sha, ref): if not ref: @@ -102,6 +101,7 @@ def __init__( # release_pr and merged_pr are used for docker images additional cache self.release_pr = 0 self.merged_pr = 0 + self.version = get_version_from_repo(git=Git(True)) ref = github_event.get("ref", "refs/heads/master") if ref and ref.startswith("refs/heads/"): ref = ref[11:] @@ -254,7 +254,7 @@ def __init__( self.sha = os.getenv( "GITHUB_SHA", "0000000000000000000000000000000000000000" ) - self.number = f"{VERSION.major}.{VERSION.minor}.{VERSION.patch}" + self.number = f"{self.version.major}.{self.version.minor}.{self.version.patch}" self.docker_image_tag = str(self.number) + "-" + str(self.sha) self.labels = set() repo_prefix = f"{GITHUB_SERVER_URL}/{GITHUB_REPOSITORY}"