Skip to content

Commit d18cb97

Browse files
committed
init: skeleton of project with basic plugin setup
Problem: we need an easy interface for developers to write plugins! A plugin can be an extractor or (TBA) other. Generally speaking, it will run a tool of interest and map the output (e.g., application performance or similar) into a namespace defined for a compatibility specification. The calling library (compspec) discovers the plugin and knows how to handle validation and execution of these steps along with packaging of the metadata. It is going to be neat! Signed-off-by: vsoch <[email protected]>
0 parents  commit d18cb97

18 files changed

+796
-0
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team leader @vsoch. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org

.github/dev-requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pre-commit
2+
black==23.3.0
3+
isort
4+
flake8

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.eggs
2+
compspec_ior.egg-info
3+
*.so
4+
build
5+
__pycache__
6+
env
7+
dist

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.3.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-docstring-first
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
- id: mixed-line-ending
11+
12+
- repo: local
13+
hooks:
14+
- id: black
15+
name: black
16+
language: python
17+
types: [python]
18+
entry: black
19+
20+
- id: isort
21+
name: isort
22+
args: [--filter-files]
23+
language: python
24+
types: [python]
25+
entry: isort
26+
27+
- id: flake8
28+
name: flake8
29+
language: python
30+
types: [python]
31+
entry: flake8

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# CHANGELOG
2+
3+
This is a manually generated log to track changes to the repository for each release.
4+
Each section should include general headers such as **Implemented enhancements**
5+
and **Merged pull requests**. Critical items to know are:
6+
7+
- renamed commands
8+
- deprecated / removed commands
9+
- changed defaults
10+
- backward incompatible changes (recipe file format? image file format?)
11+
- migration guidance (how to convert images?)
12+
- changed behaviour (recipe sections work differently)
13+
14+
The versions coincide with releases on pip. Only major versions will be released as tags on Github.
15+
16+
## [0.0.x](https://github.com/compspec/compspec-ior/tree/main) (0.0.x)
17+
- Initial creation of project skeleton (0.0.0)

COPYRIGHT

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Intellectual Property Notice
2+
----------------------------
3+
4+
HPCIC DevTools is licensed under the MIT license (LICENSE).
5+
6+
Copyrights and patents in this project are retained by
7+
contributors. No copyright assignment is required to contribute to
8+
HPCIC DevTools.
9+
10+
SPDX usage
11+
------------
12+
13+
Individual files contain SPDX tags instead of the full license text.
14+
This enables machine processing of license information based on the SPDX
15+
License Identifiers that are available here: https://spdx.org/licenses/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 LLNS, LLC and other HPCIC DevTools Developers.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include README.md LICENSE
2+
recursive-include compspec_ior *
3+
prune OLD*
4+
prune env*
5+
global-exclude .env
6+
global-exclude *.py[co]
7+
recursive-exclude .git *
8+
global-exclude __pycache__

NOTICE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
This work was produced under the auspices of the U.S. Department of
2+
Energy by Lawrence Livermore National Laboratory under Contract
3+
DE-AC52-07NA27344.
4+
5+
This work was prepared as an account of work sponsored by an agency of
6+
the United States Government. Neither the United States Government nor
7+
Lawrence Livermore National Security, LLC, nor any of their employees
8+
makes any warranty, expressed or implied, or assumes any legal liability
9+
or responsibility for the accuracy, completeness, or usefulness of any
10+
information, apparatus, product, or process disclosed, or represents that
11+
its use would not infringe privately owned rights.
12+
13+
Reference herein to any specific commercial product, process, or service
14+
by trade name, trademark, manufacturer, or otherwise does not necessarily
15+
constitute or imply its endorsement, recommendation, or favoring by the
16+
United States Government or Lawrence Livermore National Security, LLC.
17+
18+
The views and opinions of authors expressed herein do not necessarily
19+
state or reflect those of the United States Government or Lawrence
20+
Livermore National Security, LLC, and shall not be used for advertising
21+
or product endorsement purposes.

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Compspec IOR
2+
3+
<p align="center">
4+
<img height="300" src="https://raw.githubusercontent.com/compspec/spec/main/img/compspec-circle.png">
5+
</p>
6+
7+
A compspec (Composition spec) is a specification and model for comparing things. Compspec IOR is
8+
a plugin for extraction of [IOR](https://github.com/hpc/ior) metadata from applications, and packaging in compatibility specification
9+
artifacts. This means that we also maintain the compatibility schema here. To learn more:
10+
11+
- [Compspec](https://github.com/compspec/compspec): the Python library that discovers and loads this plugin.
12+
- [Compatibility](https://github.com/compspec/spec/tree/main/compatibility): of container images and applications to a host environment.
13+
- [Compspec Go](https://github.com/compspec/compspec-go): the Go library that retrieves artifacts and makes graphs for image selection and scheduling.
14+
15+
16+
## Usage
17+
18+
Install compspec and the plugin here:
19+
20+
```bash
21+
pip install compspec
22+
pip install compspec-ior
23+
```
24+
25+
Then run an extraction with IOR. You can use defaults, or add any parameters to IOR after the plugin name "ior"
26+
27+
```bash
28+
compspec extract ior ...
29+
```
30+
31+
More coming soon!
32+
33+
## TODO
34+
35+
- Developer environment with IOR installed (for others and me too)
36+
- testing, etc with pre-commit and spell checking
37+
- implement run functionality
38+
- use reasonable defaults for when nothing provided
39+
- outputs should map to new schema.json attributes
40+
- main library compspec should have support for oras push, etc.
41+
42+
## License
43+
44+
HPCIC DevTools is distributed under the terms of the MIT license.
45+
All new contributions must be made under this license.
46+
47+
See [LICENSE](https://github.com/converged-computing/cloud-select/blob/main/LICENSE),
48+
[COPYRIGHT](https://github.com/converged-computing/cloud-select/blob/main/COPYRIGHT), and
49+
[NOTICE](https://github.com/converged-computing/cloud-select/blob/main/NOTICE) for details.
50+
51+
SPDX-License-Identifier: (MIT)
52+
53+
LLNL-CODE- 842614

compspec_ior/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from .plugin import ExtractorPlugin
2+
from .version import __version__

compspec_ior/plugin.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import argparse
2+
3+
from compspec.plugin import Plugin
4+
5+
6+
class ExtractorPlugin(Plugin):
7+
"""
8+
The IOR extractor plugin
9+
"""
10+
11+
description = "IOR parallel I/O benchmarks"
12+
13+
def add_arguments(self, subparser):
14+
"""
15+
Add arguments for the plugin to show up in argparse
16+
"""
17+
ior = subparser.add_parser(
18+
self.name,
19+
formatter_class=argparse.RawTextHelpFormatter,
20+
description=self.description,
21+
)
22+
ior.add_argument(
23+
"args",
24+
help="Arguments for IOR (defaults to reasonable set if not defined)",
25+
nargs="?",
26+
)
27+
28+
def run(self, args):
29+
"""
30+
Run IOR and map metadata into compspec schema.
31+
"""
32+
# TODO
33+
print(args)
34+
print("RUN IOR HERE - choose defaults if")
35+
import IPython
36+
37+
IPython.embed()

0 commit comments

Comments
 (0)