This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from wleepang/nextflow-updates
Nextflow updates
- Loading branch information
Showing
4 changed files
with
242 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM centos:7 AS build | ||
|
||
RUN yum update -y \ | ||
&& yum install -y \ | ||
curl \ | ||
java-1.8.0-openjdk \ | ||
awscli \ | ||
&& yum clean -y all | ||
|
||
ENV JAVA_HOME /usr/lib/jvm/jre-openjdk/ | ||
|
||
WORKDIR /opt/inst | ||
RUN curl -s https://get.nextflow.io | bash | ||
RUN mv nextflow /usr/local/bin | ||
|
||
COPY nextflow.aws.sh /opt/bin/nextflow.aws.sh | ||
RUN chmod +x /opt/bin/nextflow.aws.sh | ||
|
||
WORKDIR /opt/work | ||
ENTRYPOINT ["/opt/bin/nextflow.aws.sh"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
NEXTFLOW_SCRIPT=$1 | ||
|
||
# Create the default config using environment variables | ||
# passed into the container | ||
mkdir -p /opt/config | ||
NF_CONFIG=/opt/config/nextflow.config | ||
|
||
cat << EOF > $NF_CONFIG | ||
workDir = "$NF_WORKDIR" | ||
process.executor = "awsbatch" | ||
process.queue = "$NF_JOB_QUEUE" | ||
executor.awscli = "/home/ec2-user/miniconda/bin/aws" | ||
EOF | ||
|
||
# AWS Batch places multiple jobs on an instance | ||
# To avoid file path clobbering use the JobID and JobAttempt | ||
# to create a unique path | ||
GUID="$AWS_BATCH_JOB_ID/$AWS_BATCH_JOB_ATTEMPT" | ||
|
||
mkdir -p /opt/work/$GUID | ||
cd /opt/work/$GUID | ||
|
||
# stage workflow definition | ||
aws s3 cp --no-progress $NEXTFLOW_SCRIPT . | ||
|
||
NF_FILE=$(find . -name "*.nf") | ||
|
||
echo "== Nextflow Configuration ==" | ||
cat $NF_CONFIG | ||
|
||
echo "== Running Workflow ==" | ||
nextflow -c $NF_CONFIG run $NF_FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters