From 15cd569df85f8d883fae4f4e83178c015ecfb1af Mon Sep 17 00:00:00 2001 From: Joan Martinez Date: Mon, 2 Sep 2024 11:21:52 +0200 Subject: [PATCH] fix: pass allow_concurrent to runtime_args --- jina/orchestrate/deployments/__init__.py | 4 ++-- jina/orchestrate/flow/base.py | 4 ++-- jina/serve/runtimes/worker/request_handling.py | 1 + tests/conftest.py | 4 ++-- tests/docker_compose/conftest.py | 6 +++--- tests/integration/instrumentation/conftest.py | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/jina/orchestrate/deployments/__init__.py b/jina/orchestrate/deployments/__init__.py index 1d76601a68009..3eecfd3606aab 100644 --- a/jina/orchestrate/deployments/__init__.py +++ b/jina/orchestrate/deployments/__init__.py @@ -1883,9 +1883,9 @@ def to_docker_compose_yaml( yaml.dump(docker_compose_dict, fp, sort_keys=False) command = ( - 'docker-compose up' + 'docker compose up' if output_path is None - else f'docker-compose -f {output_path} up' + else f'docker compose -f {output_path} up' ) self.logger.info( diff --git a/jina/orchestrate/flow/base.py b/jina/orchestrate/flow/base.py index 4e3abe955bf11..9aec82444a280 100644 --- a/jina/orchestrate/flow/base.py +++ b/jina/orchestrate/flow/base.py @@ -2851,9 +2851,9 @@ def to_docker_compose_yaml( yaml.dump(docker_compose_dict, fp, sort_keys=False) command = ( - 'docker-compose up' + 'docker compose up' if output_path is None - else f'docker-compose -f {output_path} up' + else f'docker compose -f {output_path} up' ) self.logger.info( diff --git a/jina/serve/runtimes/worker/request_handling.py b/jina/serve/runtimes/worker/request_handling.py index 6d4b3fb31ffc9..456c94a7bdf41 100644 --- a/jina/serve/runtimes/worker/request_handling.py +++ b/jina/serve/runtimes/worker/request_handling.py @@ -399,6 +399,7 @@ def _load_executor( 'metrics_registry': metrics_registry, 'tracer_provider': tracer_provider, 'meter_provider': meter_provider, + 'allow_concurrent': self.args.allow_concurrent, }, py_modules=self.args.py_modules, extra_search_paths=self.args.extra_search_paths, diff --git a/tests/conftest.py b/tests/conftest.py index 6f400bf936c37..993a3f4794c00 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -31,12 +31,12 @@ def test_metas(tmpdir, random_workspace_name): @pytest.fixture() def docker_compose(request): os.system( - f"docker-compose -f {request.param} --project-directory . up --build -d --remove-orphans" + f"docker compose -f {request.param} --project-directory . up --build -d --remove-orphans" ) time.sleep(10) yield os.system( - f"docker-compose -f {request.param} --project-directory . down --remove-orphans" + f"docker compose -f {request.param} --project-directory . down --remove-orphans" ) diff --git a/tests/docker_compose/conftest.py b/tests/docker_compose/conftest.py index 63f0681db50d8..aa5fb844c3f5f 100644 --- a/tests/docker_compose/conftest.py +++ b/tests/docker_compose/conftest.py @@ -81,14 +81,14 @@ def __init__(self, dump_path, timeout_second=30): def __enter__(self): subprocess.run( - f'docker-compose -f {self.dump_path} up --build -d --remove-orphans'.split( + f'docker compose -f {self.dump_path} up --build -d --remove-orphans'.split( ' ' ) ) container_ids = ( subprocess.run( - f'docker-compose -f {self.dump_path} ps -q'.split(' '), + f'docker compose -f {self.dump_path} ps -q'.split(' '), capture_output=True, ) .stdout.decode("utf-8") @@ -127,5 +127,5 @@ def _are_all_container_healthy( def __exit__(self, exc_type, exc_val, exc_tb): subprocess.run( - f'docker-compose -f {self.dump_path} down --remove-orphans'.split(' ') + f'docker compose -f {self.dump_path} down --remove-orphans'.split(' ') ) diff --git a/tests/integration/instrumentation/conftest.py b/tests/integration/instrumentation/conftest.py index c25a7edf145bc..173e8421ee928 100644 --- a/tests/integration/instrumentation/conftest.py +++ b/tests/integration/instrumentation/conftest.py @@ -35,12 +35,12 @@ def otlp_receiver_port(): def otlp_collector(jaeger_port, prometheus_backend_port, otlp_receiver_port): file_dir = os.path.dirname(__file__) os.system( - f"docker-compose -f {os.path.join(file_dir, 'docker-compose.yml')} up -d --remove-orphans" + f"docker compose -f {os.path.join(file_dir, 'docker-compose.yml')} up -d --remove-orphans" ) time.sleep(1) yield os.system( - f"docker-compose -f {os.path.join(file_dir, 'docker-compose.yml')} down --remove-orphans" + f"docker compose -f {os.path.join(file_dir, 'docker-compose.yml')} down --remove-orphans" )