Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload build time-trace data to CI database #53100

Merged
merged 31 commits into from Aug 8, 2023

Conversation

alexey-milovidov
Copy link
Member

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

The compiler's profile data (-ftime-trace) is uploaded to ClickHouse Cloud.

@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-build Pull request with build/testing/packaging improvement label Aug 7, 2023
@robot-ch-test-poll4
Copy link
Contributor

robot-ch-test-poll4 commented Aug 7, 2023

This is an automated comment for commit b397d11 with description of existing statuses. It's updated for the latest CI running
The full report is available here
The overall status of the commit is 🔴 failure

Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help🔴 failure
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR🟡 pending
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here🟢 success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integrational tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc🟢 success
Mergeable CheckChecks if all other necessary checks are successful🔴 failure
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests🟢 success
Push to DockerhubThe check for building and pushing the CI related docker images to docker hub🟢 success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc🟢 success
Style CheckRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report🟢 success
Unit testsRuns the unit tests for different release types🟢 success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts🔴 failure

@@ -19,7 +19,8 @@ RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install --yes \
shellcheck \
yamllint \
locales \
&& pip3 install black==23.1.0 boto3 codespell==2.2.1 mypy==1.3.0 PyGithub unidiff pylint==2.6.2 \
&& pip3 install black==23.1.0 boto3 codespell==2.2.1 mypy==1.3.0 PyGithub unidiff pylint==2.6.2 types-requests=2.31.0.2 types-urllib3=1.26.25.14 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's unnecessary change, we don't use additional stubs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But mypy told me about it in clear text.

import subprocess
import logging
import json
import os
import sys
import time
from typing import List, Tuple
import urllib.parse
import requests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, the goal is to use the same DB as for checks, so https://github.com/ClickHouse/ClickHouse/blob/master/tests/ci/clickhouse_helper.py#L18 would be extended

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we will use a separate DB because the DB with checks is capped at about 3.6 TB, while ClickHouse Cloud is unlimited.

@@ -3,6 +3,9 @@ name: BackportPR
env:
# Force the stdout and stderr streams to be unbuffered
PYTHONUNBUFFERED: 1
# Export system tables to ClickHouse Cloud
CLICKHOUSE_CI_LOGS_HOST: ${{ secrets.CLICKHOUSE_CI_LOGS_HOST }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually use the SSM for this purpose, and this function https://github.com/ClickHouse/ClickHouse/blob/master/tests/ci/get_robot_token.py#L18

@alexey-milovidov
Copy link
Member Author

CREATE TABLE build_time_trace
(
    pull_request_number UInt32,
    commit_sha String,
    check_start_time DateTime,
    check_name LowCardinality(String),
    instance_type LowCardinality(String),
    file String,
    library LowCardinality(String),
    date Date DEFAULT toDate(time),
    time DateTime64(6),
    
    pid UInt32,
    tid UInt32,
    ph Enum8('B', 'E', 'X', 'i', 'I', 'C', 'b', 'n', 'e', 'S', 'T', 'p', 'F', 's', 't', 'f', 'P', 'N', 'O', 'D', 'M'),
    ts UInt64,
    dur UInt64,
    cat LowCardinality(String),
    name LowCardinality(String),
    detail String,
    count UInt64,
    avgMs UInt64,
    args_name LowCardinality(String),
    is_total Bool DEFAULT name LIKE 'Total %'
)
ENGINE = MergeTree ORDER BY (date, file, name, args_name);

@alexey-milovidov alexey-milovidov added the force tests Force test ignoring fast test output. label Aug 8, 2023
@alexey-milovidov alexey-milovidov self-assigned this Aug 8, 2023
@alexey-milovidov
Copy link
Member Author

Ok. It works, and the amount of changes is minimal.
Next step: change it to use SSM agent, but without breaking it.

@alexey-milovidov alexey-milovidov merged commit 3ffffb0 into master Aug 8, 2023
57 of 163 checks passed
@alexey-milovidov alexey-milovidov deleted the upload-build-profile branch August 8, 2023 20:33
@Felixoid
Copy link
Member

Felixoid commented Aug 9, 2023

I don't get the purpose of the review if it's just ignored completely and merged.

A new image has broken everything again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
force tests Force test ignoring fast test output. pr-build Pull request with build/testing/packaging improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants