Skip to content

Commit

Permalink
initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
espenhgn committed Sep 27, 2024
1 parent f40d430 commit cd3f20a
Show file tree
Hide file tree
Showing 18 changed files with 221 additions and 487 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Changes proposed in this pull request:
## Before submitting

<!-- Please complete this checklist BEFORE submitting your PR to speed along the review process. -->
- [ ] I've read and followed all steps in the [Making a pull request](https://github.com/precimed/container_template/blob/main/CONTRIBUTING.md#making-a-pull-request)
- [ ] I've read and followed all steps in the [Making a pull request](https://github.com/comorment/mtag_container/blob/main/CONTRIBUTING.md#making-a-pull-request)
section of the `CONTRIBUTING` docs.
- [ ] I've updated or added any relevant docstrings following the syntax described in the
[Writing docstrings](https://github.com/precimed/container_template/blob/main/CONTRIBUTING.md#writing-docstrings) section of the `CONTRIBUTING` docs.
[Writing docstrings](https://github.com/comorment/mtag_container/blob/main/CONTRIBUTING.md#writing-docstrings) section of the `CONTRIBUTING` docs.
- [ ] If this PR fixes a bug, I've added a test that will fail without my fix.
- [ ] If this PR adds a new feature, I've added tests that sufficiently cover my new functionality.
10 changes: 5 additions & 5 deletions .github/workflows/container_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
tags:
- "v*.*.*"
env:
TEST_TAG: ghcr.io/precimed/container_template:test
# LATEST_TAG: ghcr.io/precimed/container_template:latest
TEST_TAG: ghcr.io/comorment/mtag_container:test
# LATEST_TAG: ghcr.io/comorment/mtag_container:latest

jobs:
docker:
Expand All @@ -25,7 +25,7 @@ jobs:
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository_owner }}/container_template
ghcr.io/${{ github.repository_owner }}/mtag_container
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
load: true
tags: ${{ env.TEST_TAG }}
file:
./dockerfiles/container_template/Dockerfile
./dockerfiles/mtag_container/Dockerfile

- name: Run unit tests
run: |
Expand All @@ -69,5 +69,5 @@ jobs:
load: True
tags: ${{ steps.meta.outputs.tags }}
file:
./dockerfiles/container_template/Dockerfile
./dockerfiles/mtag_container/Dockerfile
platforms: linux/amd64
18 changes: 9 additions & 9 deletions .github/workflows/container_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "v*.*.*"

env:
TEST_TAG: ghcr.io/precimed/container_template:test
TEST_TAG: ghcr.io/comorment/mtag_container:test

jobs:
docker:
Expand All @@ -20,7 +20,7 @@ jobs:
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository_owner }}/container_template
ghcr.io/${{ github.repository_owner }}/mtag_container
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
load: true
tags: ${{ env.TEST_TAG }}
file:
./dockerfiles/container_template/Dockerfile
./dockerfiles/mtag_container/Dockerfile
- name: Test
run: |
docker run --rm -v ${{ github.workspace }}:/home ${{ env.TEST_TAG }} py.test -v tests
Expand All @@ -63,7 +63,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file:
./dockerfiles/container_template/Dockerfile
./dockerfiles/mtag_container/Dockerfile
platforms: linux/amd64

build-apptainer-container:
Expand All @@ -81,7 +81,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/container_template
ghcr.io/${{ github.repository_owner }}/mtag_container
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
Expand All @@ -94,10 +94,10 @@ jobs:
IFS= read -r first_tag <<EOF
$tags
EOF
push_tags="$(printf $csv_tags | sed -e "s/container_template/container_template_sif/g")"
push_tags="$(printf $csv_tags | sed -e "s/mtag_container/mtag_container_sif/g")"
echo ${{ secrets.GITHUB_TOKEN }} | oras login --username ${{ github.repository_owner }} --password-stdin ghcr.io
docker pull kaczmarj/apptainer:latest
docker run --rm --privileged -v $(pwd):/work kaczmarj/apptainer build container_template.sif docker://"$first_tag"
oras push "$push_tags" container_template.sif
rm container_template.sif
docker run --rm --privileged -v $(pwd):/work kaczmarj/apptainer build mtag_container.sif docker://"$first_tag"
oras push "$push_tags" mtag_container.sif
rm mtag_container.sif
shell: sh
36 changes: 18 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Thanks for considering contributing! Please read this document to learn the vari

### Did you find a bug?

First, do [a quick search](https://github.com/precimed/container_template/issues) to see whether your issue has already been reported.
First, do [a quick search](https://github.com/comorment/mtag_container/issues) to see whether your issue has already been reported.
If your issue has already been reported, please comment on the existing issue.

Otherwise, open [a new GitHub issue](https://github.com/precimed/container_template/issues). Be sure to include a clear title
Otherwise, open [a new GitHub issue](https://github.com/comorment/mtag_container/issues). Be sure to include a clear title
and description. The description should include as much relevant information as possible. The description should
explain how to reproduce the erroneous behavior as well as the behavior you expect to see. Ideally you would include a
code sample or an executable test case demonstrating the expected behavior.
Expand All @@ -21,7 +21,7 @@ We use GitHub issues to track feature requests. Before you create a feature requ
* Make sure you have a clear idea of the enhancement you would like. If you have a vague idea, consider discussing
it first on a GitHub issue.
* Check the documentation to make sure your feature does not already exist.
* Do [a quick search](https://github.com/precimed/container_template/issues) to see whether your feature has already been suggested.
* Do [a quick search](https://github.com/comorment/mtag_container/issues) to see whether your feature has already been suggested.

When creating your request, please:

Expand All @@ -41,37 +41,37 @@ When you're ready to contribute code to address an open issue, please follow the

Then clone your fork locally with

git clone https://github.com/USERNAME/container_template.git
git clone https://github.com/USERNAME/mtag_container.git

or

git clone [email protected]:USERNAME/container_template.git
git clone [email protected]:USERNAME/mtag_container.git

At this point the local clone of your fork only knows that it came from *your* repo, github.com/USERNAME/container_template.git, but doesn't know anything the *main* repo, [https://github.com/precimed/container_template.git](https://github.com/precimed/container_template). You can see this by running
At this point the local clone of your fork only knows that it came from *your* repo, github.com/USERNAME/mtag_container.git, but doesn't know anything the *main* repo, [https://github.com/comorment/mtag_container.git](https://github.com/comorment/mtag_container). You can see this by running

git remote -v

which will output something like this:

origin https://github.com/USERNAME/container_template.git (fetch)
origin https://github.com/USERNAME/container_template.git (push)
origin https://github.com/USERNAME/mtag_container.git (fetch)
origin https://github.com/USERNAME/mtag_container.git (push)

This means that your local clone can only track changes from your fork, but not from the main repo, and so you won't be able to keep your fork up-to-date with the main repo over time. Therefore you'll need to add another "remote" to your clone that points to [https://github.com/precimed/container_template.git](https://github.com/precimed/container_template). To do this, run the following:
This means that your local clone can only track changes from your fork, but not from the main repo, and so you won't be able to keep your fork up-to-date with the main repo over time. Therefore you'll need to add another "remote" to your clone that points to [https://github.com/comorment/mtag_container.git](https://github.com/comorment/mtag_container). To do this, run the following:

git remote add upstream https://github.com/precimed/container_template.git
git remote add upstream https://github.com/comorment/mtag_container.git

Now if you do `git remote -v` again, you'll see

origin https://github.com/USERNAME/container_template.git (fetch)
origin https://github.com/USERNAME/container_template.git (push)
upstream https://github.com/precimed/container_template.git (fetch)
upstream https://github.com/precimed/container_template.git (push)
origin https://github.com/USERNAME/mtag_container.git (fetch)
origin https://github.com/USERNAME/mtag_container.git (push)
upstream https://github.com/comorment/mtag_container.git (fetch)
upstream https://github.com/comorment/mtag_container.git (push)

2. **Ensure your fork is up-to-date**

<details><summary>Expand details 👇</summary><br/>

Once you've added an "upstream" remote pointing to [https://github.com/precimed/container_template.git](https://github.com/precimed/container_template), keeping your fork up-to-date is easy:
Once you've added an "upstream" remote pointing to [https://github.com/comorment/mtag_container.git](https://github.com/comorment/mtag_container), keeping your fork up-to-date is easy:

git checkout main # if not already on main
git pull --rebase upstream main
Expand All @@ -97,12 +97,12 @@ When you're ready to contribute code to address an open issue, please follow the

<details><summary>Expand details 👇</summary><br/>

Our continuous integration (CI) testing runs [a number of checks](https://github.com/precimed/container_template/actions) for each pull request on [GitHub Actions](https://github.com/features/actions).
Our continuous integration (CI) testing runs [a number of checks](https://github.com/comorment/mtag_container/actions) for each pull request on [GitHub Actions](https://github.com/features/actions).
You can run most of these tests locally, which is something you should do *before* opening a PR to help speed up the review process and make it easier for us.

And finally, please update the [CHANGELOG](https://github.com/precimed/container_template/blob/main/CHANGELOG.md) with notes on your contribution in the "Unreleased" section at the top.
And finally, please update the [CHANGELOG](https://github.com/comorment/mtag_container/blob/main/CHANGELOG.md) with notes on your contribution in the "Unreleased" section at the top.

After all of the above checks have passed, you can now open [a new GitHub pull request](https://github.com/precimed/container_template/pulls).
After all of the above checks have passed, you can now open [a new GitHub pull request](https://github.com/comorment/mtag_container/pulls).
Make sure you have a clear description of the problem and the solution, and include a link to relevant issues.

We look forward to reviewing your PR!
Expand Down
Loading

0 comments on commit cd3f20a

Please sign in to comment.