Skip to content

V2.1.0 #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: prod
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: MIRA
Type: Package
Title: Portable, Interactive Application for High-Quality Influenza, SARS-CoV-2, & RSV Genome Assembly, Annotation, and Curation
Version: 2.0.0
Version: 2.1.0
Date: 2024-09-23
Authors@R:
c(person(given="Kristine", family="Lacek", role=c("cre", "aut"),
Expand Down
47 changes: 39 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ RUN if [ -n "$APT_MIRROR_NAME" ]; then sed -i.bak -E '/security/! s^https?://.+?
# Install and update system libraries of general use
RUN apt-get update --allow-releaseinfo-change --fix-missing \
&& apt-get install --no-install-recommends -y \
build-essential \
iptables \
python3.7 \
python3-pip \
python3-setuptools \
vim \
dos2unix

# Create a working directory variable
Expand All @@ -41,11 +37,46 @@ COPY . ${MIRA_PROGRAM_DIR}

############# Install python packages ##################

# Copy python requirements file to docker images
# Copy all files to docker images
COPY requirements.txt ${MIRA_PROGRAM_DIR}/requirements.txt

# Install python requirements
RUN pip3 install --no-cache-dir -r ${MIRA_PROGRAM_DIR}/requirements.txt
# Update pip and setuptools and then install python packages
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r ${MIRA_PROGRAM_DIR}/requirements.txt

############# Fix vulnerablities pkgs ##################

# Copy all files to docker images
COPY fixed_vulnerability_pkgs.txt ${MIRA_PROGRAM_DIR}/fixed_vulnerability_pkgs.txt

# Copy all files to docker images
COPY fixed_vulnerability_pkgs.sh ${MIRA_PROGRAM_DIR}/fixed_vulnerability_pkgs.sh

# Convert bash script from Windows style line endings to Unix-like control characters
RUN dos2unix ${MIRA_PROGRAM_DIR}/fixed_vulnerability_pkgs.sh

# Allow permission to excute the bash script
RUN chmod a+x ${MIRA_PROGRAM_DIR}/fixed_vulnerability_pkgs.sh

# Execute bash script to wget the file and tar the package
RUN bash ${MIRA_PROGRAM_DIR}/fixed_vulnerability_pkgs.sh

############# Remove vulnerability pkgs ##################

# Copy all files to docker images
COPY remove_vulnerability_pkgs.txt ${MIRA_PROGRAM_DIR}/remove_vulnerability_pkgs.txt

# Copy all files to docker images
COPY remove_vulnerability_pkgs.sh ${MIRA_PROGRAM_DIR}/remove_vulnerability_pkgs.sh

# Convert bash script from Windows style line endings to Unix-like control characters
RUN dos2unix ${MIRA_PROGRAM_DIR}/remove_vulnerability_pkgs.sh

# Allow permission to excute the bash script
RUN chmod a+x ${MIRA_PROGRAM_DIR}/remove_vulnerability_pkgs.sh

# Execute bash script to wget the file and tar the package
RUN bash ${MIRA_PROGRAM_DIR}/remove_vulnerability_pkgs.sh

############# Launch MIRA dashboard ##################

Expand Down
7 changes: 6 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@

# MIRA 2.0.0
# MIRA 2.1.0

* Github Repo: https://github.com/CDCgov/MIRA
* Documentation: https://cdcgov.github.io/MIRA

### v2.1.0
- Artic RSV primers added
- VIDRL RSV primers added
- Containers rebuilt without vulnerability

### v2.0.0
- Single container distribution (previously 4 docker images)
- RSV Illumina module
Expand Down
10 changes: 7 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ def run_snake_script_onClick(
docker_cmd += f"-p {Amplicon_Library_SC2} "
elif "rsv-illumina" in experiment_type.lower():
docker_cmd += f"-p {Amplicon_Library_RSV} "
elif "sc2-spike-only-illumina" in experiment_type.lower():
docker_cmd += f"-p s_gene "
docker_cmd += f"-c CLEANUP-FOOTPRINT"
print(f'launching docker_cmd == "{docker_cmd}"\n\n')
subprocess.Popen(docker_cmd.split(), close_fds=True)
Expand Down Expand Up @@ -1055,12 +1057,13 @@ def blank_fig():
dcc.Dropdown(
[
{"label": "Flu-ONT", "value": "Flu-ONT"},
{"label": "SC2-Spike-Only-ONT", "value": "SC2-Spike-Only-ONT"},
{"label": "Flu-Illumina", "value": "Flu-Illumina"},
{"label": "SC2-Spike-Only-ONT", "value": "SC2-Spike-Only-ONT"},
{"label": "SC2-Spike-Only-Illumina", "value":"SC2-Spike-Only-Illumina"},
{"label": "SC2-Whole-Genome-ONT", "value":"SC2-Whole-Genome-ONT"},
{"label": "SC2-Whole-Genome-Illumina", "value": "SC2-Whole-Genome-Illumina"},
{"label": "RSV-Illumina", "value": "RSV-Illumina"},
{"label": "RSV-ONT", "value": "RSV-ONT",},
{"label": "RSV-ONT", "value": "RSV-ONT"},
],
id="experiment_type",
placeholder="What kind of data is this?",
Expand Down Expand Up @@ -1094,8 +1097,9 @@ def blank_fig():
dcc.Dropdown(
[
{"label": "RSV CDC 8 amplicon 230901", "value": "RSV_CDC_8amplicon_230901"},
{"label": "Dong et al. 230312", "value": "dong_et_al"},
{"label": "WHO-CC Australia | 2024", "value": "australia_cc_2024"},
{"label": "Davina-Nunez et al. - WG pools", "value": "davina_nunez_wgs"},
{"label": "Artic V1", "value":"artic_v1"}
], # add handling here for no primers used
id="Amplicon_Library_RSV",
placeholder="For Illumina RSV, which primer schema was used?",
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-cdcgov.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
version: "3.9"

x-mira-image:
&mira-image
cdcgov/mira:v2.0.0
cdcgov/mira:latest

x-data-volume:
&data-volume
Expand All @@ -19,3 +18,4 @@ services:
- 8020:8050
volumes:
- *data-volume
command: tail -f /dev/null
18 changes: 2 additions & 16 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
version: "3.9"

x-spyne-image:
&spyne-image
spyne_image: cdcgov/spyne-dev:v2.0.0

x-mira-volume:
&mira-volume
type: bind
source: /home/snu3/Github/MIRA
target: /MIRA

x-spyne-volume:
&spyne-volume
type: bind
source: /home/snu3/Github/spyne
target: /spyne
spyne_image: spyne:latest

x-data-volume:
&data-volume
Expand All @@ -36,5 +23,4 @@ services:
- 8020:8050
volumes:
- *data-volume
- *mira-volume
- *spyne-volume
command: tail -f /dev/null
25 changes: 16 additions & 9 deletions docker-compose-git.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"

x-spyne-git-repo:
&spyne-git-repo
Expand All @@ -8,21 +7,29 @@ x-mira-git-repo:
&mira-git-repo
https://github.com/CDCgov/MIRA.git#prod

x-base-image:
&base-image
base_image: python:3.10-slim-bookworm

x-python-version:
&python-version
python_version: python3.10

x-irma-image:
&irma-image
cdcgov/irma:v1.2.0
irma_image: cdcgov/irma:v1.2.1

x-dais-image:
&dais-image
cdcgov/dais-ribosome:v1.5.4
dais_image: cdcgov/dais-ribosome:v1.5.5

x-spyne-image:
&spyne-image
spyne:v2.0.0
spyne:latest

x-mira-image:
&mira-image
mira:v2.0.0
mira:latest

x-data-volume:
&data-volume
Expand All @@ -38,8 +45,7 @@ services:
context: *spyne-git-repo
dockerfile: Dockerfile
args:
irma_image: *irma-image
dais_image: *dais-image
<< : [*base-image, *python-version, *irma-image, *dais-image]
restart: always
networks:
- backend
Expand All @@ -65,6 +71,7 @@ services:
- 8020:8050
volumes:
- *data-volume
command: tail -f /dev/null

networks:
backend:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
version: "3.9"

x-spyne-image:
&spyne-image
spyne_image: cdcgov/spyne:v2.0.0
spyne_image: cdcgov/spyne:latest

x-data-volume:
&data-volume
type: bind
source: ~/FLU_SC2_SEQUENCING
source: /home/snu3/Github/FLU_SC2_SEQUENCING
target: /data

services:
Expand All @@ -24,3 +23,4 @@ services:
- 8020:8050
volumes:
- *data-volume
command: tail -f /dev/null
49 changes: 49 additions & 0 deletions fixed_vulnerability_pkgs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

#!/bin/bash
# Wrapper to install python packages

# Path to requirement file
SPYNE_PROGRAM_DIR=${SPYNE_PROGRAM_DIR:-/spyne}
fixed_pkgs=${SPYNE_PROGRAM_DIR}/fixed_vulnerability_pkgs.txt
fixed_pkgs_clean=${SPYNE_PROGRAM_DIR}/fixed_vulnerability_pkgs_clean.txt

# Install updated version of python pkgs
if [[ -f ${fixed_pkgs} ]]
then

echo "Update python packages"

# Remove blank lines from the file and save a cleaner version of it
awk NF < ${fixed_pkgs} > ${fixed_pkgs_clean}

# Get number of packages in the file
n=`wc -l < ${fixed_pkgs_clean}`
i=1

while [[ i -le $n ]];
do
echo $i
# Get the name of the package and its version
updated_pkg=$(head -${i} ${fixed_pkgs_clean} | tail -1 | sed -e 's,\r,,g')
echo $updated_pkg
# Get the package name only
pkg_name=$(echo ${updated_pkg} | sed -e "s/\(.*\)\(==\)\(.*\)/\1/g")
echo $pkg_name
# Check if package already existed in pip install
check_pip_pkg=$(pip list | grep -w ${pkg_name} | sed -e "s/\s\+/==/g")
echo $check_pip_pkg
# If package exists, update to new version
case ${check_pip_pkg} in
"") ;;
*) pip install --no-cache-dir ${updated_pkg};;
esac
# Go to next pkg
i=$(($i+1))
done

# Return message to keep the process going
echo "Done"

fi


2 changes: 2 additions & 0 deletions fixed_vulnerability_pkgs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setuptools==70.0.0
idna==3.10
38 changes: 38 additions & 0 deletions remove_vulnerability_pkgs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

#!/bin/bash
# Wrapper to remove vulnerability packages

SPYNE_PROGRAM_DIR=${SPYNE_PROGRAM_DIR:-/spyne}
remove_pkgs=${SPYNE_PROGRAM_DIR}/remove_vulnerability_pkgs.txt
remove_pkgs_clean=${SPYNE_PROGRAM_DIR}/remove_vulnerability_pkgs_clean.txt
python_version=${python_version:-python3.10}

# Extract bbmap package to the bbtools directory
if [[ -f ${remove_pkgs} ]]
then

echo "Remove vulnerability packages"

# Remove blank lines from the file and save a cleaner version of it
awk NF < ${remove_pkgs} > ${remove_pkgs_clean}

# Get number of packages in the file
n=`wc -l < ${remove_pkgs_clean}`
i=1

while [[ i -le $n ]];
do
echo $i
# Get the name of the package
pkg_name=$(head -${i} ${remove_pkgs_clean} | tail -1 | sed 's,\r,,g')
echo $pkg_name
# Remove the package if it exists
find /usr/local/lib/${python_version}/site-packages -name "*${pkg_name}*" -exec rm -rf {} \;
# Go to next file
i=$(($i+1))
done

# Return message to keep the process going
echo "Done"

fi
Empty file added remove_vulnerability_pkgs.txt
Empty file.
16 changes: 8 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
colorlover
dash==2.11.0
dash==2.15.0
dash-bio==0.2.0
dash-bootstrap-components==1.2.1
dash-core-components==2.0.0
dash-daq==0.5.0
dash-html-components==2.0.0
dash-table==5.0.0
flask==2.1.3
flask==3.0.3
flask-caching==1.10.1
flask-compress==1.5.0
numpy==1.19.5
openpyxl==3.0.10
pandas==1.1.0
numpy==1.23.1
openpyxl==3.1.0
pandas==2.0.3
plotly==5.11.0
pyyaml==6.0
requests==2.28.1
Werkzeug==2.2.2
pyyaml==6.0.2
requests==2.32.0
Werkzeug==3.0.6