From 5b1d454f2ebf17fe821316bee72b4effac3ad82d Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Thu, 5 Dec 2024 13:14:33 +0100 Subject: [PATCH] Make docker container memory a CLI argument --- tests/integration/runner | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/integration/runner b/tests/integration/runner index bb4b7d7e2cb..0adaf90200d 100755 --- a/tests/integration/runner +++ b/tests/integration/runner @@ -286,6 +286,14 @@ if __name__ == "__main__": help="Set network driver for runnner container (defaults to `host`)", ) + parser.add_argument( + "--memory", + # Default is host memory - 2GiB + default=physical_memory() - 2 * 1024**3, + help="Set the memory limit for the docker container, " + "accepts the same argument as `docker run --memory`", + ) + parser.add_argument( "--docker-image-version", default="latest", @@ -479,7 +487,7 @@ if __name__ == "__main__": cmd_base = ( f"docker run {net} {tty} --rm --name {CONTAINER_NAME} " "--privileged --dns-search='.' " # since recent dns search leaks from host - f"--memory={physical_memory() - 2 * 1024**3} " + f"--memory={args.memory} " f"--volume={args.odbc_bridge_binary}:/clickhouse-odbc-bridge " f"--volume={args.binary}:/clickhouse " f"--volume={args.library_bridge_binary}:/clickhouse-library-bridge "