mirror of
https://github.com/hanzoai/datastore.git
synced 2026-10-30 14:48:37 +00:00
The fork already renamed its internals - the built binary is datastore, the packages are datastore-server and friends, and the shipped config.xml already says Datastore - but the surfaces a human reads still said ClickHouse. Issue templates asked which ClickHouse version was affected, the PR template told contributors to close upstream's issues, and CI job names, log lines, error messages and argparse descriptions named a product this repo does not ship. Only prose moved: display names, log and error messages, comments, docstrings and form labels. Everything a machine resolves stayed exactly as it was, because renaming those breaks a build rather than a sentence - binary and path tokens such as clickhouse-client and /etc/clickhouse-server, python and shell identifiers, CLICKHOUSE_* environment variables, the /ClickHouse container mount, docker images in a namespace we do not own, S3 buckets, maven and pypi coordinates, and every URL pointing at upstream. The attribution in NOTICE and README is untouched. Two links were wrong rather than merely stale, so they are corrected here. The PR template's Closes and Related placeholders sent contributors to upstream's tracker instead of this one, and an earlier pass had rewritten a source reference to github.com/Datastore/Datastore, which does not resolve. Co-authored-by: Hanzo Dev <[email protected]>
90 lines
3.0 KiB
Python
90 lines
3.0 KiB
Python
import sys
|
|
import traceback
|
|
|
|
from ci.jobs.clickbench import install_introspection
|
|
from ci.jobs.scripts.clickhouse_service import ClickHouseService
|
|
from ci.praktika.info import Info
|
|
from ci.praktika.result import Result
|
|
from ci.praktika.s3 import S3
|
|
from ci.praktika.utils import Shell, Utils
|
|
|
|
temp_dir = f"{Utils.cwd()}/ci/tmp"
|
|
|
|
|
|
def main():
|
|
results = [] # array of job's sub results - see CI report
|
|
stop_watch = Utils.Stopwatch()
|
|
info = Info()
|
|
|
|
# bash wrappers examples
|
|
_ = Shell.check("echo 'Run any shell command'", verbose=True)
|
|
assert Shell.get_output("echo 'Run any shell command'") == "Run any shell command"
|
|
|
|
# Get link to the latest CH binary
|
|
if Utils.is_arm():
|
|
latest_ch_master_url = "https://clickhouse-builds.s3.us-east-1.amazonaws.com/master/aarch64/clickhouse"
|
|
elif Utils.is_amd():
|
|
latest_ch_master_url = "https://clickhouse-builds.s3.us-east-1.amazonaws.com/master/amd64/clickhouse"
|
|
else:
|
|
assert False, "Unknown processor architecture"
|
|
|
|
try:
|
|
if not info.is_local_run:
|
|
results.append(r := Result.from_commands_run(
|
|
name="Download Datastore",
|
|
command=[
|
|
f"wget -nv -P {temp_dir} {latest_ch_master_url}",
|
|
f"chmod +x {temp_dir}/clickhouse",
|
|
f"{temp_dir}/clickhouse --version",
|
|
],
|
|
))
|
|
if not r.is_ok():
|
|
raise RuntimeError(f"[{r.name}] failed: {r.info}")
|
|
|
|
with ClickHouseService(
|
|
results=results,
|
|
config_hooks=[
|
|
ClickHouseService.install_base,
|
|
install_introspection,
|
|
],
|
|
):
|
|
results.append(
|
|
r := Result.from_commands_run(
|
|
name="Load the data",
|
|
command=[lambda: S3.copy_file_from_s3(
|
|
s3_path="clickhouse-datasets/hits/partitions/hits_v1.tar",
|
|
local_path=temp_dir,
|
|
)],
|
|
with_info=True,
|
|
)
|
|
)
|
|
if not r.is_ok():
|
|
raise RuntimeError(f"[{r.name}] failed: {r.info}")
|
|
|
|
print("Tests")
|
|
test_results = []
|
|
test_results.append(
|
|
Result.from_commands_run(
|
|
name="select 1",
|
|
command=f"{temp_dir}/clickhouse-client --query 'select 1'",
|
|
)
|
|
)
|
|
test_results.append(Result(name="test 2", status=Result.Status.OK))
|
|
results.append(Result.create_from(name="Tests", results=test_results))
|
|
except Exception as e:
|
|
print(traceback.format_exc(), file=sys.stdout)
|
|
results.append(
|
|
Result(name="Job error", status=Result.Status.FAIL, info=str(e))
|
|
)
|
|
|
|
Result.create_from(
|
|
results=results,
|
|
stopwatch=stop_watch,
|
|
files=[],
|
|
info="write result info here",
|
|
).complete_job()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|