Skip to content

Commit

Permalink
update multiple GHActions workflows & new mlst update (#881)
Browse files Browse the repository at this point in the history
* update multiple GHActions workflows to supress node.js warnings. lots of versions upgraded

* more CI upgrades and a bugfix on the last variable reference

* add dockerfile, readme, tests script for mlst with databases updated on 2024-03-08. also updated main readme. Not sure if it builds successfully yet

* update test for novel allele which is no longer novel, and update dockerfile so that it builds successfully

* update versions of github actions workflows used in the update_freyja workflow as well as the Test New Dockerfiles ghactions workflow

* update readme to reflect date that the docker image will be built
  • Loading branch information
kapsakcj authored Mar 8, 2024
1 parent 4e44db4 commit e902f64
Show file tree
Hide file tree
Showing 9 changed files with 229 additions and 34 deletions.
20 changes: 10 additions & 10 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@v3
uses: actions/checkout@v4
with:
lfs: true

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

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

- 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@v3
uses: actions/cache@v4
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@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.docker_username }}
password: ${{ secrets.docker_access_token }}

- name: Login to Quay
uses: docker/login-action@v2
uses: docker/login-action@v3
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@v3
uses: docker/build-push-action@v5
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@v3
uses: docker/build-push-action@v5
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@v3
uses: docker/build-push-action@v5
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@v3
uses: docker/build-push-action@v5
if: ${{ inputs.push_quay && inputs.push_latest_tag }}
with:
context: ${{ inputs.path_to_context }}
Expand All @@ -160,4 +160,4 @@ jobs:
mv /tmp/.buildx-cache-${{ inputs.cache }}-new /tmp/.buildx-cache-${{ inputs.cache }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
run: echo ${{ steps.docker_build_user_defined_tag.outputs.digest }}
12 changes: 6 additions & 6 deletions .github/workflows/build-to-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Check Out Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

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

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

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache-${{ inputs.cache }}
key: ${{ runner.os }}-buildx-${{ inputs.cache }}-${{ github.sha }}
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Build to test
id: docker_build_to_test
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: ${{ inputs.path_to_context }}
file: ${{ inputs.path_to_context }}/${{ inputs.dockerfile_name }}
Expand All @@ -56,4 +56,4 @@ jobs:
mv /tmp/.buildx-cache-${{ inputs.cache }}-new /tmp/.buildx-cache-${{ inputs.cache }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
run: echo ${{ steps.docker_build_to_test.outputs.digest }}
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@v3
uses: actions/checkout@v4

- name: Set up Singularity
uses: eWaterCycle/setup-singularity@v7
Expand Down
16 changes: 8 additions & 8 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@v3
- uses: actions/checkout@v4
- id: files
uses: Ana06/get-changed-files@v2.2.0
uses: Ana06/get-changed-files@v2.3.0
with:
format: 'json'
filter: 'Dockerfile'
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
##### --------------------------------------------------------------------------- #####

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Layer check
run: |
Expand All @@ -67,14 +67,14 @@ jobs:
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
uses: docker/setup-qemu-action@v3

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

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache-${{ steps.parse.outputs.tool }}
key: ${{ runner.os }}-buildx-${{ steps.parse.outputs.tool }}-${{ github.sha }}
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Build to test
id: docker_build_to_test
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}
file: ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}/Dockerfile
Expand Down Expand Up @@ -123,4 +123,4 @@ jobs:
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 }}
run: echo ${{ steps.docker_build_to_test.outputs.digest }}
16 changes: 8 additions & 8 deletions .github/workflows/update_freyja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# echo "version=$version" >> $GITHUB_OUTPUT

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

# Keeping here in case we want to figure out why this doesn't work
# - name: get latest version of freyja in docker-builds repo
Expand All @@ -60,11 +60,11 @@ jobs:
- name: set up docker buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: build to test
id: docker_build_to_test
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
file: ${{ steps.latest_version.outputs.file }}
target: test
Expand All @@ -88,21 +88,21 @@ jobs:
echo "date=$date" >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

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

- name: Build and push user-defined tag to DockerHub
id: docker_build_user_defined_tag
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
file: ${{ steps.latest_version.outputs.file }}
target: app
Expand All @@ -111,12 +111,12 @@ jobs:

- name: Build and push to Quay
id: build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
file: ${{ steps.latest_version.outputs.file }}
target: app
push: true
tags: quay.io/staphb/freyja:${{ steps.latest_version.outputs.version }}-${{ steps.db_version.outputs.version }}-${{ steps.date.outputs.date }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
run: echo ${{ steps.docker_build_user_defined_tag.outputs.digest }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ To learn more about the docker pull rate limits and the open source software pro
| [MIDAS](https://hub.docker.com/r/staphb/midas) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/midas)](https://hub.docker.com/r/staphb/midas) | <ul><li>1.3.2 (no database)</li> | https://github.com/snayfach/MIDAS |
| [minimap2](https://hub.docker.com/r/staphb/minimap2) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/minimap2)](https://hub.docker.com/r/staphb/minimap2) | <ul><li>2.17</li><li>2.18</li><li>2.21</li><li>2.22</li><li>2.23</li><li>2.24</li><li>2.25</li><li>[2.26](./minimap2/2.26)</li></ul> | https://github.com/lh3/minimap2 |
| [minipolish](https://hub.docker.com/r/staphb/minipolish) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/minipolish)](https://hub.docker.com/r/staphb/minipolish) | <ul><li>0.1.3</li></ul> | https://github.com/rrwick/Minipolish |
| [mlst](https://hub.docker.com/r/staphb/mlst) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/mlst)](https://hub.docker.com/r/staphb/mlst) | <ul><li>2.16.2</li><li>2.17.6</li><li>2.19.0</li><li>2.22.0</li><li>2.22.1</li><li>2.23.0</li><li>[2.23.0-2023-07 (databases updated July 2023)](mlst/2.23.0-2023-07/)</li><li>[2.23.0-2023-08 (databases updated Aug 2023)](mlst/2.23.0-2023-08/)</li><li>[2.23.0-2024-01 (databases updated Jan 2024)](mlst/2.23.0-2024-01/)</li></ul> | https://github.com/tseemann/mlst |
| [mlst](https://hub.docker.com/r/staphb/mlst) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/mlst)](https://hub.docker.com/r/staphb/mlst) | <ul><li>2.16.2</li><li>2.17.6</li><li>2.19.0</li><li>2.22.0</li><li>2.22.1</li><li>2.23.0</li><li>[2.23.0-2023-07 (databases updated July 2023)](mlst/2.23.0-2023-07/)</li><li>[2.23.0-2023-08 (databases updated Aug 2023)](mlst/2.23.0-2023-08/)</li><li>[2.23.0-2024-01 (databases updated Jan 2024)](mlst/2.23.0-2024-01/)</li><li>[2.23.0-2024-03 (databases updated March 2024)](mlst/2.23.0-2024-03/)</li></ul> | https://github.com/tseemann/mlst |
| [Mugsy](https://hub.docker.com/r/staphb/mugsy) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/mugsy)](https://hub.docker.com/r/staphb/mugsy) | <ul><li>1r2.3</li></ul> | http://mugsy.sourceforge.net/ |
| [MultiQC](https://hub.docker.com/r/staphb/multiqc) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/multiqc)](https://hub.docker.com/r/staphb/multiqc) | <ul><li>1.7</li><li>[1.8](./multiqc/1.8/)</li><li>[1.18](./multiqc/1.18/)</li><li>[1.19](./multiqc/1.19/)</li></ul> | https://github.com/ewels/MultiQC |
| [Mummer](https://hub.docker.com/r/staphb/mummer) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/mummer)](https://hub.docker.com/r/staphb/mummer) | <ul><li>4.0.0</li><li>4.0.0 + RGDv2</li><li>4.0.0 + RGDv2 + gnuplot</li></ul> | https://github.com/mummer4/mummer |
Expand Down
109 changes: 109 additions & 0 deletions mlst/2.23.0-2024-03/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
FROM ubuntu:jammy as app

ARG MLST_VER="2.23.0"
ARG ANY2FASTA_VER="0.4.2"

LABEL base.image="ubuntu:jammy"
LABEL dockerfile.version="1"
LABEL software="mlst"
LABEL software.version="${MLST_VER}"
LABEL description="Scan contig files against PubMLST typing schemes"
LABEL website="https://github.com/tseemann/mlst"
LABEL license="https://github.com/tseemann/mlst/blob/master/LICENSE"
LABEL maintainer="Inês Mendes"
LABEL maintainer.email="[email protected]"
LABEL maintainer2="Curtis Kapsak"
LABEL maintainer2.email="[email protected]"

# install dependencies via apt; cleanup apt garbage
# blast from ubuntu:jammy is v2.12.0 (as of 2023-07-05)
# deps needed specifically for db download scripts: libfile-which-perl, curl, parallel
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
ca-certificates \
libmoo-perl \
liblist-moreutils-perl \
libjson-perl \
gzip \
file \
ncbi-blast+ \
libfile-which-perl \
curl \
parallel \
procps && \
apt-get autoclean && rm -rf /var/lib/apt/lists/*

# get any2fasta; move binary to /usr/local/bin which is already in $PATH
RUN wget https://github.com/tseemann/any2fasta/archive/refs/tags/v${ANY2FASTA_VER}.tar.gz && \
tar xzf v${ANY2FASTA_VER}.tar.gz && \
rm v${ANY2FASTA_VER}.tar.gz && \
chmod +x any2fasta-${ANY2FASTA_VER}/any2fasta && \
mv -v any2fasta-${ANY2FASTA_VER}/any2fasta /usr/local/bin

# get mlst
RUN wget https://github.com/tseemann/mlst/archive/v${MLST_VER}.tar.gz && \
tar -xzf v${MLST_VER}.tar.gz && \
rm -v v${MLST_VER}.tar.gz

# set PATH and perl local settings
ENV PATH="${PATH}:/mlst-${MLST_VER}/bin:" \
LC_ALL=C.UTF-8

# check dependencies and list available schemes
RUN mlst --check && mlst --list

# update databases, following steps from here, but modified after much trial and error: https://github.com/tseemann/mlst#updating-the-database
# delete the old databases instead of renaming & saving the dir
RUN cd /mlst-${MLST_VER}/scripts && \
mkdir -v db-downloaded-$(date -I) && \
./mlst-download_pub_mlst -d db-downloaded-$(date -I) | bash && \
rm -rv /mlst-${MLST_VER}/db/pubmlst && \
mv -v db-downloaded-$(date -I) /mlst-${MLST_VER}/db/pubmlst && \
./mlst-make_blast_db && \
mlst --list

WORKDIR /data

# default command is to pull up help options; can be overridden of course
CMD ["mlst", "--help"]

### start of test stage ###
# using app stage as base image for test stage
FROM app as test

# copy in test script; run script
# test commands stolen shamelessly from https://github.com/tseemann/mlst/blob/master/.travis.yml
COPY mlst-tests.sh .
RUN bash mlst-tests.sh

# need unzip for the datasets tool
RUN apt-get update && apt-get install -y --no-install-recommends unzip

# for pinning the version of NCBI datasets that is downloaded for this test
ARG DATASETS_VER="16.2.0"

# install ncbi datasets tool (pre-compiled binary)
RUN wget https://github.com/ncbi/datasets/releases/download/v${DATASETS_VER}/linux-amd64.cli.package.zip && \
unzip linux-amd64.cli.package.zip && \
rm linux-amd64.cli.package.zip && \
chmod +x dataformat datasets

# downloading an E. coli (from CT) with a known newer sequence type ST15199 which was designated on 2023-10-16
# MLST scheme info here (from Enterobase): https://pubmlst.org/bigsdb?page=profileInfo&db=pubmlst_escherichia_seqdef&scheme_id=1&profile_id=15199
# E. coli genome: https://www.ncbi.nlm.nih.gov/datasets/genome/GCA_032604515.1/
# BioSample: SAMN37796909
ARG GENBANK_ACCESSION="GCA_032604515.1"
RUN datasets download genome accession ${GENBANK_ACCESSION} --filename ${GENBANK_ACCESSION}.zip && \
mkdir -v ${GENBANK_ACCESSION}-download && \
unzip ${GENBANK_ACCESSION}.zip -d ${GENBANK_ACCESSION}-download && \
rm -v ${GENBANK_ACCESSION}.zip && \
mv -v ${GENBANK_ACCESSION}-download/ncbi_dataset/data/${GENBANK_ACCESSION}/${GENBANK_ACCESSION}*.fna ${GENBANK_ACCESSION}-download/ncbi_dataset/data/${GENBANK_ACCESSION}/${GENBANK_ACCESSION}.genomic.fna && \
mlst ${GENBANK_ACCESSION}-download/ncbi_dataset/data/${GENBANK_ACCESSION}/${GENBANK_ACCESSION}.genomic.fna | tee mlst.${GENBANK_ACCESSION}.tsv && \
echo && \
echo "Checking for ST15199 in the mlst results now..." && \
grep "15199" mlst.${GENBANK_ACCESSION}.tsv

### Example command to run mlst (broken into two lines for readability)
### If you have an assembly named contigs.fasta in your PWD:
# $ docker run -v ${PWD}:/data staphb/mlst:latest \
# mlst contigs.fasta >mlst-results.tsv
Loading

0 comments on commit e902f64

Please sign in to comment.