diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index d8f68a513f41..991b11a0a845 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,12 +175,58 @@ 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 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 @@ -191,7 +237,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 +249,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 +274,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 +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 }} @@ -252,7 +298,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 +316,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 +332,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 +343,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 +360,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 +372,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 +383,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 +400,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 +416,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 +428,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 +450,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 +466,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 +478,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 +503,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 +519,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 +530,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 +554,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/release_branches.yml b/.github/workflows/release_branches.yml index ec89c8b5400a..411de121625a 100644 --- a/.github/workflows/release_branches.yml +++ b/.github/workflows/release_branches.yml @@ -26,10 +26,12 @@ on: # yamllint disable-line rule:truthy push: branches: - 'releases/23.3**' + schedule: + - cron: "0 0 * * 6" 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 @@ -41,13 +43,13 @@ 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 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 @@ -59,14 +61,14 @@ 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 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-cpx41, altinity-image-x86-system-ubuntu-22.04] steps: - name: Check out repository code uses: Altinity/checkout@19599efdf36c4f3f30eb55d5bb388896faea69f6 @@ -82,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 }} @@ -99,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 @@ -110,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-cpx41, altinity-image-x86-system-ubuntu-22.04 timeout_minutes: 180 run_command: | cd "$REPO_COPY/tests/ci" @@ -122,7 +124,8 @@ 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" python3 compatibility_check.py --check-name "Compatibility check (aarch64)" --check-glibc @@ -138,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 @@ -150,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 @@ -162,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 @@ -174,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 @@ -186,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 @@ -198,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 @@ -210,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 @@ -221,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 @@ -257,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-arm-system-ubuntu-22.04 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..a4e550c1c38a 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" @@ -37,7 +41,6 @@ ] RETRY_SLEEP = 0 - def get_pr_for_commit(sha, ref): if not ref: return None @@ -98,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:] @@ -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"{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}" 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) 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