Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

adding first container guts! #1

Merged
merged 13 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
114 changes: 114 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Contributor's Agreement

This code is licensed under the MPL 2.0 [LICENSE](LICENSE).

# Contributing

When contributing to Singularity Registry Global Client, it is
important to properly communicate the gist of the contribution.
If it is a simple code or editorial fix, simply explaining this
within the GitHub Pull Request (PR) will suffice. But if this is a larger
fix or Enhancement, it should be first discussed with the project
leader or developers.

Please note we have a code of conduct, described below. Please follow it in
all your interactions with the project members and users.

## Pull Request Process

1. Bug fix PRs should be sent to both the master and development branches.
Feature enhancements should only be submitted against the development
branch.
2. Follow the existing code style precedent. This does not need to be strictly
defined as there are many thousands of lines of examples. Note the lack
of tabs anywhere in the project, parentheses and spacing, documentation
style, source code layout, variable scoping, and follow the project's
standards.
3. Test your PR locally, and provide the steps necessary to test for the
reviewers.
4. The project's default copyright and header have been included in any new
source files.
5. All (major) changes to Singularity Registry must be documented in
[docs](docs). If your PR changes a core functionality, please
include clear description of the changes in your PR so that the docs
can be updated, or better, submit another PR to update the docs directly.
6. If necessary, update the README.md.
7. The pull request will be reviewed by others, and the final merge must be
done by the Singularity project lead, @vsoch (or approved by her).


# 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, gender identity and expression, level of experience,
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 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, contributors and users who do not follow or enforce the
Code of Conduct in good faith may face temporary or permanent repercussions
with their involvement in the project as determined by the project's leader(s).

## Attribution

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

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: vsoch
45 changes: 45 additions & 0 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Generate Container Yaml
on:
pull_request: []
workflow_dispatch:
inputs:
docker_uri:
description: 'Docker identifier to generate recipe for'
required: true
default: "quay.io/autamus/clingo:5.5.1"
jobs:
generate-recipe:
if: (inputs.docker_uri != '')
runs-on: ubuntu-latest
permissions:
packages: read
name: ${{ inputs.docker_uri }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Guts for ${{ inputs.docker_uri }}
uses: ./manifest
with:
image: ${{ inputs.docker_uri }}

generate-recipes:
runs-on: ubuntu-latest
permissions:
packages: read
strategy:
fail-fast: false
matrix:
image: ["ubuntu", "centos", "rockylinux:9.0", "alpine", "busybox"]

name: Generate Matrix
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Guts for ${{ matrix.image }}
uses: ./manifest
with:
image: ${{ matrix.image }}
outfile: ${{ matrix.image }}.json
- name: View Output
run: cat ${{ matrix.image }}.json

76 changes: 75 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,78 @@

Action to derive executables on the PATH inside a container. 🤓

**under development**
## Usage


### Manual

You can test manually! If you provide an output file, it will save to it,
otherwise it will print to the screen.

```bash
$ python manifest/scripts/prepare_manifests.py ubuntu
```
```bash
$ python manifest/scripts/prepare_manifests.py --outfile ubuntu-guts.json ubuntu
```

The example [ubuntu-guts.json](ubuntu-guts.json) is provided.

### GitHub Actions
For a single image (e.g., on dispatch)

```yaml
name: Generate Container Guts
on:
workflow_dispatch:
inputs:
docker_uri:
description: 'Docker identifier to generate recipe for'
required: true
default: "quay.io/autamus/clingo:5.5.1"
jobs:
generate-recipe:
runs-on: ubuntu-latest
permissions:
packages: read
name: ${{ inputs.docker_uri }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Guts for ${{ inputs.docker_uri }}
uses: singularityhub/guts/manifest@main
with:
image: ${{ inputs.docker_uri }}
outfile: ${{ inputs.docker_uri }}
- name: View Output
run: cat ${{ matrix.image }}.json
```

or for a matrix! E.g., you might want to save them nested in their directory
location.

```yaml
name: Generate Container Guts
on:
pull_request: []
generate-recipes:
runs-on: ubuntu-latest
permissions:
packages: read
strategy:
max-parallel: 4
matrix:
image: ["ubuntu", "centos", "rockylinux:9.0", "alpine", "busybox"]

name: Generate Matrix
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Guts for ${{ matrix.image }}
uses: singularityhub/guts/manifest@main
with:
image: ${{ matrix.image }}
outfile: ${{ matrix.image }}.json
- name: View Output
run: cat ${{ matrix.image }}.json
```
1 change: 1 addition & 0 deletions manifest/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ runs:
fi
cmd="${cmd} ${image}"
printf "${cmd}\n"
${cmd}
shell: bash
Loading