Skip to content

Commit

Permalink
Merge branch 'master' into erin-workshop-demo
Browse files Browse the repository at this point in the history
  • Loading branch information
erinyoung authored Oct 26, 2023
2 parents 574020c + 700df21 commit 158c72e
Show file tree
Hide file tree
Showing 269 changed files with 15,783 additions and 453 deletions.
16 changes: 0 additions & 16 deletions .github/workflow-templates/readme-template.md

This file was deleted.

18 changes: 9 additions & 9 deletions .github/workflows/build-to-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Check Out Repo (+ download Git LFS dependencies) # each job runs in an isolated environment, so need to check out the repo in each job
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
lfs: true

Expand All @@ -61,10 +61,10 @@ jobs:

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers # also need to set up the cache in each job, using the same prefix (here ${{ runner.os }}-buildx) makes it sharable between jobs
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache-${{ inputs.cache }}
key: ${{ runner.os }}-buildx-${{ inputs.cache }}-${{ github.sha }}
Expand All @@ -82,13 +82,13 @@ jobs:
quay.io/${{ inputs.repository_name }}/${{ inputs.container_name }}:latest
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.docker_username }}
password: ${{ secrets.docker_access_token }}

- name: Login to Quay
uses: docker/login-action@v1
uses: docker/login-action@v2
if: ${{ inputs.push_quay }}
with:
registry: quay.io
Expand All @@ -97,7 +97,7 @@ jobs:

- name: Build and push user-defined tag to DockerHub
id: docker_build_user_defined_tag
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: ${{ inputs.path_to_context }}
file: ${{ inputs.path_to_context }}/${{ inputs.dockerfile_name }}
Expand All @@ -111,7 +111,7 @@ jobs:
- name: Build and push latest tag to DockerHub
id: docker_build_latest_tag
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
if: ${{ inputs.push_latest_tag }}
with:
context: ${{ inputs.path_to_context }}
Expand All @@ -126,7 +126,7 @@ jobs:
- name: Build and push user-defined tag to Quay
id: quay_build_user_defined_tag
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
if: ${{ inputs.push_quay }}
with:
context: ${{ inputs.path_to_context }}
Expand All @@ -141,7 +141,7 @@ jobs:
- name: Build and push latest tag to Quay
id: quay_build_latest_tag
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
if: ${{ inputs.push_quay && inputs.push_latest_tag }}
with:
context: ${{ inputs.path_to_context }}
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/build-to-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Check Out Repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache-${{ inputs.cache }}
key: ${{ runner.os }}-buildx-${{ inputs.cache }}-${{ github.sha }}
Expand All @@ -38,7 +41,7 @@ jobs:
- name: Build to test
id: docker_build_to_test
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: ${{ inputs.path_to_context }}
file: ${{ inputs.path_to_context }}/${{ inputs.dockerfile_name }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/manual-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ on:
description: "Repository name. <repository>/tool:tag (Usually staphb)"
default: "staphb"

run-name: Deploy ${{ github.event.inputs.tool }} version ${{ github.event.inputs.version }}

jobs:

# This job calls a workflow to build the image to the 'test' stage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-singularity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Check out Repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Singularity
uses: eWaterCycle/setup-singularity@v7
Expand Down
86 changes: 61 additions & 25 deletions .github/workflows/test-PR-dockerfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
outputs:
json: ${{ steps.files.outputs.added_modified }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- id: files
uses: Ana06/get-changed-files@v2.1.0
uses: Ana06/get-changed-files@v2.2.0
with:
format: 'json'
filter: 'Dockerfile'
Expand All @@ -31,60 +31,96 @@ jobs:
matrix:
added_modified: ${{ fromJson(needs.find_new_dockerfiles.outputs.json) }}
steps:
- uses: actions/checkout@v2
- name: parse file path
id: parse
run: |
tool=$(echo "${{matrix.added_modified}}" | cut -f 1 -d "/" )
version=$(echo "${{matrix.added_modified}}" | cut -f 2 -d "/" )
echo "::set-output name=tool::$tool"
echo "::set-output name=version::$version"
tool=$(echo "${{ matrix.added_modified }}" | cut -f 1 -d "/" )
version=$(echo "${{ matrix.added_modified }}" | cut -f 2 -d "/" )
echo "tool=$tool" >> $GITHUB_OUTPUT
echo "version=$version" >> $GITHUB_OUTPUT
##### --------------------------------------------------------------------------- #####
##### Attempted shortcut #####
##### Workflows still cannot be run in parrallel as of 2022-12-01 #####
##### --------------------------------------------------------------------------- #####

# - name: test
# uses: ./.github/workflows/build-to-test.yml
# with:
# path_to_context: "./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}"
# cache: ${{ steps.parse.outputs.tool }}
# I think the ideal is to call ./.github/workflows/build-to-test.yml, but I kept getting the error:
# Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/docker-builds/docker-builds/.github/workflows/build-to-test.yml'. Did you forget to run actions/checkout before running your local action?
# Instead, I've created a stop-gap by copying the steps from ./.github/workflows/build-to-test.yml to here, which seems to work fine.
# - name: test files
# uses: ./.github/workflows/build-to-test.yml
# with:
# path_to_context: "./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}"
# cache: ${{ steps.parse.outputs.tool }}

##### --------------------------------------------------------------------------- #####
##### The long way (which works) #####
##### --------------------------------------------------------------------------- #####
##### The steps of ./.github/workflows/build-to-test.yml are copied here. #####
##### --------------------------------------------------------------------------- #####

- name: Checkout
uses: actions/checkout@v3

- name: Layer check
run: |
#checking layers
warning=''
app_layer=$(grep FROM ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}/Dockerfile | grep "as app")
tst_layer=$(grep FROM ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}/Dockerfile | grep "as test")
if [ -z "$app_layer" ] ; then echo "FATAL : app layer is missing" ; warning='warning' ; fi
if [ -z "$tst_layer" ] ; then echo "FATAL : test layer is missing" ; warning='warning' ; fi
if [ -n "$warning" ] ; then echo "Please see template for recommended format https://github.com/StaPH-B/docker-builds/blob/master/dockerfile-template/Dockerfile" ; exit 1 ; fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache-${{ steps.parse.outputs.tool }}
key: ${{ runner.os }}-buildx-${{ steps.parse.outputs.tool }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ steps.parse.outputs.tool }}
- name: Build to test
id: docker_build_to_test
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}
file: ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}/Dockerfile
target: test
tags: ${{ steps.parse.outputs.tool }}:${{ steps.parse.outputs.version }}
load: true
push: false
cache-from: type=local,src=/tmp/.buildx-cache-${{ steps.parse.outputs.tool }}
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-${{ steps.parse.outputs.tool }}-new

- name: Check labels
run: |
# checking labels
warning=''
for label in base.image dockerfile.version software software.version description website maintainer maintainer.email
do
value=$(docker inspect --format '{{ index .Config.Labels "'$label'"}}' ${{ steps.parse.outputs.tool }}:${{ steps.parse.outputs.version }} )
if [ -z "$value" ] ; then warning='warning' ; echo "FATAL : $label label not found in ${{ steps.parse.outputs.tool }}:${{ steps.parse.outputs.version }}" ; fi
done
if [ -z "$(docker inspect --format '{{.Config.WorkingDir}}' ${{ steps.parse.outputs.tool }}:${{ steps.parse.outputs.version }} )" ] ;
then
warning='warning'
echo "FATAL : WORKDIR not set."
fi
if [ -n "$warning" ] ; then echo "Please see template for recommended format https://github.com/StaPH-B/docker-builds/blob/master/dockerfile-template/Dockerfile" ; exit 1 ; fi
- name: Check commonly overlooked commands
run: |
# checking commands
docker run ${{ steps.parse.outputs.tool }}:${{ steps.parse.outputs.version }} ps --help
- name: Move cache # apparently prevents the cache from growing in size forever
run: |
rm -rf /tmp/.buildx-cache-${{ steps.parse.outputs.tool }}
mv /tmp/.buildx-cache-${{ steps.parse.outputs.tool }}-new /tmp/.buildx-cache-${{ steps.parse.outputs.tool }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

25 changes: 25 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# shamelessly stolen and modified from: https://github.com/rpetit3/pasty/blob/main/.gitpod.yml

# includes docker, nextflow, conda, mamba
# I believe this is the source dockerfile for nfcore/gitpod:latest https://github.com/seqeralabs/nf-training-public/blob/master/docker/Dockerfile
image: nfcore/gitpod:latest

tasks:
- name: Initialize
init: |
pip install graphviz
. /opt/conda/etc/profile.d/conda.sh
conda activate base
git checkout main
vscode:
extensions: # based on nf-core.nf-core-extensionpack
- codezombiech.gitignore # Language support for .gitignore files
- davidanson.vscode-markdownlint # Markdown/CommonMark linting and style checking for Visual Studio Code
- eamodio.gitlens # Quickly glimpse into whom, why, and when a line or code block was changed
- EditorConfig.EditorConfig # override user/workspace settings with settings found in .editorconfig files
- Gruntfuggly.todo-tree # Display TODO and FIXME in a tree view in the activity bar
- mechatroner.rainbow-csv # Highlight columns in csv files in different colors
- nextflow.nextflow # Nextflow syntax highlighting
- oderwat.indent-rainbow # Highlight indentation level
- streetsidesoftware.code-spell-checker # Spelling checker for source code
- anwar.papyrus-pdf # PDF preview
95 changes: 95 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Citizen Code of Conduct

## 1. Purpose

A primary goal of StaPH-B/docker-builds is to be inclusive to the every bioinformatician in public health (or adjacent interests), with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).

This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.

We invite all those who participate in Docker Builds to help us create safe and positive experiences for everyone.

## 2. Open [Source/Culture/Tech] Citizenship

A supplemental goal of this Code of Conduct is to increase open [source/culture/tech] citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community.

Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society.

## 3. Expected Behavior

The following behaviors are expected and requested of all community members:

* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community.
* Exercise consideration and respect in your speech and actions.
* Attempt collaboration before conflict.
* Refrain from demeaning, discriminatory, or harassing behavior and speech.
* Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential.
* Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations.

## 4. Unacceptable Behavior

The following behaviors are considered harassment and are unacceptable within our community:

* Violence, threats of violence or violent language directed against another person.
* Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language.
* Posting or displaying sexually explicit or violent material.
* Posting or threatening to post other people's personally identifying information ("doxing").
* Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
* Inappropriate photography or recording.
* Inappropriate physical contact. You should have someone's consent before touching them.
* Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances.
* Deliberate intimidation, stalking or following (online or in person).
* Advocating for, or encouraging, any of the above behavior.
* Sustained disruption of community events, including talks and presentations.

## 5. Weapons Policy

No weapons will be allowed at StaPH-B/docker-builds events, community spaces, or in other spaces covered by the scope of this Code of Conduct. Weapons include but are not limited to guns, explosives (including fireworks), and large knives such as those used for hunting or display, as well as any other item used for the purpose of causing injury or harm to others. Anyone seen in possession of one of these items will be asked to leave immediately, and will only be allowed to return without the weapon. Community members are further expected to comply with all state and local laws on this matter.

## 6. Consequences of Unacceptable Behavior

Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated.

Anyone asked to stop unacceptable behavior is expected to comply immediately.

If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event).

## 7. Reporting Guidelines

If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible.

A community organizer includes
- [Erin Young](eriny@utah.gov)
- [Curtis Kapsak](kapsakcj@gmail.com)
- Anyone on the StaPH-B steering committee

Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress.

## 8. Addressing Grievances

If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify StaPH-B with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.



## 9. Scope

We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venues--online and in-person--as well as in all one-on-one communications pertaining to community business.

This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members.

## 10. Contact info

If somebody is observed to be in breach of this code of conduct, please contact Curtis (kapsakcj@gmail.com) and Erin (eriny@utah.gov) privately via email.

## 11. License and attribution

The Citizen Code of Conduct is distributed by [Stumptown Syndicate](http://stumptownsyndicate.org) under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).

Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).

_Revision 2.3. Posted 6 March 2017._

_Revision 2.2. Posted 4 February 2016._

_Revision 2.1. Posted 23 June 2014._

_Revision 2.0, adopted by the [Stumptown Syndicate](http://stumptownsyndicate.org) board on 10 January 2013. Posted 17 March 2013._
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Thank you for your interest in contributing to the StaPH-B/docker-builds repository!

Please see [https://staphb.org/docker-builds/contribute/](https://staphb.org/docker-builds/contribute/) for more information on how to contribute.
Loading

0 comments on commit 158c72e

Please sign in to comment.