From 06fc55b0b6d425bd90c607748ceafd40d1f19f4d Mon Sep 17 00:00:00 2001 From: Evan Krall Date: Wed, 3 Apr 2024 16:34:26 -0700 Subject: [PATCH] Add --memory option to paasta local-run to allow overriding of memory limit set in yelpsoa-configs. --- paasta_tools/cli/cmds/local_run.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/paasta_tools/cli/cmds/local_run.py b/paasta_tools/cli/cmds/local_run.py index ef478cb772..f0cfc2cda8 100755 --- a/paasta_tools/cli/cmds/local_run.py +++ b/paasta_tools/cli/cmds/local_run.py @@ -386,6 +386,16 @@ def add_subparser(subparsers): required=False, default=None, ) + list_parser.add_argument( + "--memory", + help=( + "Specify a memory limit (in megabytes) for the container." + " If not specified, the memory limit is pulled from yelpsoa-configs for your --instance/--cluster." + ), + required=False, + default=None, + type=int, + ) list_parser.add_argument( "-i", "--instance", @@ -1174,6 +1184,9 @@ def configure_and_run_docker_container( ) return 1 + if args.memory: + instance_config.config_dict["mem"] = args.memory + if docker_sha is not None: instance_config.branch_dict = { "git_sha": docker_sha,