-
Notifications
You must be signed in to change notification settings - Fork 43
Custom repos in benchpark #1190
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
Merged
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
bf91426
refactoring option handling
scheibelp c352e6d
reorg code (no logic change)
scheibelp 3f2b828
help str is auto generated
scheibelp 56811de
update help and add todo
scheibelp a1872be
initial config logic
scheibelp a8f198d
config construction
scheibelp 8826abb
config construction
scheibelp 62edf96
plumb config into repos (not working yet)
scheibelp 4ad65e7
plumb config into repos (not working yet)
scheibelp 6aebdd1
ref errors
scheibelp 6a7463b
add default repo config
scheibelp 25e2eb6
move saxpy into separate repo to demonstrate support for multiple exp…
scheibelp 7530e44
use benchpark config to determine ramble applicatinos and extra spack…
scheibelp 2e0508c
style format
scheibelp 278c157
Merge branch 'develop' into custom-repos
scheibelp a7bced6
forgot test repo yaml descriptor
scheibelp 2d23644
import formatting
scheibelp b1714b9
add license
scheibelp 9e1459e
imports and license
scheibelp 030f803
yamlfix
scheibelp dffe3d6
license
scheibelp 4f0c6bb
restore help generation interrupting import order
scheibelp bbd528f
restore check
scheibelp 23e4140
allow configure command to interact with config system (and integrate…
scheibelp 5aeec3e
missing files from last commit
scheibelp 8e2cf16
fix issue w/ configure
scheibelp ec1d116
only append .benchpark to config name if not user-specified
scheibelp 43d626c
auto style
scheibelp e16e809
better checking of config
scheibelp 1aafb22
fix some bugs
scheibelp e5d7099
restore prior handling of version option
scheibelp 9ee1581
add license to config
scheibelp 12a3f35
update ci check given that you have to name all subdir components whe…
scheibelp 0cbd10f
update imports
scheibelp c6b8bdb
I messed up the system info command
scheibelp 2478795
scripts outside of main can now import accounting
scheibelp dbb1054
merge from develop
scheibelp 2ed35fd
docs review comments
scheibelp 2e7bf29
add docs
scheibelp 1cb11c9
mention benchpark configure in config docs section
scheibelp 3d92e15
auto style
scheibelp 68b9218
Merge branch 'develop' into custom-repos
scheibelp bf315e7
merge from develop (minor conflicts)
scheibelp 995d9bc
update docs according to review
scheibelp 8b34b3a
docstrfmt
scheibelp a7fa807
docstrfmt wants to edit the license...
scheibelp 5f2e26e
update docs for configure command based on review
scheibelp 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
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,6 @@ | ||
| # Copyright 2023 Lawrence Livermore National Security, LLC and other | ||
| # Benchpark Project Developers. See the top-level COPYRIGHT file for details. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| bootstrap: | ||
| location: ~/.benchpark/ |
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,9 @@ | ||
| # Copyright 2023 Lawrence Livermore National Security, LLC and other | ||
| # Benchpark Project Developers. See the top-level COPYRIGHT file for details. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| repos: | ||
scheibelp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| experiments: [../experiments, ../experiments/test] | ||
| systems: [../systems] | ||
| applications: [../repo] | ||
| packages: [../repo] | ||
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,68 @@ | ||
| .. | ||
| Copyright 2023 Lawrence Livermore National Security, LLC and other | ||
| Benchpark Project Developers. See the top-level COPYRIGHT file for details. | ||
|
|
||
| SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| ####################### | ||
| Configuring Benchpark | ||
| ####################### | ||
|
|
||
scheibelp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Benchpark offers several options to configure usage. This includes: | ||
|
|
||
| 1. Configuring the location of the bootstrap directory (default is ``~/.benchpark``). | ||
| This is useful to change from the default value if you do not have much space in your | ||
| home directory, as the bootstrap contains the ``spack``, ``spack-packages``, and | ||
| ``ramble`` repositories. | ||
|
|
||
| 1. Configuring which repositories benchpark uses for objects in the | ||
| ``experiments/systems/repos`` directories (``experiment.py``, ``system.py``, | ||
| ``package.py``, and ``application.py``). | ||
|
|
||
| ********************************************** | ||
| Configuring the Benchpark Bootstrap Location | ||
| ********************************************** | ||
|
|
||
| Benchpark clones ``ramble``, ``spack``, and ``spack-packages`` into a centralized | ||
| location (by default this is ``~/.benchpark``) to enable building and running | ||
| benchmarks. Benchpark workspaces copy over these repositories from the centralized | ||
| location to avoid downloading from the internet when initializing a Benchpark workspace. | ||
| The bootstrap location can be configured in ``<benchpark_root>/config/bootstrap.yaml`` | ||
| or by running ``benchpark configure --bootstrap-location <location>``. | ||
|
|
||
| *********************************************** | ||
| Configuring Which Repositories Benchpark Uses | ||
| *********************************************** | ||
|
|
||
| The ``<benchpark_root>/config/repos.yaml`` file is used to fully customize ``system`` | ||
| and ``experiment`` repositories used by Benchpark, ``application`` repositories used by | ||
| Ramble, and package repositories used by Spack. For Spack and Ramble, the builtin | ||
| repository is always used (in addition to whatever package repositories are specified). | ||
| The order in which repositories appear in ``<benchpark_root>/config/repos.yaml`` will | ||
| determine their precedence, so if you desire to use a custom repository, it should be | ||
| listed before any other repositories. | ||
|
|
||
| ********************************************************************** | ||
| Automatically Generating Configurations with ``benchpark configure`` | ||
| ********************************************************************** | ||
|
|
||
| ``benchpark configure`` is designed to create the ``yaml`` configurations for you. As of | ||
| now, it can only generate bootstrap config (``bootstrap.yaml``). If no bootstrap config | ||
| is detected in the chosen scope, this will auto-generate it. ``benchpark configure`` | ||
| cannot generate a ``repos.yaml`` file at the moment, this must be written manually. | ||
|
|
||
| ********************** | ||
| Configuration Scopes | ||
| ********************** | ||
|
|
||
| Benchpark can pull configurations from one location, with the following priority | ||
| (highest first): | ||
|
|
||
| - As an argument to ``benchpark``: ``benchpark -C <dir>...`` | ||
| - If the CWD where you invoke the benchpark executable has ``benchpark-config`` | ||
| directory | ||
| - If ``<benchpark_root>/config`` is a directory; this must exist if the first two don't | ||
|
|
||
| There is no mixing and matching between these tiers. If you are using ``-C``, then the | ||
| specified directory must contain a ``bootstrap.yaml`` and a ``repos.yaml`` (you can copy | ||
| from ``<benchpark_root>/config`` if you want the same config). | ||
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
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,7 @@ | ||
| # Copyright 2023 Lawrence Livermore National Security, LLC and other | ||
| # Benchpark Project Developers. See the top-level COPYRIGHT file for details. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| repo: | ||
| namespace: test | ||
| subdirectory: '' |
File renamed without changes.
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,56 @@ | ||
| # Copyright 2023 Lawrence Livermore National Security, LLC and other | ||
| # Benchpark Project Developers. See the top-level COPYRIGHT file for details. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import pathlib | ||
|
|
||
|
|
||
| def _source_location() -> pathlib.Path: | ||
| """Return the location of the project source files directory.""" | ||
| path_to_this_file = __file__ | ||
| return pathlib.Path(path_to_this_file).resolve().parents[2] | ||
|
|
||
|
|
||
| _unset = object() | ||
|
|
||
|
|
||
| class BasePaths: | ||
| def __init__(self): | ||
| self.benchpark_root = _source_location() | ||
| self.lib_path = self.benchpark_root / "lib" / "benchpark" | ||
| self.test_path = self.lib_path / "test" | ||
| self.hardware_descriptions = ( | ||
| self.benchpark_root / "systems" / "all_hardware_descriptions" | ||
| ) | ||
| self.checkout_versions = self.benchpark_root / "checkout-versions.yaml" | ||
| self.remote_urls = self.benchpark_root / "remote-urls.yaml" | ||
| self.invocation_working_dir = None | ||
| self.user_input_cfg = _unset | ||
|
|
||
|
|
||
| base_paths = BasePaths() | ||
|
|
||
|
|
||
| def determine_config_dir(): | ||
| """ | ||
| Benchpark configs don't merge or override like Spack/Ramble. You | ||
| just point it at a directory and that's where all your config is. | ||
| """ | ||
| if base_paths.user_input_cfg is _unset: | ||
| raise Exception("Internal error: config initialization") | ||
| elif base_paths.user_input_cfg: | ||
| if not base_paths.user_input_cfg.exists(): | ||
| raise Exception( | ||
| f"Specific config dir does not exist: {base_paths.user_input_cfg}" | ||
| ) | ||
| else: | ||
| return base_paths.user_input_cfg | ||
|
|
||
| possible_dirs = [ | ||
| base_paths.invocation_working_dir / "benchpark-config", | ||
| base_paths.benchpark_root / "config", | ||
| ] | ||
| for pd in possible_dirs: | ||
| if pd.exists(): | ||
| return pd |
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
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.
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.