Skip to content
Snippets Groups Projects
Verified Commit 53bd2e5b authored by Кирилл Безуглый's avatar Кирилл Безуглый
Browse files

chore: add script for generating tarantool snapshots

parent 72f7d245
No related branches found
No related tags found
1 merge request!1352compat with tarantool snapshot generated on previous picodata version
from conftest import Cluster, Compatibility, PortDistributor
from pathlib import Path
import conftest
import shutil
if __name__ == "__main__":
conftest.cargo_build()
port_distributor = PortDistributor(1333, 1344)
tmpdir = Path("./tmp_generate_snapshot").resolve()
tmpdir.mkdir(exist_ok=True)
try:
cluster = Cluster(
binary_path=conftest.binary_path(),
id="cluster_to_gen_snap",
data_dir=str(tmpdir),
base_host="localhost",
port_distributor=port_distributor,
)
inst = cluster.add_instance()
compat = Compatibility()
compat.fetch_current_tag()
compat.fill_snapshot_with_data(inst)
compat.copy_latest_snapshot(inst)
print(
f"Succesfully generated snapshot of {compat.tag} and copied into {compat.path}"
)
cluster.kill()
finally:
shutil.rmtree(tmpdir)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment