Skip to content

Commit

Permalink
Leave only simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-milovidov committed Aug 17, 2023
1 parent 64c8298 commit 857856b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
38 changes: 0 additions & 38 deletions docker/test/performance-comparison/compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,6 @@ function left_or_right()

function configure
{
# Setup a cluster for logs export to ClickHouse Cloud
# Note: these variables are provided to the Docker run command by the Python script in tests/ci
if [ -n "${CLICKHOUSE_CI_LOGS_HOST}" ]
then
set +x
echo "
remote_servers:
system_logs_export:
shard:
replica:
secure: 1
user: ci
host: '${CLICKHOUSE_CI_LOGS_HOST}'
port: 9440
password: '${CLICKHOUSE_CI_LOGS_PASSWORD}'
" > right/config/config.d/system_logs_export.yaml
set -x
fi

# Use the new config for both servers, so that we can change it in a PR.
rm right/config/config.d/text_log.xml ||:
cp -rv right/config left ||:
Expand Down Expand Up @@ -111,25 +92,6 @@ remote_servers:
wait_for_server $LEFT_SERVER_PORT $left_pid
echo "Server for setup started"

# Initialize export of system logs to ClickHouse Cloud
# Note: it is set up for the "left" server, and its database is then cloned to the "right" server.
if [ -n "${CLICKHOUSE_CI_LOGS_HOST}" ]
then
(
set +x
export EXTRA_COLUMNS_EXPRESSION="$PR_TO_TEST AS pull_request_number, '$SHA_TO_TEST' AS commit_sha, '$CHECK_START_TIME' AS check_start_time, '$CHECK_NAME' AS check_name, '$INSTANCE_TYPE' AS instance_type"
export CONNECTION_PARAMETERS="--secure --user ci --host ${CLICKHOUSE_CI_LOGS_HOST} --password ${CLICKHOUSE_CI_LOGS_PASSWORD}"

/setup_export_logs.sh "--port $LEFT_SERVER_PORT"

# Unset variables after use
export CONNECTION_PARAMETERS=''
export CLICKHOUSE_CI_LOGS_HOST=''
export CLICKHOUSE_CI_LOGS_PASSWORD=''
set -x
)
fi

clickhouse-client --port $LEFT_SERVER_PORT --query "create database test" ||:
clickhouse-client --port $LEFT_SERVER_PORT --query "rename table datasets.hits_v1 to test.hits" ||:

Expand Down
18 changes: 0 additions & 18 deletions tests/ci/performance_comparison_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ def get_run_command(
instance_type = get_instance_type()

envs = [
"-e CLICKHOUSE_CI_LOGS_HOST",
"-e CLICKHOUSE_CI_LOGS_PASSWORD",
f"-e CHECK_START_TIME='{check_start_time}'",
f"-e CHECK_NAME='{check_name}'",
f"-e INSTANCE_TYPE='{instance_type}'",
Expand Down Expand Up @@ -203,22 +201,6 @@ def __exit__(self, exc_type, exc_val, exc_tb):

subprocess.check_call(f"sudo chown -R ubuntu:ubuntu {temp_path}", shell=True)

# Cleanup run log from the credentials of CI logs database.
# Note: a malicious user can still print them by splitting the value into parts.
# But we will be warned when a malicious user modifies CI script.
# Although they can also print them from inside tests.
# Nevertheless, the credentials of the CI logs have limited scope
# and does not provide access to sensitive info.

ci_logs_host = os.getenv("CLICKHOUSE_CI_LOGS_HOST", "CLICKHOUSE_CI_LOGS_HOST")
ci_logs_password = os.getenv(
"CLICKHOUSE_CI_LOGS_PASSWORD", "CLICKHOUSE_CI_LOGS_PASSWORD"
)
subprocess.check_call(
f"sed -i -r -e 's!{ci_logs_host}!CLICKHOUSE_CI_LOGS_HOST!g; s!{ci_logs_password}!CLICKHOUSE_CI_LOGS_PASSWORD!g;' '{run_log_path}' '{compare_log_path}'",
shell=True,
)

paths = {
"compare.log": compare_log_path,
"output.7z": os.path.join(result_path, "output.7z"),
Expand Down

0 comments on commit 857856b

Please sign in to comment.