-
Notifications
You must be signed in to change notification settings - Fork 30
801 - Enable Specification Composition #808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
maufrancom
wants to merge
27
commits into
NVIDIA:main
Choose a base branch
from
maufrancom:mfranco/spec-composition
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 17 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
bd4c9cc
Added new feature to execute workflows without a kubernetes cluster, …
maufrancom cfbba1d
Add local.py and update dependencies in BUILD file
maufrancom 7f16d4f
Add GPU passthrough support in LocalExecutor
maufrancom 1c71133
Update Docker command construction in LocalExecutor
maufrancom 77fa2ab
Add resume functionality to local workflow execution
maufrancom c44dbfb
Update .gitignore to include .venv directory
maufrancom ffcdd72
Enhance local workflow execution with Docker command support
maufrancom 0bf8bd5
Enhance documentation and comments in local execution modules
maufrancom a79bca8
Refactor file handling in LocalExecutor for UTF-8 encoding
maufrancom 27424cd
Enhance error handling and update documentation in local execution mo…
maufrancom 313466b
Update copyright line in test_local_executor.py to comply with pylint…
maufrancom 9459fec
Add shared memory size support for GPU tasks in local execution
maufrancom e5adf29
Add tutorial specs filegroup and enhance local executor tests
maufrancom 429aa84
Implement file path validation in LocalExecutor to prevent directory …
maufrancom d08bf9b
Clear GPU device specification in Docker arguments for LocalExecutor
maufrancom c59a65d
Refactor shared memory size handling in LocalExecutor
maufrancom b50140f
Add spec_includes library and integrate into local_executor
maufrancom 72c1990
Merge branch 'NVIDIA:main' into mfranco/spec-composition
maufrancom 688ecc6
Enhance local execution capabilities and documentation
maufrancom ba9b994
Refactor default-values handling in local execution
maufrancom 34936e2
Add compose command to CLI for workflow spec resolution
maufrancom 37e5aa4
Update project configuration and enhance .gitignore
maufrancom 1f37243
Refactor and enhance code documentation in local execution
maufrancom 16f410a
Enhance LocalExecutor to support Docker Compose for workflow execution
maufrancom 524f7cb
Enhance LocalExecutor with additional volume support and command vali…
maufrancom 17d73e0
Refactor task dependency handling and enhance test coverage
maufrancom e707b27
Enhance workflow specification handling with environment variable res…
maufrancom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,3 +29,5 @@ docs/**/domain_config.js | |
| .ruff_cache | ||
|
|
||
| .lycheecache | ||
|
|
||
| .venv/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| filegroup( | ||
| name = "tutorial_specs", | ||
| srcs = glob(["*.yaml"]), | ||
| visibility = ["//src/utils/tests:__pkg__"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| """ | ||
| SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # pylint: disable=line-too-long | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
|
|
||
| SPDX-License-Identifier: Apache-2.0 | ||
| """ | ||
|
|
||
| import argparse | ||
| import sys | ||
|
|
||
| import shtab | ||
|
|
||
| from src.utils import local_executor | ||
|
|
||
|
|
||
| def setup_parser(parser: argparse._SubParsersAction): | ||
| """Register the 'local' subcommand and its nested 'run' action with the CLI argument parser.""" | ||
| local_parser = parser.add_parser( | ||
| 'local', | ||
| help='Run workflows locally using Docker (no Kubernetes cluster required).') | ||
| subparsers = local_parser.add_subparsers(dest='command') | ||
| subparsers.required = True | ||
|
|
||
| run_parser = subparsers.add_parser( | ||
| 'run', | ||
| help='Execute a workflow spec locally using Docker containers.') | ||
| run_parser.add_argument( | ||
| '-f', '--file', | ||
| required=True, | ||
| dest='workflow_file', | ||
| help='Path to the workflow YAML spec file.').complete = shtab.FILE | ||
| run_parser.add_argument( | ||
| '--work-dir', | ||
| dest='work_dir', | ||
| default=None, | ||
| help='Directory for task inputs/outputs. Defaults to a temporary directory.') | ||
| run_parser.add_argument( | ||
| '--keep', | ||
| action='store_true', | ||
| default=False, | ||
| help='Keep the work directory after execution (always kept on failure).') | ||
| run_parser.add_argument( | ||
| '--docker', | ||
| dest='docker_cmd', | ||
| default='docker', | ||
| help='Docker-compatible command to use (e.g. podman). Default: docker.') | ||
| run_parser.add_argument( | ||
| '--resume', | ||
| action='store_true', | ||
| default=False, | ||
| help='Resume a previous run, skipping tasks that already completed successfully. ' | ||
| 'Requires --work-dir pointing to the previous run directory.') | ||
| run_parser.add_argument( | ||
| '--from-step', | ||
| dest='from_step', | ||
| default=None, | ||
| help='Resume from a specific task, re-running it and all downstream tasks. ' | ||
| 'Tasks upstream of the specified step are skipped if they completed ' | ||
| 'successfully. Requires --work-dir pointing to the previous run directory.') | ||
| run_parser.add_argument( | ||
| '--shm-size', | ||
| dest='shm_size', | ||
| default=None, | ||
| help='Shared memory size for GPU containers (e.g. 16g, 32g). ' | ||
| 'Defaults to 16g for tasks that request GPUs. ' | ||
| 'PyTorch DataLoader workers require large shared memory.') | ||
| run_parser.set_defaults(func=_run_local) | ||
|
|
||
|
|
||
| def _run_local(service_client, args: argparse.Namespace): | ||
| """Execute a workflow locally via Docker using the parsed CLI arguments.""" | ||
| try: | ||
| success = local_executor.run_workflow_locally( | ||
| spec_path=args.workflow_file, | ||
| work_dir=args.work_dir, | ||
| keep_work_dir=args.keep, | ||
| resume=args.resume, | ||
| from_step=args.from_step, | ||
| docker_cmd=args.docker_cmd, | ||
| shm_size=args.shm_size, | ||
| ) | ||
| except (ValueError, FileNotFoundError, PermissionError) as error: | ||
| print(f'Error: {error}', file=sys.stderr) | ||
| sys.exit(1) | ||
|
|
||
| if not success: | ||
| sys.exit(1) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.