Skip to content

Commit

Permalink
Prepare 4.0.0.-alpha release
Browse files Browse the repository at this point in the history
  • Loading branch information
adthrasher committed May 10, 2023
2 parents 4abef95 + 8e0b6bc commit c45f88d
Show file tree
Hide file tree
Showing 16 changed files with 265 additions and 115 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,35 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Sanitize Repo Name for Tagging
run: echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]' | (read; echo REPO_LOWER=$REPLY) >> $GITHUB_ENV
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GH_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
push: true
tags: |
ghcr.io/${{ env.REPO_LOWER }}:${{ github.event.release.tag_name }}
ghcr.io/${{ env.REPO_LOWER }}:latest
${{ env.REPO_LOWER }}:${{ github.event.release.tag_name }}
${{ env.REPO_LOWER }}:latest
12 changes: 6 additions & 6 deletions .github/workflows/docker_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: Publish Docker image
on:
push:
branches-ignore:
- 'master'
- 'main'

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Sanitize Repo Name for Tagging
run: echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]' | (read; echo REPO_LOWER=$REPLY) >> $GITHUB_ENV
Expand All @@ -25,18 +25,18 @@ jobs:
type=ref,event=pr
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
41 changes: 16 additions & 25 deletions .github/workflows/lint-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,40 @@ name: lint-check
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

jobs:
import_syntax_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check import syntax
run: |
EXITCODE=0
for file in $(find . -name '*.wdl'); do
>&2 echo "Checking file $file..."
import_lines=$(awk '/import/' "$file")
bad_lines=$(echo "$import_lines" | awk '!/https:\/\/raw.githubusercontent.com\/stjude\/xenocp\/master/ && !/https:\/\/raw.githubusercontent.com\/stjudecloud\/workflows\/master/' | grep -v '# lint-check: ignore') || true
bad_lines=$(echo "$import_lines" | awk '/https:\/\/raw.githubusercontent.com\/stjude\/XenoCP/') || true
if [ -n "$bad_lines" ]; then
>&2 echo "Must import files from the master branch on Github."
>&2 echo "Imports from this repo must use relative paths!"
>&2 echo "The following lines are bad:"
>&2 echo "$bad_lines"
>&2 echo ""
EXITCODE=1
fi
done
exit $EXITCODE
docker_pull_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Ensure SemVer'd docker images are being pulled
run: |
EXITCODE=0
files=$(find . -name '*.wdl')
for file in $files; do
while IFS= read -r line; do
tag=$(echo "$line" | awk -F ':' '{print substr($3, 1, length($3)-1)}')
if ! [[ $tag =~ ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$ ]]; then
>&2 echo "All Docker containers must be using an official SemVer tagged image"
>&2 echo "Offending line: $line"
>&2 echo "In file: $file"
EXITCODE=1
fi
done < <(awk '/docker: .*stjudecloud/ || /docker: .*stjude/' < "$file")
bad_lines=$(echo "$import_lines" | awk '/http/ && (/main/ || /master/)') || true
if [ -n "$bad_lines" ]; then
>&2 echo "Imports from external repos must use a tagged release!"
>&2 echo "The following lines are bad:"
>&2 echo "$bad_lines"
>&2 echo ""
EXITCODE=1
fi
done
exit $EXITCODE
11 changes: 4 additions & 7 deletions .github/workflows/miniwdl-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
miniwdl_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.6'
python-version: '3.10'
- name: Install miniwdl
run: |
python -m pip install --upgrade pip
Expand All @@ -20,10 +20,7 @@ jobs:
EXITCODE=0
echo "Checking WDL files using \`miniwdl check\`."
files=$(find . -name '*.wdl')
for file in $files; do
sed -i 's,https://raw.githubusercontent.com/stjude/xenocp/'"$(echo ${GITHUB_REF#refs/heads/})"','"$(pwd)"',g' "$file"
sed -i 's,https://raw.githubusercontent.com/stjude/xenocp/master,'"$(pwd)"',g' "$file"
done
for file in $files; do
echo " [***] $file [***]"
miniwdl check "$file"
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: release-check

on:
push:
branches:
- release
pull_request:
branches:
- release

jobs:
docker_pull_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Ensure SemVer'd docker images are being pulled
run: |
EXITCODE=0
files=$(find . -name '*.wdl')
for file in $files; do
while IFS= read -r line; do
tag=$(echo "$line" | awk -F ':' '{print substr($3, 1, length($3)-1)}')
if ! [[ $tag =~ ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$ ]]; then
>&2 echo "All Docker containers must be using an official SemVer tagged image"
>&2 echo "Offending line: $line"
>&2 echo "In file: $file"
EXITCODE=1
fi
done < <(awk '/docker: .*stjudecloud/ || /docker: .*stjude/' < "$file")
done
exit $EXITCODE
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ubuntu:18.04 as builder
FROM ubuntu:20.04 as builder

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get --yes install \
Expand Down Expand Up @@ -73,7 +75,7 @@ RUN cd /tmp/xenocp \
&& gradle installDist \
&& cp -r build/install/xenocp /opt

FROM ubuntu:18.04
FROM ubuntu:20.04

RUN apt-get update \
&& apt-get --yes install --no-install-recommends \
Expand All @@ -82,6 +84,7 @@ RUN apt-get update \
openjdk-11-jre-headless \
python3 \
python3-distutils \
python-is-python3 \
file \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -98,4 +101,4 @@ COPY --from=builder /opt/xenocp/bin/* /usr/local/bin/

COPY cwl /opt/xenocp/cwl

ENTRYPOINT ["cwl-runner", "--parallel", "--outdir", "results", "/opt/xenocp/cwl/xenocp.cwl"]
ENTRYPOINT ["cwl-runner", "--parallel", "--outdir", "results", "--no-container", "/opt/xenocp/cwl/xenocp.cwl"]
5 changes: 5 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release

* [ ] Update version in `dx_app/dxapp.json`.
* [ ] Update `wdl/tools/xenocp.wdl` with version.
* [ ] Update `wdl/workflows/xenocp.wdl` with version.
2 changes: 2 additions & 0 deletions bin/picard
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
java -jar /opt/picard/lib/picard*.jar "$@"
5 changes: 5 additions & 0 deletions cwl/bwa_mem_onlymapped.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ hints:
tweak_sam:
specs: ["java.sh org.stjude.compbio.sam.TweakSam"]

requirements:
ResourceRequirement:
ramMin: 15000
coresMin: 1

inputs:
ref_db_prefix:
type: string
Expand Down
32 changes: 32 additions & 0 deletions cwl/cat.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
doc: |
Merge a set of files into file using the cat utility.

requirements:
- class: InlineJavascriptRequirement

baseCommand: cat

inputs:
output_file:
type: string
doc: |
Name of final file.

input_files:
type: File[]
inputBinding:
position: 4
doc: |
Array of files to merge.

stdout: $(inputs.output_file)

outputs:
combined_file:
type: File
outputBinding:
glob: $(inputs.output_file)
Loading

0 comments on commit c45f88d

Please sign in to comment.