Skip to content

Commit

Permalink
Deploying to gh-pages-landing from @ f22dde8 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
kristinelacek committed Sep 23, 2024
1 parent f00374b commit aaff032
Show file tree
Hide file tree
Showing 46 changed files with 436 additions and 380 deletions.
31 changes: 28 additions & 3 deletions .dockerignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
**/.git
**/.gitignore
# ignore file extensions
*.DS_Store
*.Rmd
*.html
*.md
*.Rhistory
*.gitignore
*.Rbuildignore
*.Rproj

# ignore folders
**.git
**.github
**.Rproj.user
*docs
docker.compose.yml
*vignettes
*man
*docker
*inst
*data
*pkgdown

# ignore specific files
change_log.txt
MIRA-INSTALL.sh
install_docker.sh
docker-compose.yml
docker-compose-*.yml
_pkgdown.yml
MIRA-INSTALL.sh
MIRA.code-workspace
NAMESPACE

7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ scripts/__pycache__/muscle.cpython-37.pyc
*.Rhistory
*.Rbuildignore
*.Rproj
vignettes/*.html
*.Rproj.user

# ignore folders
**/.Rproj.user


.Rproj.user
# ignore specific files
change_log.txt
docker-compose-dev.yml
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: MIRA
Type: Package
Title: Dashboard for Influenza and SARS-COV-2 Spike-Gene Genome Assembly and Curation
Version: 1.1.4
Date: 2024-03-28
Version: 2.0.0
Date: 2023-08-08
Authors@R:
c(person(given="Ben", family="Rambo-Martin", role=c("aut","cre"),
email="nbx0@cdc.gov", comment=c(ORCID="0000-0002-8591-3954")),
Expand Down
199 changes: 82 additions & 117 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,117 +1,82 @@

# Create a build argument
ARG BUILD_STAGE
ARG BUILD_STAGE=${BUILD_STAGE:-prod}

############# Build Stage: Dependencies ##################

# Start from a base image
FROM --platform=linux/amd64 ubuntu:focal as base

# Define a system argument
ARG DEBIAN_FRONTEND=noninteractive

# Install system libraries of general use
RUN apt-get update --allow-releaseinfo-change && apt-get install --no-install-recommends -y \
build-essential \
iptables \
libdevmapper1.02.1 \
python3.7\
python3-pip \
python3-setuptools \
python3-dev \
dpkg \
sudo \
wget \
curl \
dos2unix

############# Build Stage: Development ##################

# Build from the base image for dev
FROM base as dev

# Create working directory variable
ENV WORKDIR=/data

# Create a stage enviroment
ENV STAGE=dev

############# Build Stage: Production ##################

# Build from the base image for prod
FROM base as prod

# Create working directory variable
ENV WORKDIR=/data

# Create a stage enviroment
ENV STAGE=prod

# Copy all scripts to docker images
COPY . /MIRA

############# Build Stage: Final ##################

# Build the final image
FROM ${BUILD_STAGE} as final

# Set up volume directory in docker
VOLUME ${WORKDIR}

# Set up working directory in docker
WORKDIR ${WORKDIR}

# Allow permission to read and write files to current working directory
RUN chmod -R a+rwx ${WORKDIR}

############# Install Docker ##################

# Copy all files to docker images
COPY docker /MIRA/docker

# Copy all files to docker images
COPY install_docker.sh /MIRA/install_docker.sh

# Convert bash script from Windows style line endings to Unix-like control characters
RUN dos2unix /MIRA/install_docker.sh

# Allow permission to excute the bash script
RUN chmod a+x /MIRA/install_docker.sh

# Execute bash script to install the package
RUN bash /MIRA/install_docker.sh

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

# Copy python requirements file to docker images
COPY requirements.txt /MIRA/requirements.txt

# Install python requirements
RUN pip3 install --no-cache-dir -r /MIRA/requirements.txt

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

# Copy all files to docker images
COPY dashboard-kickoff /MIRA/dashboard-kickoff

# Convert bash script from Windows style line endings to Unix-like control characters
RUN dos2unix /MIRA/dashboard-kickoff

# Allow permission to excute the bash scripts
RUN chmod a+x /MIRA/dashboard-kickoff

# Allow permission to read and write files to MIRA directory
RUN chmod -R a+rwx /MIRA

# Make the app available at port 8050
EXPOSE 8050

# Clean up
RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*

# Export bash script to path
ENV PATH "$PATH:/MIRA"

# Execute the pipeline
ENTRYPOINT ["bash", "dashboard-kickoff"]
# Create an argument to pull a particular version of dias image
ARG spyne_image
ARG spyne_image=${spyne_image:-cdcgov/spyne:latest}

############# spyne image as base ##################
FROM ${spyne_image} as spyne
RUN echo "Getting spyne image"

# local apt mirror support
# start every stage with updated apt sources
ARG APT_MIRROR_NAME=
RUN if [ -n "$APT_MIRROR_NAME" ]; then sed -i.bak -E '/security/! s^https?://.+?/(debian|ubuntu)^http://'"$APT_MIRROR_NAME"'/\1^' /etc/apt/sources.list && grep '^deb' /etc/apt/sources.list; fi

# 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 \
dos2unix

# Create a working directory variable
ENV WORKDIR=/data

# Set up volume directory
VOLUME ${WORKDIR}

# Set up working directory
WORKDIR ${WORKDIR}

# Create a program variable
ENV MIRA_PROGRAM_DIR=/MIRA

# Set up volume directory
VOLUME ${MIRA_PROGRAM_DIR}

# Copy all scripts to docker images
COPY . ${MIRA_PROGRAM_DIR}

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

# Copy python requirements file 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

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

# Copy all files to docker images
COPY dashboard-kickoff ${MIRA_PROGRAM_DIR}/dashboard-kickoff

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

# Allow permission to excute the bash scripts
RUN chmod a+x ${MIRA_PROGRAM_DIR}/dashboard-kickoff

# Allow permission to read and write files to MIRA directory
RUN chmod -R a+rwx ${MIRA_PROGRAM_DIR}

# Make the app available at port 8050
EXPOSE 8050

# Clean up and remove unwanted files
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/

# Export dais-ribosome script to path
ENV PATH "$PATH:/dais-ribosome"

# Export irma script to path
ENV PATH "$PATH:/flu-amd"

# Export spyne script to path
ENV PATH "$PATH:/spyne"

# Execute the pipeline
ENTRYPOINT ["/bin/bash", "-c", "/MIRA/dashboard-kickoff"]
Loading

0 comments on commit aaff032

Please sign in to comment.