From e01a18770520220ae0e482fc50d6019924c23ad6 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Thu, 20 Feb 2025 15:44:06 -0500 Subject: [PATCH] Modify p4studio interactive to use limited parallel jobs (#78) Signed-off-by: Andy Fingerhut --- .github/workflows/ci-test-ubuntu.yml | 2 +- p4studio/interactive/interactive_command.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-test-ubuntu.yml b/.github/workflows/ci-test-ubuntu.yml index 828faa66d..9c1ba0b9e 100644 --- a/.github/workflows/ci-test-ubuntu.yml +++ b/.github/workflows/ci-test-ubuntu.yml @@ -50,7 +50,7 @@ jobs: - name: Build run: | - ./p4studio/p4studio profile apply ./p4studio/profiles/testing.yaml + ./p4studio/p4studio profile apply --jobs $(nproc) ./p4studio/profiles/testing.yaml - name: Show build logs if: success() || failure() diff --git a/p4studio/interactive/interactive_command.py b/p4studio/interactive/interactive_command.py index 5f30cd3f7..a6b01a82a 100644 --- a/p4studio/interactive/interactive_command.py +++ b/p4studio/interactive/interactive_command.py @@ -29,7 +29,7 @@ from config.configuration_manager import current_configuration_manager from interactive.input_validation import validate_path_to_write, validate_kernel_headers_input, validate_file_to_read from profile.profile import Profile -from profile.profile_command import execute_plan +from profile.profile_command import execute_plan, calculate_jobs_from_available_cpus_and_memory from profile.profile_execution_plan import ProfileExecutionPlan from system.check_system_utils import print_multiple_checks from system.checks import get_initial_checks @@ -166,7 +166,8 @@ def create_default_profile() -> Profile: def build_sde(context: Context, profile: Profile) -> None: - plan = ProfileExecutionPlan(profile, None, os.cpu_count()) + jobs = calculate_jobs_from_available_cpus_and_memory() + plan = ProfileExecutionPlan(profile, None, jobs) execute_plan(context, plan)