Skip to content

Commit

Permalink
init: skeleton of project with basic plugin setup
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
vsoch committed Feb 21, 2024
0 parents commit d18cb97
Show file tree
Hide file tree
Showing 18 changed files with 796 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team leader @vsoch. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
4 changes: 4 additions & 0 deletions .github/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pre-commit
black==23.3.0
isort
flake8
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.eggs
compspec_ior.egg-info
*.so
build
__pycache__
env
dist
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-docstring-first
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending

- repo: local
hooks:
- id: black
name: black
language: python
types: [python]
entry: black

- id: isort
name: isort
args: [--filter-files]
language: python
types: [python]
entry: isort

- id: flake8
name: flake8
language: python
types: [python]
entry: flake8
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# CHANGELOG

This is a manually generated log to track changes to the repository for each release.
Each section should include general headers such as **Implemented enhancements**
and **Merged pull requests**. Critical items to know are:

- renamed commands
- deprecated / removed commands
- changed defaults
- backward incompatible changes (recipe file format? image file format?)
- migration guidance (how to convert images?)
- changed behaviour (recipe sections work differently)

The versions coincide with releases on pip. Only major versions will be released as tags on Github.

## [0.0.x](https://github.com/compspec/compspec-ior/tree/main) (0.0.x)
- Initial creation of project skeleton (0.0.0)
15 changes: 15 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Intellectual Property Notice
----------------------------

HPCIC DevTools is licensed under the MIT license (LICENSE).

Copyrights and patents in this project are retained by
contributors. No copyright assignment is required to contribute to
HPCIC DevTools.

SPDX usage
------------

Individual files contain SPDX tags instead of the full license text.
This enables machine processing of license information based on the SPDX
License Identifiers that are available here: https://spdx.org/licenses/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 LLNS, LLC and other HPCIC DevTools Developers.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include README.md LICENSE
recursive-include compspec_ior *
prune OLD*
prune env*
global-exclude .env
global-exclude *.py[co]
recursive-exclude .git *
global-exclude __pycache__
21 changes: 21 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
This work was produced under the auspices of the U.S. Department of
Energy by Lawrence Livermore National Laboratory under Contract
DE-AC52-07NA27344.

This work was prepared as an account of work sponsored by an agency of
the United States Government. Neither the United States Government nor
Lawrence Livermore National Security, LLC, nor any of their employees
makes any warranty, expressed or implied, or assumes any legal liability
or responsibility for the accuracy, completeness, or usefulness of any
information, apparatus, product, or process disclosed, or represents that
its use would not infringe privately owned rights.

Reference herein to any specific commercial product, process, or service
by trade name, trademark, manufacturer, or otherwise does not necessarily
constitute or imply its endorsement, recommendation, or favoring by the
United States Government or Lawrence Livermore National Security, LLC.

The views and opinions of authors expressed herein do not necessarily
state or reflect those of the United States Government or Lawrence
Livermore National Security, LLC, and shall not be used for advertising
or product endorsement purposes.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Compspec IOR

<p align="center">
<img height="300" src="https://raw.githubusercontent.com/compspec/spec/main/img/compspec-circle.png">
</p>

A compspec (Composition spec) is a specification and model for comparing things. Compspec IOR is
a plugin for extraction of [IOR](https://github.com/hpc/ior) metadata from applications, and packaging in compatibility specification
artifacts. This means that we also maintain the compatibility schema here. To learn more:

- [Compspec](https://github.com/compspec/compspec): the Python library that discovers and loads this plugin.
- [Compatibility](https://github.com/compspec/spec/tree/main/compatibility): of container images and applications to a host environment.
- [Compspec Go](https://github.com/compspec/compspec-go): the Go library that retrieves artifacts and makes graphs for image selection and scheduling.


## Usage

Install compspec and the plugin here:

```bash
pip install compspec
pip install compspec-ior
```

Then run an extraction with IOR. You can use defaults, or add any parameters to IOR after the plugin name "ior"

```bash
compspec extract ior ...
```

More coming soon!

## TODO

- Developer environment with IOR installed (for others and me too)
- testing, etc with pre-commit and spell checking
- implement run functionality
- use reasonable defaults for when nothing provided
- outputs should map to new schema.json attributes
- main library compspec should have support for oras push, etc.

## License

HPCIC DevTools is distributed under the terms of the MIT license.
All new contributions must be made under this license.

See [LICENSE](https://github.com/converged-computing/cloud-select/blob/main/LICENSE),
[COPYRIGHT](https://github.com/converged-computing/cloud-select/blob/main/COPYRIGHT), and
[NOTICE](https://github.com/converged-computing/cloud-select/blob/main/NOTICE) for details.

SPDX-License-Identifier: (MIT)

LLNL-CODE- 842614
2 changes: 2 additions & 0 deletions compspec_ior/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .plugin import ExtractorPlugin
from .version import __version__
37 changes: 37 additions & 0 deletions compspec_ior/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import argparse

from compspec.plugin import Plugin


class ExtractorPlugin(Plugin):
"""
The IOR extractor plugin
"""

description = "IOR parallel I/O benchmarks"

def add_arguments(self, subparser):
"""
Add arguments for the plugin to show up in argparse
"""
ior = subparser.add_parser(
self.name,
formatter_class=argparse.RawTextHelpFormatter,
description=self.description,
)
ior.add_argument(
"args",
help="Arguments for IOR (defaults to reasonable set if not defined)",
nargs="?",
)

def run(self, args):
"""
Run IOR and map metadata into compspec schema.
"""
# TODO
print(args)
print("RUN IOR HERE - choose defaults if")
import IPython

IPython.embed()
Loading

0 comments on commit d18cb97

Please sign in to comment.