Skip to content

Commit

Permalink
Merge branch 'master' into erin-kaptive
Browse files Browse the repository at this point in the history
  • Loading branch information
erinyoung authored Feb 8, 2024
2 parents db106de + d195191 commit 436ff19
Show file tree
Hide file tree
Showing 54 changed files with 2,804 additions and 20 deletions.
140 changes: 140 additions & 0 deletions .github/workflows/update_freyja.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
##### ------------------------------------------------------------------------------------------------ #####
##### This caller workflow tests, builds, and pushes the image to Docker Hub and Quay using the most #####
##### recent version of Freyja and downloading the most recent variant information. #####
##### It takes no manual input. #####
##### ------------------------------------------------------------------------------------------------ #####

name: Update Freyja

on:
workflow_dispatch:
schedule:
- cron: '30 7 * * *'

run-name: Updating Freyja

jobs:
update:
runs-on: ubuntu-latest
steps:

# Keeping here in case we want to use it to keep Freyja's version up-to-date as well
# - name: Get latest release
# uses: rez0n/actions-github-release@main
# id: latest_release
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# repository: andersen-lab/Freyja
# type: "stable"
# - name: Remove V
# id: strip
# run: |
# version=$(echo "${{ steps.latest_release.outputs.release }}" | sed 's/V//g' | sed 's/v//g' )
# echo "The version is $version"
# echo "version=$version" >> $GITHUB_OUTPUT

- name: pull repo
uses: actions/checkout@v3

# Keeping here in case we want to figure out why this doesn't work
# - name: get latest version of freyja in docker-builds repo
# id: latest_version
# run: |
# file=$(git log -1 --name-only --format=%cd --date=iso freyja/*/Dockerfile | grep Dockerfile | head -n 1 )
# echo "the latest file is $file"
# echo "file=$file" >> $GITHUB_OUTPUT
#
# version=$(echo $file | cut -f 2 -d "/" | cut -f 1 -d "_")
# echo "the latest version is $version"
# echo "version=$version" >> $GITHUB_OUTPUT

- name: set freyja version
id: latest_version
run: |
version=1.4.8
echo "version=$version" >> $GITHUB_OUTPUT
file=freyja/$version/Dockerfile
ls $file
echo "file=$file" >> $GITHUB_OUTPUT
- name: set up docker buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: cache docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache-freyja
key: ${{ runner.os }}-buildx-freyja-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx-freyja

- name: build to test
id: docker_build_to_test
uses: docker/build-push-action@v3
with:
file: ${{ steps.latest_version.outputs.file }}
target: test
load: true
push: false
cache-from: type=local,src=/tmp/.buildx-cache-freyja
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-freyja-new
tags: freyja:update

- name: get freyja database version
id: db_version
run: |
docker run freyja:update freyja demix --version
version=$(docker run freyja:update freyja demix --version | grep . | grep -v Barcode | head -n 1)
echo "the latest version is $version"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Get current date
id: date
run: |
date=$(date '+%Y-%m-%d')
echo "the date is $date"
echo "date=$date" >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to Quay
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Build and push user-defined tag to DockerHub
id: docker_build_user_defined_tag
uses: docker/build-push-action@v3
with:
file: ${{ steps.latest_version.outputs.file }}
target: app
push: true
cache-from: type=local,src=/tmp/.buildx-cache-freyja
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-freyja-new # mode=max means export layers from all stage to cache
tags: staphb/freyja:${{ steps.latest_version.outputs.version }}-${{ steps.db_version.outputs.version }}-${{ steps.date.outputs.date }}

- name: Build and push to Quay
id: build
uses: docker/build-push-action@v3
with:
file: ${{ steps.latest_version.outputs.file }}
target: app
push: true
cache-from: type=local,src=/tmp/.buildx-cache-freyja
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-freyja-new # mode=max means export
tags: quay.io/staphb/freyja:${{ steps.latest_version.outputs.version }}-${{ steps.db_version.outputs.version }}-${{ steps.date.outputs.date }}

- name: Move cache # apparently prevents the cache from growing in size forever
run: |
rm -rf /tmp/.buildx-cache-freyja
mv /tmp/.buildx-cache-freyja-new /tmp/.buildx-cache-freyja
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
8 changes: 7 additions & 1 deletion Program_Licenses.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The licenses of the open-source software that is contained in these Docker image
| ARIBA | GNU GPLv3 | https://github.com/sanger-pathogens/ariba/blob/master/LICENSE |
| Augur | GNU Affero GPLv3 | https://github.com/nextstrain/augur/blob/master/LICENSE.txt |
| Auspice | GNU Affero GPLv3 | https://github.com/nextstrain/auspice/blob/master/LICENSE.txt |
| Bakta | GNU GPLv3 | https://github.com/oschwengers/bakta/blob/main/LICENSE |
| BBTools | non-standard - see `licence.txt` and `legal.txt` that is included in docker image under `/bbmap/docs/`; Also on sourceforge repo for BBTools | https://jgi.doe.gov/disclaimer/ |
| bcftools | MIT or **GNU GPLv3** (depends on how bcftools was compiled, I believe GNU GPLv3 applies here) | https://github.com/samtools/bcftools/blob/develop/LICENSE |
| bedtools | MIT | https://github.com/arq5x/bedtools2/blob/master/LICENSE |
Expand All @@ -30,6 +31,7 @@ The licenses of the open-source software that is contained in these Docker image
| Circlator | GNU GPLv3 | https://github.com/sanger-pathogens/circlator/blob/master/LICENSE |
| colorid | MIT | https://github.com/hcdenbakker/colorid/blob/master/LICENSE |
| datasets-sars-cov-2 | Apache 2.0 | https://github.com/CDCgov/datasets-sars-cov-2/blob/master/LICENSE |
| diamond | GNU GPLv3 | https://github.com/bbuchfink/diamond/blob/master/LICENSE |
| dnaapler | MIT | https://github.com/gbouras13/dnaapler/blob/main/LICENSE |
| dragonflye | GNU GPLv3 | https://github.com/rpetit3/dragonflye/blob/main/LICENSE |
| drprg | MIT | https://github.com/mbhall88/drprg/blob/main/LICENSE |
Expand All @@ -40,6 +42,7 @@ The licenses of the open-source software that is contained in these Docker image
| emm-typing-tool | GNU GPLv3 | https://github.com/phe-bioinformatics/emm-typing-tool/blob/master/LICENCE |
| EToKi | GNU GPLv3 | https://github.com/zheminzhou/EToKi/blob/master/LICENSE |
| FastANI | Apache v2.0 | https://github.com/ParBLiSS/FastANI/blob/master/LICENSE |
| fasten | MIT | https://github.com/lskatz/fasten/blob/master/LICENSE |
| Fastp | MIT | https://github.com/OpenGene/fastp/blob/master/LICENSE |
| FastTree | GNU GPLv2 | http://www.microbesonline.org/fasttree/ |
| FastQC | GNU GPLv3 | https://github.com/s-andrews/FastQC/blob/master/LICENSE.txt |
Expand All @@ -55,6 +58,7 @@ The licenses of the open-source software that is contained in these Docker image
| geNomad | ACADEMIC, INTERNAL, RESEARCH & DEVELOPMENT, NON-COMMERCIAL USE ONLY | https://github.com/apcamargo/genomad/blob/main/LICENSE |
| GenoVi | BY-NC-SA Creative Commons License | https://github.com/robotoD/GenoVi/blob/main/LICENSE.txt |
| gfastats | MIT | https://github.com/vgl-hub/gfastats/blob/main/LICENSE |
| HeatCluster | GPL-3.0 | https://github.com/DrB-S/heatcluster/blob/main/LICENSE |
| Hmmer | BSD-3 | http://eddylab.org/software/hmmer/Userguide.pdf |
| homopolish | GNU GPLv3 | https://github.com/ythuang0522/homopolish/blob/master/LICENSE |
| htslib | MIT | https://github.com/samtools/htslib/blob/develop/LICENSE |
Expand All @@ -68,8 +72,10 @@ The licenses of the open-source software that is contained in these Docker image
| kma | Apache v2.0 | https://bitbucket.org/genomicepidemiology/kma/src/master/ |
| Kraken | GNU GPLv3 | https://github.com/DerrickWood/kraken/blob/master/LICENSE |
| Kraken2 | MIT | https://github.com/DerrickWood/kraken2/blob/master/LICENSE |
| KrakenUniq | GNU GPLv3 | https://github.com/fbreitwieser/krakenuniq/blob/master/LICENSE |
| kSNP3 | BSD | available in zipped kSNP archive on sourceforge or in docker image under `/kSNP3.1_Linux_package/THE BSD OPENSOURCE LICENSE.pdf` |
| kSNP4 | BSD | available in zipped kSNP archive on sourceforge or in docker image under `/opt/kSNP4 Linux package/Documentation/THE BSD OPENSOURCE LICENSE.pdf` |
| LABEL | GPL version 3 | In zipped file in README.md |
| legsta | GNU GPLv3 | https://github.com/tseemann/legsta/blob/master/LICENSE |
| liftoff | GNU GPLv3 | https://github.com/agshumate/Liftoff/blob/master/LICENSE.md |
| longshot | MIT | https://github.com/pjedge/longshot/blob/master/LICENSE |
Expand Down Expand Up @@ -117,7 +123,7 @@ The licenses of the open-source software that is contained in these Docker image
| pyGenomeViz | MIT | https://github.com/moshi4/pyGenomeViz/blob/main/LICENSE |
| QUAST | GNU GPLv2 | https://github.com/ablab/quast/blob/master/LICENSE.txt |
| QuickSNP | GNU GPLv3 | https://github.com/k-florek/QuickSNP/blob/main/LICENSE |
| racon | MIT | https://github.com/isovic/racon/blob/master/LICENSE |
| racon | MIT | https://github.com/lbcb-sci/racon/blob/master/LICENSE ; https://github.com/isovic/racon/blob/master/LICENSE |
| rasusa | MIT | https://github.com/mbhall88/rasusa/blob/master/LICENSE |
| raven | MIT | https://github.com/lbcb-sci/raven/blob/master/LICENSE |
| RAxML <br/> RAxML Next Generation | GNU GPLv3 (RAxML), <br/> GNU Affero GPLv3 (RAxML Next Generation)| https://github.com/stamatak/standard-RAxML/blob/master/gpl-3.0.txt <br/> https://github.com/amkozlov/raxml-ng/blob/master/LICENSE.txt |
Expand Down
Loading

0 comments on commit 436ff19

Please sign in to comment.